In general, there is a DB with users, it has an admin column, which in turn is associated with a table of these symbols, 1 - admin, 2 - moder, 3 - user, 4 - banned. Actually, what's the problem: There is a personal account page that displays functions depending on the status. Here is an authorization check:
<?php if(isset($_SESSION['logged_user'])){ ?> <p>Обычный юзер видит это</p> <?php if($_SESSION['logged_user'] -> admin === 1){ ?> <p>Админ видит это</p> <? } } ?> If we allow I change admin === 1 to 3 (user by default), then again I change to 1, then the user status changes from 3 to 1. That is, he is assigned admin rights. Please explain why this is happening? And is it safe to use it if you do not mess around with a change of 1 to 3, and so on.