Hopefully nail that last LDAP niggle.

This commit is contained in:
Andrew McMillan 2011-09-24 12:57:14 +12:00
parent 78e756e8a4
commit 963f23110d
2 changed files with 3 additions and 3 deletions

View File

@ -319,7 +319,7 @@ class Principal {
* @return string The username
*/
function setUsername($new_username) {
if ( $this->exists ) return false;
if ( $this->exists && isset($this->username) ) return false;
$this->username = $new_username;
return $this->username;
}

View File

@ -346,9 +346,9 @@ function LDAP_check($username, $password ){
}
else {
dbg_error_log( "LDAP", "user %s doesn't exist in local DB, we need to create it",$username );
$principal->setUsername($username );
}
$principal->setUsername($username);
// The local cached user doesn't exist, or is older, so we create/update their details
sync_user_from_LDAP( $principal, $mapping, $valid );