function drush_user_cancel

8.0.x user.drush.inc drush_user_cancel($inputs)
6.x user.drush.inc drush_user_cancel($name)
7.x user.drush.inc drush_user_cancel($inputs)
4.x user.drush.inc drush_user_cancel($name)
5.x user.drush.inc drush_user_cancel($name)
master user.drush.inc drush_user_cancel($inputs)

Cancels a user account.

File

commands/user/user.drush.inc, line 338
Drush User Management commands

Code

function drush_user_cancel($inputs) {
  $userlist = new UserList($inputs);
  foreach ($userlist->accounts as $account) {
    if (drush_get_option('delete-content') && drush_drupal_major_version() >= 7) {
      drush_print(dt('All content created by !name will be deleted.', '!name'));
    }
    if (drush_confirm('Cancel user account?: ')) {
      $account->cancel();
    }
  }
  drush_log(dt('Cancelled user(s): !users', array('!users' => $userlist->names())), LogLevel::SUCCESS);
}