Commit 79d927f7 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#152497 by bjaspan, with more docs from myself: user_external_login() was not...

#152497 by bjaspan, with more docs from myself: user_external_login() was not updated to latest login process
parent 7e4ef325
...@@ -89,8 +89,9 @@ function user_external_load($authname) { ...@@ -89,8 +89,9 @@ function user_external_load($authname) {
} }
/** /**
* Perform standard Drupal login operations for a user object. The * Perform standard Drupal login operations for a user object.
* user object must already be authenticated. This function verifies *
* The user object must already be authenticated. This function verifies
* that the user account is not blocked/denied and then performs the login, * that the user account is not blocked/denied and then performs the login,
* updates the login timestamp in the database, invokes hook_user('login'), * updates the login timestamp in the database, invokes hook_user('login'),
* regenerates the session, etc. * regenerates the session, etc.
...@@ -100,6 +101,7 @@ function user_external_load($authname) { ...@@ -100,6 +101,7 @@ function user_external_load($authname) {
* in user. * in user.
* @param $edit * @param $edit
* The array of form values submitted by the user, if any. * The array of form values submitted by the user, if any.
* This array is passed to hook_user op login.
* @return boolean * @return boolean
* TRUE if the login succeeds, FALSE otherwise. * TRUE if the login succeeds, FALSE otherwise.
*/ */
...@@ -113,11 +115,14 @@ function user_external_login($account, $edit = array()) { ...@@ -113,11 +115,14 @@ function user_external_login($account, $edit = array()) {
user_login_name_validate($form, $state, (array)$account); user_login_name_validate($form, $state, (array)$account);
if (form_get_errors()) { if (form_get_errors()) {
// Invalid login.
return FALSE; return FALSE;
} }
// Valid login.
global $user; global $user;
$user = $account; $user = $account;
user_login_submit($form, $state, (array)$account); user_authenticate_finalize($state['values']);
return TRUE; return TRUE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment