user_login_submit

Versions
4.7 – 5
user_login_submit($form_id, $form_values)
6 – 7
user_login_submit($form, &$form_state)

Code

modules/user/user.module, line 951

<?php
function user_login_submit($form_id, $form_values) {
  global $user;
  if ($user->uid) {
    // To handle the edge case where this function is called during a
    // bootstrap, check for the existence of t().
    if (function_exists('t')) {
      $message = t('Session opened for %name.', array('%name' => $user->name));
    }
    else {
       $message = "Session opened for ". check_plain($user->name);
    }
    watchdog('user', $message);

    // Update the user table timestamp noting user has logged in.
    db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(), $user->uid);

    // Regenerate the session ID to prevent against session fixation attacks.
    sess_regenerate();

    user_module_invoke('login', $form_values, $user);

    return 'user/'. $user->uid;
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.