From 00bfb38d3079bac68d983d029bd68727ba159cb1 Mon Sep 17 00:00:00 2001 From: Victor Saisa Lopez Date: Wed, 10 Oct 2012 12:29:10 -0400 Subject: [PATCH] BUG 9749 "AD Primary Identifier" SOLVED - Change the primary identifier samaccountname by other field - Problem solved, User Identifier field can now be set to samaccountname and mail - It improves sending parameters to the method VerifyWithOtherAuthenticationSource() --- gulliver/system/class.rbac.php | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/gulliver/system/class.rbac.php b/gulliver/system/class.rbac.php index 0d24ad85d..d28710b17 100755 --- a/gulliver/system/class.rbac.php +++ b/gulliver/system/class.rbac.php @@ -257,7 +257,7 @@ class RBAC * -4: due date * -5: invalid authentication source */ - function VerifyWithOtherAuthenticationSource( $sAuthType, $sAuthSource, $aUserFields, $sAuthUserDn, $strPass) + public function VerifyWithOtherAuthenticationSource($sAuthType, $aUserFields, $strPass) { //check if the user is active if ( $aUserFields['USR_STATUS'] != 1 ) @@ -270,9 +270,9 @@ class RBAC foreach ( $this->aRbacPlugins as $sClassName) { if ( strtolower($sClassName) == strtolower($sAuthType) ) { $plugin = new $sClassName(); - $plugin->sAuthSource = $sAuthSource; + $plugin->sAuthSource = $aUserFields["UID_AUTH_SOURCE"]; $plugin->sSystem = $this->sSystem; - $bValidUser = $plugin->VerifyLogin ( $sAuthUserDn, $strPass ); + $bValidUser = $plugin->VerifyLogin($aUserFields["USR_AUTH_USER_DN"], $strPass); if ( $bValidUser === TRUE) return ( $aUserFields['USR_UID'] ); @@ -321,18 +321,16 @@ class RBAC $sAuthType = 'mysql'; if ( isset($this->userObj->fields['USR_AUTH_TYPE']) ) $sAuthType = strtolower ( $this->userObj->fields['USR_AUTH_TYPE'] ); - //hook for RBAC plugins - if ( $sAuthType != 'mysql' && $sAuthType != '' ) { - $sAuthSource = $this->userObj->fields['UID_AUTH_SOURCE']; - $sAuthUserDn = $this->userObj->fields['USR_AUTH_USER_DN']; - $res = $this->VerifyWithOtherAuthenticationSource( $sAuthType, $sAuthSource, $this->userObj->fields, $sAuthUserDn, $strPass); + //Hook for RBAC plugins + if ($sAuthType != "mysql" && $sAuthType != "") { + $res = $this->VerifyWithOtherAuthenticationSource($sAuthType, $this->userObj->fields, $strPass); - return $res; - } - else { - $this->userObj->reuseUserFields = true; - $res = $this->userObj->VerifyLogin($strUser, $strPass); - return $res; + return $res; + } else { + $this->userObj->reuseUserFields = true; + $res = $this->userObj->VerifyLogin($strUser, $strPass); + + return $res; } }