# HG changeset patch # User Dan # Date 1196725537 18000 # Node ID 6c7060d36a23644231b17be93865a2290dd51964 # Parent a007145a0ff6745f81259a9feddb0022fa2aa655 Improved physical pages: they support comments and have their own dedicated namespace now. Still some consistency fixes to make. diff -r a007145a0ff6 -r 6c7060d36a23 cache/index.php --- a/cache/index.php Mon Dec 03 17:36:25 2007 -0500 +++ b/cache/index.php Mon Dec 03 18:45:37 2007 -0500 @@ -1,13 +1,10 @@ perms['edit_page'] = AUTH_DENY; -$session->perms['view_source'] = AUTH_DENY; -$template->tpl_strings['PAGE_NAME'] = 'Access denied'; $template->header(); -echo '
The administrator has flagged the page "' . $_SERVER['REQUEST_URI'] . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; +echo 'The administrator has flagged the page "' . htmlspecialchars($_SERVER['REQUEST_URI']) . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; $template->footer(); -$db->close(); + diff -r a007145a0ff6 -r 6c7060d36a23 files/index.php --- a/files/index.php Mon Dec 03 17:36:25 2007 -0500 +++ b/files/index.php Mon Dec 03 18:45:37 2007 -0500 @@ -1,13 +1,10 @@ perms['edit_page'] = AUTH_DENY; -$session->perms['view_source'] = AUTH_DENY; -$template->tpl_strings['PAGE_NAME'] = 'Access denied'; $template->header(); -echo 'The administrator has flagged the page "' . $_SERVER['REQUEST_URI'] . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; +echo 'The administrator has flagged the page "' . htmlspecialchars($_SERVER['REQUEST_URI']) . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; $template->footer(); -$db->close(); + diff -r a007145a0ff6 -r 6c7060d36a23 images/index.php --- a/images/index.php Mon Dec 03 17:36:25 2007 -0500 +++ b/images/index.php Mon Dec 03 18:45:37 2007 -0500 @@ -1,13 +1,10 @@ perms['edit_page'] = AUTH_DENY; -$session->perms['view_source'] = AUTH_DENY; -$template->tpl_strings['PAGE_NAME'] = 'Access denied'; $template->header(); -echo 'The administrator has flagged the page "' . $_SERVER['REQUEST_URI'] . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; +echo 'The administrator has flagged the page "' . htmlspecialchars($_SERVER['REQUEST_URI']) . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; $template->footer(); -$db->close(); + diff -r a007145a0ff6 -r 6c7060d36a23 includes/index.php --- a/includes/index.php Mon Dec 03 17:36:25 2007 -0500 +++ b/includes/index.php Mon Dec 03 18:45:37 2007 -0500 @@ -1,13 +1,10 @@ perms['edit_page'] = AUTH_DENY; -$session->perms['view_source'] = AUTH_DENY; -$template->tpl_strings['PAGE_NAME'] = 'Access denied'; $template->header(); -echo 'The administrator has flagged the page "' . $_SERVER['REQUEST_URI'] . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; +echo 'The administrator has flagged the page "' . htmlspecialchars($_SERVER['REQUEST_URI']) . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; $template->footer(); -$db->close(); + diff -r a007145a0ff6 -r 6c7060d36a23 includes/pageprocess.php --- a/includes/pageprocess.php Mon Dec 03 17:36:25 2007 -0500 +++ b/includes/pageprocess.php Mon Dec 03 18:45:37 2007 -0500 @@ -232,7 +232,16 @@ echo $text; $this->footer(); - + } + else if ( $this->namespace == 'Anonymous' ) + { + $uri = scriptPath . '/' . $this->page_id; + if ( !$this->send_headers ) + { + $sep = ( strstr($uri, '?') ) ? '&' : '?'; + $uri .= "{$sep}noheaders"; + } + redirect( $uri, '', '', 0 ); } else if ( !$this->page_exists ) { diff -r a007145a0ff6 -r 6c7060d36a23 includes/paths.php --- a/includes/paths.php Mon Dec 03 17:36:25 2007 -0500 +++ b/includes/paths.php Mon Dec 03 18:45:37 2007 -0500 @@ -38,6 +38,7 @@ 'System' =>'Enano:', 'Template'=>'Template:', 'Category'=>'Category:', + 'Anonymous'=>'PhysicalRedirect:', 'Project' =>sanitize_page_id(getConfig('site_name')).':', ); @@ -148,7 +149,7 @@ } $db->free_result(); - if ( defined('ENANO_INTERFACE_INDEX') || defined('ENANO_INTERFACE_AJAX') ) + if ( defined('ENANO_INTERFACE_INDEX') || defined('ENANO_INTERFACE_AJAX') || defined('IN_ENANO_INSTALL') || defined('IN_ENANO_UPGRADE') ) { if( isset($_GET['title']) ) { @@ -258,28 +259,31 @@ { $title =& $GLOBALS['title']; } - else if ( isset($_SERVER['REQUEST_URI']) ) - { - $title = basename($_SERVER['REQUEST_URI']); - } else { - $title = 'Untitled page'; + $title = basename($_SERVER['SCRIPT_NAME']); } - $this->page = $this->nslist['Special'] . 'AnonymousPage'; - $this->fullpage = $this->nslist['Special'] . 'AnonymousPage'; + $base_uri = str_replace( scriptPath . '/', '', $_SERVER['SCRIPT_NAME'] ); + $this->page = $this->nslist['Anonymous'] . sanitize_page_id($base_uri); + $this->fullpage = $this->nslist['Anonymous'] . sanitize_page_id($base_uri); + $this->namespace = 'Anonymous'; $this->cpage = array( 'name' => $title, - 'urlname' => 'AnonymousPage', - 'namespace' => 'Special', - 'special' => 0, + 'urlname' => sanitize_page_id($base_uri), + 'namespace' => 'Anonymous', + 'special' => 1, 'visible' => 1, - 'comments_on' => 0, + 'comments_on' => 1, 'protected' => 1, 'delvotes' => 0, 'delvote_ips' => '' ); $this->anonymous_page = true; + $code = $plugins->setHook('paths_anonymous_page'); + foreach ( $code as $cmd ) + { + eval($cmd); + } } $this->page = sanitize_page_id($this->page); diff -r a007145a0ff6 -r 6c7060d36a23 includes/template.php --- a/includes/template.php Mon Dec 03 17:36:25 2007 -0500 +++ b/includes/template.php Mon Dec 03 18:45:37 2007 -0500 @@ -220,6 +220,9 @@ case "Category": $ns = 'category'; break; + case "Anonymous": + $ns = 'external page'; + break; } $this->namespace_string = $ns; $code = $plugins->setHook('page_type_string_set'); @@ -237,7 +240,7 @@ $btn_selected = ( isset($tplvars['toolbar_button_selected'])) ? $tplvars['toolbar_button_selected'] : $tplvars['toolbar_button']; $parser = $this->makeParserText($btn_selected); - if ( !$paths->anonymous_page ) + if ( true || !$paths->anonymous_page ) { $parser->assign_vars(array( 'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxReset()); return false; }" title="View the page contents, all of the page contents, and nothing but the page contents (alt-a)" accesskey="a"', diff -r a007145a0ff6 -r 6c7060d36a23 plugins/index.php --- a/plugins/index.php Mon Dec 03 17:36:25 2007 -0500 +++ b/plugins/index.php Mon Dec 03 18:45:37 2007 -0500 @@ -1,21 +1,10 @@ perms['edit_page'] = AUTH_DENY; -$session->perms['view_source'] = AUTH_DENY; -$template->tpl_strings['PAGE_NAME'] = 'Access denied'; $template->header(); -echo 'The administrator has flagged the page "' . $_SERVER['REQUEST_URI'] . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; +echo 'The administrator has flagged the page "' . htmlspecialchars($_SERVER['REQUEST_URI']) . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; $template->footer(); -$db->close(); + diff -r a007145a0ff6 -r 6c7060d36a23 themes/index.php --- a/themes/index.php Mon Dec 03 17:36:25 2007 -0500 +++ b/themes/index.php Mon Dec 03 18:45:37 2007 -0500 @@ -1,13 +1,10 @@ perms['edit_page'] = AUTH_DENY; -$session->perms['view_source'] = AUTH_DENY; -$template->tpl_strings['PAGE_NAME'] = 'Access denied'; $template->header(); -echo 'The administrator has flagged the page "' . $_SERVER['REQUEST_URI'] . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; +echo 'The administrator has flagged the page "' . htmlspecialchars($_SERVER['REQUEST_URI']) . '" so that it cannot be accessed from the web. Perhaps this is because this is a cache or includes directory and only needs to be accessed by scripts.
HTTP error: 403 Forbidden
'; $template->footer(); -$db->close(); +