Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
1d6be6f0
Commit
1d6be6f0
authored
Jun 23, 2007
by
Gábor Hojtsy
Browse files
Options
Downloads
Patches
Plain Diff
#153372
by bjaspan: fix user login form values and openid interacion
parent
48a04f26
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/openid/openid.inc
+1
-1
1 addition, 1 deletion
modules/openid/openid.inc
modules/openid/openid.module
+6
-3
6 additions, 3 deletions
modules/openid/openid.module
modules/user/user.module
+21
-15
21 additions, 15 deletions
modules/user/user.module
with
28 additions
and
19 deletions
modules/openid/openid.inc
+
1
−
1
View file @
1d6be6f0
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
modules/openid/openid.module
+
6
−
3
View file @
1d6be6f0
...
...
@@ -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'
));
...
...
This diff is collapsed.
Click to expand it.
modules/user/user.module
+
21
−
15
View file @
1d6be6f0
...
...
@@ -89,13 +89,19 @@ function user_external_load($authname) {
* @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
)
{
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment