diff --git a/trunk/conf/config.error_code.php b/trunk/conf/config.error_code.php index 729f084e..17483c64 100644 --- a/trunk/conf/config.error_code.php +++ b/trunk/conf/config.error_code.php @@ -54,6 +54,10 @@ $GLOBALS['LSerror_code'] = array ( 'msg' => _("LSldap : Erreur durant la suppression des attributs vides."), 'level' => 'w' ), + 7 => array ( + 'msg' => _("LSldap : Erreur durant le changement du DN de l'objet."), + 'level' => 'w' + ), // LSldapObject 21 => array ( diff --git a/trunk/includes/class/class.LSldap.php b/trunk/includes/class/class.LSldap.php index 4aa94a9e..da6dec99 100644 --- a/trunk/includes/class/class.LSldap.php +++ b/trunk/includes/class/class.LSldap.php @@ -334,7 +334,12 @@ class LSldap { * @retval boolean True si l'objet à été supprimé, false sinon */ function remove($dn) { - return $this -> cnx -> delete($dn,array('recursive' => true)); + $ret = $this -> cnx -> delete($dn,array('recursive' => true)); + if (Net_LDAP2::isError($ret)) { + $GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); + return; + } + return true; } /** @@ -346,7 +351,13 @@ class LSldap { * @retval boolean True si l'objet a été déplacé, false sinon */ function move($old,$new) { - return (!Net_LDAP2::isError($this -> cnx -> move($old,$new))); + $ret = $this -> cnx -> move($old,$new); + if (Net_LDAP2::isError($ret)) { + $GLOBALS['LSerror'] -> addErrorCode(7); + $GLOBALS['LSerror'] -> addErrorCode(0,'NetLdap-Error : '.$ret->getMessage()); + return; + } + return true; } }