# HG changeset patch # User Dan # Date 1242408672 14400 # Node ID aafb9f6806c9db07dc9dd425d9ccde8a393f8c37 # Parent ed84b24b8e070cbd19712c603d53920f2587b97a Fixed redirects before $session init not working; fixed failure to load system plugins diff -r ed84b24b8e07 -r aafb9f6806c9 includes/namespaces/default.php --- a/includes/namespaces/default.php Thu May 14 11:34:24 2009 -0400 +++ b/includes/namespaces/default.php Fri May 15 13:31:12 2009 -0400 @@ -782,6 +782,33 @@ if ( !$this->perms ) $this->perms = $session->fetch_page_acl($this->page_id, $this->namespace); + if ( !$this->perms ) + { + // 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 + // there's NO way to get permissions to determine anything otherwise. Yes, starting $session here might be dangerous. + $this->conds = array( + 'article' => true, + 'comments' => false, + 'edit' => false, + 'viewsource' => false, + 'history' => false, + 'rename' => false, + 'delvote' => false, + 'resetvotes' => false, + 'delete' => false, + 'printable' => false, + 'protect' => false, + 'setwikimode' => false, + 'clearlogs' => false, + 'password' => false, + 'acledit' => false, + 'adminpage' => false + ); + return $this->conds; + } + + // die('have perms:
' . print_r($this->perms, true) . "\n---------------------------------\nBacktrace:\n" . enano_debug_print_backtrace(true)); + $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) ) ); $conds = array(); diff -r ed84b24b8e07 -r aafb9f6806c9 includes/paths.php --- a/includes/paths.php Thu May 14 11:34:24 2009 -0400 +++ b/includes/paths.php Fri May 15 13:31:12 2009 -0400 @@ -210,7 +210,9 @@ { $title = basename($_SERVER['SCRIPT_NAME']); } - $base_uri = str_replace( scriptPath . '/', '', $_SERVER['SCRIPT_NAME'] ); + if ( scriptPath != '' ) + $base_uri = str_replace( scriptPath . '/', '', $_SERVER['SCRIPT_NAME'] ); + $this->page = $this->nslist['API'] . sanitize_page_id($base_uri); $this->fullpage = $this->nslist['API'] . sanitize_page_id($base_uri); $this->namespace = 'API'; diff -r ed84b24b8e07 -r aafb9f6806c9 includes/plugins.php --- a/includes/plugins.php Thu May 14 11:34:24 2009 -0400 +++ b/includes/plugins.php Fri May 15 13:31:12 2009 -0400 @@ -80,7 +80,7 @@ foreach ( $plugin_list as $filename => $data ) { - if ( $data['status'] & PLUGIN_OUTOFDATE || $data['status'] & PLUGIN_DISABLED ) + if ( $data['status'] & PLUGIN_OUTOFDATE || $data['status'] & PLUGIN_DISABLED || ( !$data['installed'] && !$data['system plugin'] ) ) continue; $this->load_list[] = $filename;