public function LdapUserConf::deleteDrupalAccount in Lightweight Directory Access Protocol (LDAP) 7.2
Same name and namespace in other branches
- 8.2 ldap_user/LdapUserConf.class.php \LdapUserConf::deleteDrupalAccount()
Given a drupal account, delete user account.
Parameters
string $username: drupal account name.
Return value
TRUE or FALSE. FALSE indicates failed or action not enabled in ldap user configuration
File
- ldap_user/
LdapUserConf.class.php, line 857
Class
Code
public function deleteDrupalAccount($username) {
$user = user_load_by_name($username);
if (is_object($user)) {
user_delete($user->uid);
return TRUE;
}
else {
return FALSE;
}
}