privilege_check.php 270 B

1234567891011121314
  1. <?php
  2. //Checks if the user_type in the session is the same as the parameter.
  3. function checkPrivilege($required){
  4. if(session_id() == '')
  5. {
  6. session_start();
  7. }
  8. if($_SESSION['user_type'] != $required){
  9. header("location: ../login.php");
  10. die();
  11. }
  12. }
  13. ?>