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()
This commit is contained in:
Victor Saisa Lopez
2012-10-10 12:29:10 -04:00
parent 64519b4af0
commit 00bfb38d30

View File

@@ -257,7 +257,7 @@ class RBAC
* -4: due date * -4: due date
* -5: invalid authentication source * -5: invalid authentication source
*/ */
function VerifyWithOtherAuthenticationSource( $sAuthType, $sAuthSource, $aUserFields, $sAuthUserDn, $strPass) public function VerifyWithOtherAuthenticationSource($sAuthType, $aUserFields, $strPass)
{ {
//check if the user is active //check if the user is active
if ( $aUserFields['USR_STATUS'] != 1 ) if ( $aUserFields['USR_STATUS'] != 1 )
@@ -270,9 +270,9 @@ class RBAC
foreach ( $this->aRbacPlugins as $sClassName) { foreach ( $this->aRbacPlugins as $sClassName) {
if ( strtolower($sClassName) == strtolower($sAuthType) ) { if ( strtolower($sClassName) == strtolower($sAuthType) ) {
$plugin = new $sClassName(); $plugin = new $sClassName();
$plugin->sAuthSource = $sAuthSource; $plugin->sAuthSource = $aUserFields["UID_AUTH_SOURCE"];
$plugin->sSystem = $this->sSystem; $plugin->sSystem = $this->sSystem;
$bValidUser = $plugin->VerifyLogin ( $sAuthUserDn, $strPass ); $bValidUser = $plugin->VerifyLogin($aUserFields["USR_AUTH_USER_DN"], $strPass);
if ( $bValidUser === TRUE) if ( $bValidUser === TRUE)
return ( $aUserFields['USR_UID'] ); return ( $aUserFields['USR_UID'] );
@@ -321,18 +321,16 @@ class RBAC
$sAuthType = 'mysql'; $sAuthType = 'mysql';
if ( isset($this->userObj->fields['USR_AUTH_TYPE']) ) $sAuthType = strtolower ( $this->userObj->fields['USR_AUTH_TYPE'] ); if ( isset($this->userObj->fields['USR_AUTH_TYPE']) ) $sAuthType = strtolower ( $this->userObj->fields['USR_AUTH_TYPE'] );
//hook for RBAC plugins //Hook for RBAC plugins
if ( $sAuthType != 'mysql' && $sAuthType != '' ) { if ($sAuthType != "mysql" && $sAuthType != "") {
$sAuthSource = $this->userObj->fields['UID_AUTH_SOURCE']; $res = $this->VerifyWithOtherAuthenticationSource($sAuthType, $this->userObj->fields, $strPass);
$sAuthUserDn = $this->userObj->fields['USR_AUTH_USER_DN'];
$res = $this->VerifyWithOtherAuthenticationSource( $sAuthType, $sAuthSource, $this->userObj->fields, $sAuthUserDn, $strPass);
return $res; return $res;
} } else {
else { $this->userObj->reuseUserFields = true;
$this->userObj->reuseUserFields = true; $res = $this->userObj->VerifyLogin($strUser, $strPass);
$res = $this->userObj->VerifyLogin($strUser, $strPass);
return $res; return $res;
} }
} }