You are here

function session_limit_user_settings_submit in Session Limit 6.2

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

User settings form submission.

File

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

Code

function session_limit_user_settings_submit($form, &$form_state) {
  watchdog('session_limit', 'Maximum sessions for @user updated to @count.', array(
    '@user' => $form_state['values']['account']->name,
    '@count' => $form_state['values']['session_limit'],
  ), WATCHDOG_INFO, l(t('view'), "user/{$form_state['values']['account']->uid}"));
  if (empty($form_state['values']['session_limit'])) {
    $form_state['values']['session_limit'] = NULL;
  }
  user_save($form_state['values']['account'], array(
    'session_limit' => $form_state['values']['session_limit'],
  ));
  drupal_set_message(t('Session limit updated for %user.', array(
    '%user' => $form_state['values']['account']->name,
  )), 'status', TRUE);
}