You are here

function userprotect_protected_users_delete_form in User protect 7

Same name and namespace in other branches
  1. 5 userprotect.module \userprotect_protected_users_delete_form()
  2. 6 userprotect.module \userprotect_protected_users_delete_form()

Menu callback. Removes a user from being protected, or removes an administrator bypass.

1 string reference to 'userprotect_protected_users_delete_form'
userprotect_menu in ./userprotect.module
Implements hook_menu().

File

./userprotect.admin.inc, line 275
Administration functions for userprotect module.

Code

function userprotect_protected_users_delete_form($form, &$form_state, $account, $type = 'user') {
  if ($type == 'user') {
    $type_display = t('protections');
    $admin_page = 'protected_users';
  }
  elseif ($type == 'admin') {
    $type_display = t('administrator bypass');
    $admin_page = 'administrator_bypass';
  }
  $form_state['userprotect']['account'] = $account;
  $form_state['userprotect']['type'] = $type;
  $form_state['userprotect']['type_display'] = $type_display;
  $form_state['userprotect']['admin_page'] = $admin_page;
  return confirm_form(array(), t('Are you sure you want to delete the individual !type for %user?', array(
    '!type' => $type_display,
    '%user' => $account->name,
  )), "admin/config/people/userprotect/{$admin_page}");
}