function user_user_operations_block

cis7 user.module user_user_operations_block($accounts)
cle7 user.module user_user_operations_block($accounts)
elmsmedia7 user.module user_user_operations_block($accounts)
icor7 user.module user_user_operations_block($accounts)
meedjum_blog7 user.module user_user_operations_block($accounts)
mooc7 user.module user_user_operations_block($accounts)

Callback function for admin mass blocking users.

2 string references to 'user_user_operations_block'
hook_user_operations in modules/user/user.api.php
Add mass user operations.
user_user_operations in modules/user/user.module
Implements hook_user_operations().

File

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

Code

function user_user_operations_block($accounts) {
  $accounts = user_load_multiple($accounts);
  foreach ($accounts as $account) {
    // Skip blocking user if they are already blocked.
    if ($account !== FALSE && $account->status == 1) {
      // For efficiency manually save the original account before applying any
      // changes.
      $account->original = clone $account;
      user_save($account, array('status' => 0));
    }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.