You are here

function session_limit_settings_validate in Session Limit 7.2

Same name and namespace in other branches
  1. 6.2 session_limit.module \session_limit_settings_validate()
  2. 6 session_limit.module \session_limit_settings_validate()

Settings validation form.

File

./session_limit.module, line 198
Limits multiple sessions per user.

Code

function session_limit_settings_validate($form, &$form_state) {
  $maxsessions = $form_state['values']['session_limit_max'];
  if (!is_numeric($maxsessions)) {
    form_set_error('session_limit_max', t('You must enter a number for the maximum number of active sessions'));
  }
  elseif ($maxsessions < 0) {
    form_set_error('session_limit_max', t('Maximum number of active sessions must be positive'));
  }
}