From 963f23110d303bf1fee2c0f3a914878a9856c9ac Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Sat, 24 Sep 2011 12:57:14 +1200 Subject: [PATCH] Hopefully nail that last LDAP niggle. --- inc/Principal.php | 2 +- inc/drivers_ldap.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/Principal.php b/inc/Principal.php index f0fc3596..fa78aeee 100644 --- a/inc/Principal.php +++ b/inc/Principal.php @@ -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; } diff --git a/inc/drivers_ldap.php b/inc/drivers_ldap.php index 895a2311..1fe7033e 100644 --- a/inc/drivers_ldap.php +++ b/inc/drivers_ldap.php @@ -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 );