1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
$connection = ldap_connect("ldap://".$this->hote,$this->port);
ldap_set_option($connection,LDAP_OPT_PROTOCOL_VERSION,3);
if ($connection) {
//Authentification
$ldapbind = ldap_bind($connection, 'ADMIN-Write','password');
echo '<p>Connexion...</p>';
if ( $ldapbind ) {
echo '<p>Authentifié...</p>';
$deplacer = ldap_rename($connection,"cn=monpc,ou=ordinateurs,dc=mondomaine","cn=monpc","ou=newdest,dc=mondomaine",true);
$erreur = ldap_err2str(ldap_errno($connection));
ldap_close($connection);
return $deplacer == true ? true : $erreur ;
}
else return FALSE;
}
else return FALSE; |
Partager