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.

Comments

mian3010 created an issue. See original summary.

mian3010’s picture

StatusFileSize
new880 bytes

Attached proposed solution.

masipila’s picture

Thanks for raising this!

Could you please share full steps to reproduce?

Cheers,
Markus

napche’s picture

StatusFileSize
new1017 bytes

I 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.

masipila’s picture

Hi,

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

masipila’s picture

Status: Active » Postponed (maintainer needs more info)

mian3010 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

  • masipila committed 4f82a1e on 8.x-3.x authored by Napche
    Issue #2820684 by Napche: Login not allowed if user has any role
    
masipila’s picture

Status: Postponed (maintainer needs more info) » Fixed

I had now time to have a closer look at this. Napche, I committed your patch. Thank you both!

Cheers,
Markus

masipila’s picture

Status: Fixed » Closed (fixed)