Access denied to a user after successful login

Hello,I am getting following error when a user logs in: "You do not have permission to access index.php. Back to login page"I am using Dynamic user permission. I have already create one user. This user is assigned the Default (0) User Level. I am able to login using that user credentials and things are working perfectly.

Then I create another user with same settings are previous user but this new user when logs in gets the error message mentioned above.What to do how to solve this?TIAYogi Yang

Make sure you have already defined the Permissions for that Default (0) user level from the generated userpriv.php page, and then try again.

Hello,I have already done that. The permissions for both users are the same.In one user things are coming as expected in another user they are not working as expected.

YogiYang wrote:
In one user things are coming as expected in another user they are not working as expected.Please explain it in more detail. Some real example are very useful to identify the issue so that the solution will straightforward to the point.

Hello,Let me try and explain in a more details.I created a user whose User Level is assigned as Default (0).I logged in using the credentials of this user and I am able to access all the data as well as add new data.Then I created another user and assigned User Level to Default (0).I logged in using the credentials of second user. In this case I am able to log in but then I and given the error that I have posted in my First message (“You do not have permission to access index.php. Back to login page”).I hope this explains the situation.TIAYogi Yang

That’s weird. The second user should be able to do the same things the first user already did, since both use the same user level.

  1. Did you write your code in any Server Events that perhaps causes this issue?
  2. Have you tried to compare both users directly from your “users” table? Perhaps the certain value in some fields will cause the second user are not able to access the index.php page.

Make sure:

  • You create user when you login as Administrator.
  • You log out before login in.
  • The user level for the second user stored in the user .table is really 0, not NULL.

Hello,While trying to find a solution to the problem.What I did was switch to older version of PHPMaker and luckily I have a copy of the project created in older version.I opened it and pressed F9 to generate the code. And Viola!!! everything is working as expected.So I can say that the problem shows up on the newer versions only.TIAYogi Yang

I cannot reproduce. I tested with the demo project, I added a new user with Default user level and I can login and be redirected to the first table fine.

You may login your site as administrator and check the follows:

  • go to the user table, find the new user, check the user level, make sure it is an integer >= 0. If Default user level, it should be 0, not NULL.
  • go to the user level table, double check the permissions of the Default user level, make sure it has permission to access one of the List pages of the tables.