includes/namespaces/default.php
changeset 979 aafb9f6806c9
parent 970 d894086f38cc
child 980 d13fad911955
equal deleted inserted replaced
978:ed84b24b8e07 979:aafb9f6806c9
   780     global $db, $session, $paths, $template, $plugins; // Common objects
   780     global $db, $session, $paths, $template, $plugins; // Common objects
   781     
   781     
   782     if ( !$this->perms )
   782     if ( !$this->perms )
   783       $this->perms = $session->fetch_page_acl($this->page_id, $this->namespace);
   783       $this->perms = $session->fetch_page_acl($this->page_id, $this->namespace);
   784     
   784     
       
   785     if ( !$this->perms )
       
   786     {
       
   787       // We're trying to send a page WAY too early (session hasn't been started yet), such as for a redirect. Send a default set of conds because
       
   788       // there's NO way to get permissions to determine anything otherwise. Yes, starting $session here might be dangerous.
       
   789       $this->conds = array(
       
   790           'article' => true,
       
   791           'comments' => false,
       
   792           'edit' => false,
       
   793           'viewsource' => false,
       
   794           'history' => false,
       
   795           'rename' => false,
       
   796           'delvote' => false,
       
   797           'resetvotes' => false,
       
   798           'delete' => false,
       
   799           'printable' => false,
       
   800           'protect' => false,
       
   801           'setwikimode' => false,
       
   802           'clearlogs' => false,
       
   803           'password' => false,
       
   804           'acledit' => false,
       
   805           'adminpage' => false
       
   806         );
       
   807       return $this->conds;
       
   808     }
       
   809     
       
   810     // die('have perms: <pre>' . print_r($this->perms, true) . "\n---------------------------------\nBacktrace:\n" . enano_debug_print_backtrace(true));
       
   811     
   785     $enforce_protection = ( $this->page_protected && ( ( $session->check_acl_scope('even_when_protected', $this->namespace) && !$this->perms->get_permissions('even_when_protected') ) || !$session->check_acl_scope('even_when_protected', $this->namespace) ) );
   812     $enforce_protection = ( $this->page_protected && ( ( $session->check_acl_scope('even_when_protected', $this->namespace) && !$this->perms->get_permissions('even_when_protected') ) || !$session->check_acl_scope('even_when_protected', $this->namespace) ) );
   786     
   813     
   787     $conds = array();
   814     $conds = array();
   788     
   815     
   789     // Article: always show
   816     // Article: always show