user_login_submit

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

Submit handler for the login form. Load $user object and perform standard login tasks. The user is then redirected to the My Account page. Setting the destination in the query string overrides the redirect.

▾ 3 functions call user_login_submit()

openid_authentication in modules/openid/openid.module
Authenticate a user or attempt registration.
user_external_login_register in modules/user/user.module
Helper function for authentication modules. Either logs in or registers the current user, based on username. Either way, the global $user object is populated and login tasks are performed.
user_register_submit in modules/user/user.module
Submit handler for the user registration form.

Code

modules/user/user.module, line 1905

<?php
function user_login_submit($form, &$form_state) {
  global $user;
  $user = user_load($form_state['uid']);
  user_login_finalize();

  $form_state['redirect'] = '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.