You are here

function advuser_admin_account_submit in Advanced User 6.2

Same name and namespace in other branches
  1. 5.2 advuser.module \advuser_admin_account_submit()
  2. 6.3 forms/advuser_admin_account.inc \advuser_admin_account_submit()
  3. 7.3 forms/advuser_admin_account.inc \advuser_admin_account_submit()

Submit the user administration update form.

File

./advuser.module, line 287
Advanced user module allows you to select users based on an advanced set of filtering and apply actions to block, unblock, delete or email the selected users.

Code

function advuser_admin_account_submit($form, &$form_state) {
  $operations = module_invoke_all('user_operations', $form_state);
  $operations = array_merge($operations, module_invoke_all('advuser_operations'));
  $operation = $operations[$form_state['values']['operation']];
  $destination = $form_state['values']['destination'];

  // Filter out unchecked accounts.
  $accounts = array_filter($form_state['values']['accounts']);
  if ($function = $operation['callback']) {

    // Add in callback arguments if present.
    if (isset($operation['callback arguments'])) {
      $args = array_merge(array(
        $accounts,
      ), $operation['callback arguments']);
    }
    else {
      $args = array(
        $accounts,
      );
    }
    call_user_func_array($function, $args);
    cache_clear_all('*', 'cache_menu', TRUE);
    drupal_set_message(t('The update has been performed.'));
    extract(parse_url($destination));
    drupal_goto($path, $query);
  }
}