Merge branch 'master' into dist/envole/6/master

This commit is contained in:
Arnaud Fornerot 2021-01-27 15:42:12 +01:00
commit 6890d67bba
1 changed files with 6 additions and 5 deletions

View File

@ -45,6 +45,8 @@ class ldapService
}
public function connect() {
$this->disconnect();
if($this->connection){
return $this->connection;
} else {
@ -82,11 +84,8 @@ class ldapService
}
public function rename($oldDN, $newDN, $parentDN = '', $deleteOldDN = true){
$connection = $this->connect();
$result = ldap_rename($connection, $oldDN, $newDN, $parentDN, $deleteOldDN);
if(!$result) $this->ldapError();
return $result;
}
@ -124,8 +123,10 @@ class ldapService
}
public function disconnect(){
$connection = $this->connect();
ldap_unbind($connection);
if($this->connection) {
ldap_unbind($this->connection);
$this->connection=null;
}
}
public function ldapError(){