You are here

function autologout_form_user_profile_form_alter in Automated Logout 7.2

Same name and namespace in other branches
  1. 6.4 autologout.module \autologout_form_user_profile_form_alter()
  2. 7.4 autologout.module \autologout_form_user_profile_form_alter()

Implements hook_form_FORM_ID_alter().

File

./autologout.module, line 289
Used to automagically log out a user after a preset time, AjK May 2006

Code

function autologout_form_user_profile_form_alter(&$form, &$form_state) {
  _autologout_debug("autologout_form_user_profile_form_alter()");
  $account = $form['#user'];
  if (empty($account->uid)) {
    return;

    // UID 0 not applicable.
  }
  if (_autologout_user_in_by_user_role() && $form['#user_category'] == 'account') {
    $form['autologout'] = array(
      '#type' => 'fieldset',
      '#title' => t('Automated Logout'),
      '#weight' => 10,
      '#collapsible' => TRUE,
    );
    $form['autologout']['autologout'] = array(
      '#type' => 'checkbox',
      '#title' => t('Disable inactivity Automated Logout'),
      '#default_value' => isset($account->autologout) ? $account->autologout : 0,
    );
  }
}