You are here

function _autologout_user_uid_timeout_validate in Automated Logout 6.4

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

Form validation.

1 string reference to '_autologout_user_uid_timeout_validate'
autologout_form_user_profile_form_alter in ./autologout.module
Adds a field to user/edit to change that users logout.

File

./autologout.module, line 304
Used to automagically log out a user after a preset time.

Code

function _autologout_user_uid_timeout_validate($element, &$form_state) {
  $max_timeout = variable_get('max_timeout', 172800);
  $timeout = $element['#value'];
  if ($timeout != '' && ($timeout < 60 || $timeout > $max_timeout || !is_numeric($timeout))) {
    form_error($element, t('The timeout must be an integer greater than 60, and less then %max.', array(
      '%max' => $max_timeout,
    )));
  }
}