Welcome Guest, Not a member yet? Register   Sign In
Community auth forced login
#4

Here are some more details I gathered after testing.

I have 2 users :
  • "admin" who has the auth_level 20 which corresponds to the role "admins"
  • "user" who has the auth_level 10 which corresponds to the role "users"
When I'm logged as admin, I get the issue I described. Works once, but then I'm logged off when I refresh.

When I'm logged as user, if I call the force login method manually (because not shown in GUIĀ for users) and I log as admin, it works fine. I'm not logged of after refresh, and I stay logged as admin.

Before I render my views I have this line :
PHP Code:
$this->isAdmin $this->verify_role('admin'); 

If I comment this line, everything works fine.
So this method "verify_role", disconnects the user if he is not admin, apparently.

Is this the normal behaviour ?
If yes, how do I verify if the current user is in a role, without disconnecting him in case he's not.

That "isAdmin" variable is accessed from the Views so I can determine if some fields, buttons, etc.. need to be rendered.

Thanks in advance.
Reply


Messages In This Thread
Community auth forced login - by mxfragz - 05-28-2017, 09:16 PM
RE: Community auth forced login - by skunkbad - 05-29-2017, 08:36 AM
RE: Community auth forced login - by mxfragz - 05-30-2017, 06:19 PM
RE: Community auth forced login - by mxfragz - 05-30-2017, 07:18 PM
RE: Community auth forced login - by skunkbad - 05-30-2017, 10:15 PM
RE: Community auth forced login - by mxfragz - 05-31-2017, 12:11 AM
RE: Community auth forced login - by skunkbad - 05-31-2017, 12:16 PM
RE: Community auth forced login - by mxfragz - 05-31-2017, 06:40 PM
RE: Community auth forced login - by skunkbad - 05-31-2017, 07:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB