diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-06-23 08:58:31 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-06-23 08:58:31 +0000 |
commit | 1d6be6f0b737c3def0541b460dbcf674caa269ee (patch) | |
tree | 21d1887ecf7bfbf4fd564cfe96ad0b40927249de /modules/user/user.module | |
parent | 48a04f264867b2e01c66dd9c97b834eb94d9d9fc (diff) | |
download | brdo-1d6be6f0b737c3def0541b460dbcf674caa269ee.tar.gz brdo-1d6be6f0b737c3def0541b460dbcf674caa269ee.tar.bz2 |
#153372 by bjaspan: fix user login form values and openid interacion
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 43a1fa07c..836263103 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -80,22 +80,28 @@ function user_external_load($authname) { } /** -* Perform standard Drupal login operations for a user object. The -* user object must already be authenticated. This function verifies -* that the user account is not blocked/denied and then performs the login, -* updates the login timestamp in the database, invokes hook_user('login'), -* regenerates the session, etc. -* -* @param $account -* An authenticated user object to be set as the currently logged -* in user. -* @return boolean -* TRUE if the login succeeds, FALSE otherwise. -*/ -function user_external_login($account) { + * Perform standard Drupal login operations for a user object. The + * user object must already be authenticated. This function verifies + * that the user account is not blocked/denied and then performs the login, + * updates the login timestamp in the database, invokes hook_user('login'), + * regenerates the session, etc. + * + * @param $account + * An authenticated user object to be set as the currently logged + * in user. + * @param $edit + * The array of form values submitted by the user, if any. + * @return boolean + * TRUE if the login succeeds, FALSE otherwise. + */ +function user_external_login($account, $edit = array()) { $form = drupal_get_form('user_login'); - $state = array(); + $state['values'] = $edit; + if (empty($state['values']['name'])) { + $state['values']['name'] = $account->name; + } + user_login_name_validate($form, $state, (array)$account); if (form_get_errors()) { return FALSE; @@ -1075,7 +1081,7 @@ function user_login_default_validators() { * * @return void **/ - function user_login_name_validate($form, &$form_state) { +function user_login_name_validate($form, &$form_state) { if (isset($form_state['values']['name'])) { if (user_is_blocked($form_state['values']['name'])) { // blocked in user administration |