You are here

public function LdapUserConf::deleteDrupalAccount in Lightweight Directory Access Protocol (LDAP) 8.2

Same name and namespace in other branches
  1. 7.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 813

Class

LdapUserConf

Code

public function deleteDrupalAccount($username) {
  $user = user_load_by_name($username);
  if (is_object($user)) {
    user_delete($user->uid);
    return TRUE;
  }
  else {
    return FALSE;
  }
}