public function LdapServer::delete in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.2 ldap_servers/LdapServer.class.php \LdapServer::delete()
Perform an LDAP delete.
Parameters
string $dn:
Return value
boolean result per ldap_delete
1 call to LdapServer::delete()
- LdapServer::groupRemoveGroup in ldap_servers/
LdapServer.class.php - NOT TESTED remove a group entry.
2 methods override LdapServer::delete()
- LdapServerAdmin::delete in ldap_servers/
LdapServerAdmin.class.php - Perform an LDAP delete.
- LdapServerTest::delete in ldap_test/
LdapServerTest.class.php - Perform an LDAP delete.
File
- ldap_servers/
LdapServer.class.php, line 712 - Defines server classes and related functions.
Class
- LdapServer
- LDAP Server Class.
Code
public function delete($dn) {
if (!$this->connection) {
$this
->connect();
$this
->bind();
}
$result = @ldap_delete($this->connection, $dn);
if (!$result) {
$error = "LDAP Server delete(%dn) in LdapServer::delete() Error Server ID = %sid, LDAP Err No: %ldap_errno LDAP Err Message: %ldap_err2str ";
$tokens = [
'%dn' => $dn,
'%sid' => $this->sid,
'%ldap_errno' => ldap_errno($this->connection),
'%ldap_err2str' => ldap_err2str(ldap_errno($this->connection)),
];
watchdog('ldap_servers', $error, $tokens, WATCHDOG_ERROR);
}
return $result;
}