function user_block_user_action

Same name and namespace in other branches
  1. 7.x drupal-7.x/modules/user/user.module \user_block_user_action()

Implementation of a Drupal action. Blocks the current user.

1 string reference to 'user_block_user_action'
user_action_info in drupal-6.x/modules/user/user.module
Implementation of hook_action_info().

Archivo

drupal-6.x/modules/user/user.module, line 2320
Enables the user registration and login system.

Código

function user_block_user_action(&$object, $context = array()) {
  if (isset($object->uid)) {
    $uid = $object->uid;
  }
  elseif (isset($context['uid'])) {
    $uid = $context['uid'];
  }
  else {
    global $user;
    $uid = $user->uid;
  }
  db_query("UPDATE {users} SET status = 0 WHERE uid = %d", $uid);
  sess_destroy_uid($uid);
  watchdog('action', 'Blocked user %name.', array('%name' => check_plain($user->name)));
}