If user has any role it seems that they are not allowed to login through Facebook.
The code that checks if login for a specific role is blocked makes an incorrect comparison. The value when a role is not blocked from logging in is "0" (string), and not 0, as the code assumes.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | login_not_allowed_if_2820684-3.patch | 1017 bytes | napche |
| #2 | login_not_allowed_if-2820684-2.patch | 880 bytes | mian3010 |
Comments
Comment #2
mian3010 commentedAttached proposed solution.
Comment #3
masipila commentedThanks for raising this!
Could you please share full steps to reproduce?
Cheers,
Markus
Comment #4
napche commentedI experienced the same problem. 0 values are stored as strings in the serialized array. I wrote an alternative patch to fix.
Here's the relevant part of my config :
s:14:"disabled_roles";a:6:{s:8:"licensed";s:1:"0";s:10:"instructor";s:1:"0";s:8:"official";s:1:"0";s:7:"trainer";s:1:"0";s:7:"manager";s:1:"0";s:13:"administrator";s:1:"0";}As for steps to reproduce, I just enabled the module using drush, then went to the config and added roles to the list of disabled roles and clicked save.
Comment #5
masipila commentedHi,
Thanks for the update!
What I was referring with the steps to reproduce: did I understand correctly:
- Drupal user is previously created
- This user has been assigned any role in Drupal
- This user then tries to log in with SimpleFbConnect
- Fb login fails
- If all roles are removed from the user, then fb login works
Could one of you confirm that I got this correctly?
Cheers,
Markus
Comment #6
masipila commentedmian3010 or Napche, could you please provide full steps to reproduce this issue? I was looking into this but I'm not able to trigger this bug.
Test 1 that I tried to reproduce this:
1) Created a new Drupal user via Simple Fb Connect
2) Added a new role to this user
3) Tried to log in again via Simple Fb Connect
Result: Login works as expected.
Test 2 that I tried to reproduce this:
1) Created new Drupal user via Drupal (i.e. not via Simple FB Connect)
- I entered an email address that can be found from my Facebook profile, see step 3.
2) Added a new role to this user
3) Logged in via Simple Fb Connect
- The email address on Facebook matches to the email address in step 1.
Result: User created in step 1 was logged in as expected.
I would really like to fix this issue but as I'm not able to reproduce this by myself, I need more information from you guys. I would really appreciate if you could provide more information!
Cheers,
Markus
Comment #8
masipila commentedI had now time to have a closer look at this. Napche, I committed your patch. Thank you both!
Cheers,
Markus
Comment #9
masipila commented