includes/pageprocess.php
changeset 793 c0724bf6039b
parent 741 a216e412c439
child 800 9cdfe82c56cd
equal deleted inserted replaced
792:b55b87e5fafd 793:c0724bf6039b
   200       return call_user_func($proc, $this);
   200       return call_user_func($proc, $this);
   201     }
   201     }
   202     
   202     
   203     $pathskey = $paths->nslist[ $this->namespace ] . $this->page_id;
   203     $pathskey = $paths->nslist[ $this->namespace ] . $this->page_id;
   204     $strict_no_headers = false;
   204     $strict_no_headers = false;
       
   205     $admin_fail = false;
   205     if ( $this->namespace == 'Admin' && strstr($this->page_id, '/') )
   206     if ( $this->namespace == 'Admin' && strstr($this->page_id, '/') )
   206     {
   207     {
   207       if ( $this->send_headers )
   208       if ( $this->send_headers )
   208       {
   209       {
   209         $template->init_vars($this);
   210         $template->init_vars($this);
   236             $this->err_wrong_password();
   237             $this->err_wrong_password();
   237             return false;
   238             return false;
   238           }
   239           }
   239         }
   240         }
   240       }
   241       }
       
   242       if ( isset($paths->pages[$pathskey]['require_admin']) && $paths->pages[$pathskey]['require_admin'] )
       
   243       {
       
   244         if ( $session->auth_level < USER_LEVEL_ADMIN )
       
   245         {
       
   246           $admin_fail = true;
       
   247         }
       
   248       }
       
   249     }
       
   250     else if ( $this->namespace === $paths->namespace && $this->page_id == $paths->page_id )
       
   251     {
       
   252       if ( isset($paths->cpage['require_admin']) && $paths->cpage['require_admin'] )
       
   253       {
       
   254         if ( $session->auth_level < USER_LEVEL_ADMIN )
       
   255         {
       
   256           $admin_fail = true;
       
   257         }
       
   258       }
       
   259     }
       
   260     if ( $admin_fail )
       
   261     {
       
   262       header('Content-type: text/javascript');
       
   263       echo enano_json_encode(array(
       
   264           'mode' => 'error',
       
   265           'error' => 'need_auth_to_admin'
       
   266         ));
       
   267       return true;
   241     }
   268     }
   242     if ( $this->page_exists && $this->namespace != 'Special' && $this->namespace != 'Admin' && $do_stats )
   269     if ( $this->page_exists && $this->namespace != 'Special' && $this->namespace != 'Admin' && $do_stats )
   243     {
   270     {
   244       require_once(ENANO_ROOT.'/includes/stats.php');
   271       require_once(ENANO_ROOT.'/includes/stats.php');
   245       doStats($this->page_id, $this->namespace);
   272       doStats($this->page_id, $this->namespace);