Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When external authentication occurs and the user is logged in through user_external_login_register, the user_authenticate_finalize function is not called, but should be (according to it's documentation). This results in hook_user not being called with op=='login'.
The check for blocked users doesn't occur either.
The provided patch calls user_external_login instead of setting the $user global, and thus solves the issues.
Comment | File | Size | Author |
---|---|---|---|
#8 | 542120-external-login-D6.patch | 1022 bytes | Stevel |
user.module-D6.diff | 704 bytes | Stevel | |
Comments
Comment #1
Stevel CreditAttribution: Stevel commentedComment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedThat does make sense. Let's get this fix into D7 (if it is still required, Moshe refactored this part some weeks ago), and think about the backport later on.
Comment #3
anders.fajerson CreditAttribution: anders.fajerson commentedThe patch should fix another gotcha with the use of this function as well:
Say a user has registered as a normal Drupal user with the username "foobar".
Then an user uses an autenticated module to login, and provides the username (authname) "foobar". In that case the user would be logged in as the normal Drupal user.
Critical? At least a Drupal DX issue.
Update: This has indeed been re-factored. Not sure if it applies any more.
Comment #4
Dave Cohen CreditAttribution: Dave Cohen commentedAnyone interested in user_external_login_register in 7.x might also be interested to know that it is completely broken.
http://drupal.org/node/765222
Comment #5
Stevel CreditAttribution: Stevel commentedThe behaviour is fixed in D7, so lets think about a backport to D6
Comment #6
Stevel CreditAttribution: Stevel commentedGuess this has to go to CNR again
Comment #7
Damien Tournoud CreditAttribution: Damien Tournoud commentedI'm ok with this patch. Could someone attach a proper patch?
Comment #8
Stevel CreditAttribution: Stevel commentedRerolled the patch from CVS checkout of drupal 6.17
Comment #9
Stevel CreditAttribution: Stevel commentedComment #10
thedavidmeister CreditAttribution: thedavidmeister commentedpatch no longer applies.
error: user/user.module: No such file or directory
Not sure if we're still looking to get this committed.