Example #1
0
 public static function accessRole(array $level, $noAdmin = false)
 {
     if (!Session::get('authenticated')) {
         header('location:' . BASE_URL . 'login/');
         exit;
     }
     Session::time();
     /*
     if($noAdmin == false){
     	if(Session::get('level') == 'Admin'){
     		return; 
     	}
     }
     */
     if (!empty($level)) {
         if (in_array(Session::get('level'), $level)) {
             return;
         }
     }
     header('location:' . BASE_URL . 'error/access/5050');
 }