Coding Global Background
Coding Global

PHP Permissions for Admin-Account doesn´t work after implementing Auto-Increment

Archived 3 years ago
1 messages
1 members
3 years ago
Open in Discord
.
Mektarius

I have a task that involves creating a simple website structure with a basic inventory list and user management. There should be an admin who is able to add items to the inventory list and create, update, and delete employees in the user management. The following problem exists: In the login.php file, I created a method called getRights(). This method assigns roles to the logged-in user that are stored in the "rechte" table. These roles are saved in session variables. However, the session variable responsible for storing the roles does not save the roles. As a result, even the admin account does not have access to the user management. The queries themselves are functioning properly, as I have tested them myself. It was even working with the role distribution until I added an auto_increment to the database. Since adding the auto_increment, it has unfortunately stopped working and I can't find the error. Neither the admins nor the normal user can access it. Have a nice evening.

Replies (1)