You are here

function user_user_operations_block in Drupal 6

Same name and namespace in other branches
  1. 5 modules/user/user.module \user_user_operations_block()
  2. 7 modules/user/user.module \user_user_operations_block()

Callback function for admin mass blocking users.

1 string reference to 'user_user_operations_block'
user_user_operations in modules/user/user.module
Implementation of hook_user_operations().

File

modules/user/user.module, line 1913
Enables the user registration and login system.

Code

function user_user_operations_block($accounts) {
  foreach ($accounts as $uid) {
    $account = user_load(array(
      'uid' => (int) $uid,
    ));

    // Skip blocking user if they are already blocked.
    if ($account !== FALSE && $account->status == 1) {
      user_save($account, array(
        'status' => 0,
      ));
    }
  }
}