Making a page accessible only to users with a certain level

0

Good morning, I have a login system with php and mysql, in the database I have 2 users, one has Admin level (0) and the other Master (1), I have the login page that asks Username and The person's password and checks if the inserted data hits the DB, after logging in correctly, the page redirects the user to a page of the system admins, on this page there is a side menu where it has several buttons, each one redirecting to a page such as the Post and Changes page. Here is my problem: the users page, this page should only be accessed by users whose level is Master (or 1), but I do not know how I would do this, I tried using sessions and query, but always ends up giving in error or letting go any user rather than bar those who are Admin (or 0).

    
asked by anonymous 04.10.2018 / 01:08

1 answer

1

Dude I really believe in reuse of code and projects, for that reason I believe you could go to link site and create a project with one template instead of going from 0, in this template you find all your needs and can configure new ones according to what you need, in it you have Tenents (which would be environments) and inside the environments you can configure users with levels a good base of levels ai you adapt to your needs)

Viewing page for the "running" project link

GitHub page: link

Template creation page: link

    
04.10.2018 / 01:58