public function UserSingleBase::cancel

8.0.x UserSingleBase.php public UserSingleBase::cancel()
7.x UserSingleBase.php public UserSingleBase::cancel()
master UserSingleBase.php public UserSingleBase::cancel()

Block a user and remove or reassign their content.

1 method overrides UserSingleBase::cancel()
UserSingle6::cancel in lib/Drush/User/UserSingle6.php
Block a user and remove or reassign their content.

File

lib/Drush/User/UserSingleBase.php, line 81

Namespace

Drush\User

Class

UserSingleBase

Code

public function cancel() {
  if (drush_get_option('delete-content')) {
    user_cancel(array(), $this->id(), 'user_cancel_delete');
  }
  else {
    user_cancel(array(), $this->id(), 'user_cancel_reassign');
  }
  // I got the following technique here: http://drupal.org/node/638712
  $batch = &batch_get();
  $batch['progressive'] = FALSE;
  batch_process();
}