Compare commits

..

No commits in common. "6890d67bba72b5b92f72f9d1ef6193066086439a" and "e684ee670161ec8bfaad39aa0176b85eff93226a" have entirely different histories.

View File

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