mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-26 03:43:08 +01:00
Fix reconnectAs() calls
This commit is contained in:
parent
d27a59f807
commit
fb62ce2eed
2 changed files with 25 additions and 16 deletions
|
@ -81,10 +81,11 @@ class LSldap extends LSlog_staticLoggerClass {
|
|||
* @param[in] $dn string Bind DN
|
||||
* @param[in] $pwd array Bind password
|
||||
* @param[in] $config array LDAP configuration array in format of Net_LDAP2
|
||||
* (optional, default: keep current)
|
||||
*
|
||||
* @retval boolean true if connected, false instead
|
||||
*/
|
||||
public static function reconnectAs($dn,$pwd,$config) {
|
||||
public static function reconnectAs($dn, $pwd, $config=null) {
|
||||
if ($config) {
|
||||
self :: setConfig($config);
|
||||
}
|
||||
|
|
|
@ -786,7 +786,11 @@ class LSsession {
|
|||
self :: $userLDAPcreds = false;
|
||||
return;
|
||||
}
|
||||
if (!LSldap :: reconnectAs(self :: $userLDAPcreds['dn'],self :: $userLDAPcreds['pwd'])) {
|
||||
if (!LSldap :: reconnectAs(
|
||||
self :: $userLDAPcreds['dn'],
|
||||
self :: $userLDAPcreds['pwd'],
|
||||
self :: $ldapServer['ldap_config']
|
||||
)) {
|
||||
LSerror :: addErrorCode('LSsession_15');
|
||||
return;
|
||||
}
|
||||
|
@ -1239,7 +1243,11 @@ class LSsession {
|
|||
return;
|
||||
}
|
||||
if (self :: $dn && isset(self :: $ldapServer['useUserCredentials']) && self :: $ldapServer['useUserCredentials']) {
|
||||
LSldap :: reconnectAs(self :: $userLDAPcreds['dn'], self :: $userLDAPcreds['pwd'],self :: $ldapServer['ldap_config']);
|
||||
LSldap :: reconnectAs(
|
||||
self :: $userLDAPcreds['dn'],
|
||||
self :: $userLDAPcreds['pwd'],
|
||||
self :: $ldapServer['ldap_config']
|
||||
);
|
||||
}
|
||||
else {
|
||||
LSldap :: connect(self :: $ldapServer['ldap_config']);
|
||||
|
|
Loading…
Reference in a new issue