summaryrefslogtreecommitdiff
path: root/modules/openid
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-06-23 08:58:31 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-06-23 08:58:31 +0000
commit1d6be6f0b737c3def0541b460dbcf674caa269ee (patch)
tree21d1887ecf7bfbf4fd564cfe96ad0b40927249de /modules/openid
parent48a04f264867b2e01c66dd9c97b834eb94d9d9fc (diff)
downloadbrdo-1d6be6f0b737c3def0541b460dbcf674caa269ee.tar.gz
brdo-1d6be6f0b737c3def0541b460dbcf674caa269ee.tar.bz2
#153372 by bjaspan: fix user login form values and openid interacion
Diffstat (limited to 'modules/openid')
-rw-r--r--modules/openid/openid.inc2
-rw-r--r--modules/openid/openid.module9
2 files changed, 7 insertions, 4 deletions
diff --git a/modules/openid/openid.inc b/modules/openid/openid.inc
index e54758a3c..7f525cf21 100644
--- a/modules/openid/openid.inc
+++ b/modules/openid/openid.inc
@@ -368,7 +368,7 @@ function _openid_get_bytes($num_bytes) {
if (!isset($f)) {
$f = @fopen(OPENID_RAND_SOURCE, "r");
}
- if (!isset($f)) {
+ if (!$f) {
// pseudorandom used
$bytes = '';
for ($i = 0; $i < $num_bytes; $i += 4) {
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index 5be1fb137..8361ce62d 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -108,7 +108,7 @@ function openid_login_validate($form, &$form_state) {
$return_to = url('', array('absolute' => TRUE));
}
- openid_begin($form_state['values']['openid_url'], $return_to);
+ openid_begin($form_state['values']['openid_url'], $return_to, $form_state['values']);
}
/**
@@ -191,7 +191,7 @@ function openid_user_delete($account, $aid = 0) {
* @param $claimed_id The OpenID to authenticate
* @param $return_to The endpoint to return to from the OpenID Provider
*/
-function openid_begin($claimed_id, $return_to = '') {
+function openid_begin($claimed_id, $return_to = '', $form_values = array()) {
include_once drupal_get_path('module', 'openid') .'/openid.inc';
$claimed_id = _openid_normalize($claimed_id);
@@ -207,6 +207,9 @@ function openid_begin($claimed_id, $return_to = '') {
$_SESSION['openid_op_endpoint'] = $op_endpoint;
// Store the claimed_id in the session (for handling delegation).
$_SESSION['openid_claimed_id'] = $claimed_id;
+ // Store the login form values so we can pass them to
+ // user_exteral_login later.
+ $_SESSION['openid_user_login_values'] = $form_values;
// If bcmath is present, then create an association
$assoc_handle = '';
@@ -398,7 +401,7 @@ function openid_authentication($response) {
$account = user_external_load($identity);
if (isset($account->uid)) {
if (!variable_get('user_email_verification', TRUE) || $account->login) {
- user_external_login($account);
+ user_external_login($account, $_SESSION['openid_user_login_values']);
}
else {
drupal_set_message(t('You must validate your email address for this account before logging in via OpenID'));