From: Web Access Date: Tue, 17 Mar 2015 04:41:24 +0000 (+0530) Subject: Fix for CRM-14105 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1776392282a06b6c8c9d6e040cf6166df97a159d;p=civicrm-core.git Fix for CRM-14105 --- diff --git a/CRM/Utils/System/WordPress.php b/CRM/Utils/System/WordPress.php index 55171a1583..6d5b8daf4e 100644 --- a/CRM/Utils/System/WordPress.php +++ b/CRM/Utils/System/WordPress.php @@ -351,6 +351,20 @@ class CRM_Utils_System_WordPress extends CRM_Utils_System_Base { } require_once $cmsRootPath . DIRECTORY_SEPARATOR . 'wp-includes/pluggable.php'; $uid = CRM_Utils_Array::value('uid', $name); + if (!$uid) { + $name = $name ? $name : trim(CRM_Utils_Array::value('name', $_REQUEST)); + $pass = $pass ? $pass : trim(CRM_Utils_Array::value('pass', $_REQUEST)); + if ($name) { + $uid = wp_authenticate($name, $pass); + if (!$uid) { + if ($throwError) { + echo '
Sorry, unrecognized username or password.'; + exit(); + } + return FALSE; + } + } + } if ($uid) { $account = wp_set_current_user($uid); if ($account && $account->data->ID) {