You are here

function _autologout_user_uid_timeout_validate in Automated Logout 7.4

Same name and namespace in other branches
  1. 8 autologout.module \_autologout_user_uid_timeout_validate()
  2. 6.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 313
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('autologout_max_timeout', 172800);
  $timeout = $element['#value'];

  // Set error if it has a value that isn't strictly a number between 60 and max.
  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,
    )));
  }
}