1 user.actions.inc user_cancel_user_action($account, &$context)

Queues a specific user account for cancellation.

Parameters

User $account: The user entity whose account will be cancelled.

Related topics

File

core/modules/user/user.actions.inc, line 57
Action callbacks for User module.

Code

function user_cancel_user_action($account, &$context) {
  // Save the list of user accounts to be deleted in the session. Append to 
  // the existing list if within the last minute, otherwise start a new list
  // of user accounts.
  $last_action_time = 0;
  if (isset($_SESSION['user_cancel_action'])) {
    $last_action_time = $_SESSION['user_cancel_action']['timestamp'];
  }
  if (REQUEST_TIME - $last_action_time > 60) {
    $_SESSION['user_cancel_action'] = array(
      'timestamp' => REQUEST_TIME,
      'uids' => array(),
    );
  }

  $_SESSION['user_cancel_action']['uids'][] = $account->uid;

  $context['redirect'] = 'admin/people/cancel';
}