[pLog-svn] r5550 - plog/branches/lifetype-1.2/class/summary/action
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Sat Jun 16 01:12:40 EDT 2007
Author: oscar
Date: 2007-06-16 01:12:39 -0400 (Sat, 16 Jun 2007)
New Revision: 5550
Modified:
plog/branches/lifetype-1.2/class/summary/action/summarycustompageaction.class.php
Log:
Implemented feature request http://bugs.lifetype.net/view.php?id=1340 -- now we can add the "error" parameter to the URL (http:/.../summary.php?op=custom&page=whatever&error=1) and return an HTTP 404 error for custom summary pages if needed. If none is specified, the normal HTTP 200 code is returned.
Modified: plog/branches/lifetype-1.2/class/summary/action/summarycustompageaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/summary/action/summarycustompageaction.class.php 2007-06-15 20:49:21 UTC (rev 5549)
+++ plog/branches/lifetype-1.2/class/summary/action/summarycustompageaction.class.php 2007-06-16 05:12:39 UTC (rev 5550)
@@ -16,10 +16,12 @@
{
var $_page;
+ var $_error;
function perform()
{
$this->_page = $this->_request->getValue( "page" );
+ $this->_error = $this->_request->getValue( "error", false );
$val = new CustomSummaryPageValidator();
if( !$val->validate( $this->_page )) {
@@ -30,6 +32,11 @@
else {
// let's cache the page... After all, we're not expecting much dynamic context in here!
$this->_view = new SummaryCachedView( $this->_page, Array( "page" => $this->_page, "locale" => $this->_locale->getLocaleCode()));
+
+ // we can also have custom pages that return 404 errors, just specify the "error" parameter in the URL
+ if( $this->_error )
+ $this->_view->addHeaderResponse( "HTTP/1.1 404 Not Found" );
+
$this->setCommonData();
}
More information about the pLog-svn
mailing list