[pLog-svn] r6619 - plog/branches/lifetype-1.2/class/action/admin
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Sat Jun 21 12:28:11 EDT 2008
Author: jondaley
Date: 2008-06-21 12:28:11 -0400 (Sat, 21 Jun 2008)
New Revision: 6619
Modified:
plog/branches/lifetype-1.2/class/action/admin/adminglobalsettingsaction.class.php
Log:
validate show variable in action, rather than depending on the view to do it
Modified: plog/branches/lifetype-1.2/class/action/admin/adminglobalsettingsaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminglobalsettingsaction.class.php 2008-06-21 16:18:21 UTC (rev 6618)
+++ plog/branches/lifetype-1.2/class/action/admin/adminglobalsettingsaction.class.php 2008-06-21 16:28:11 UTC (rev 6619)
@@ -2,6 +2,7 @@
lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
lt_include( PLOG_CLASS_PATH."class/view/admin/adminglobalsettingslistview.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
/**
* \ingroup Action
@@ -11,7 +12,8 @@
*/
class AdminGlobalSettingsAction extends AdminAction
{
-
+ var $_show;
+
function AdminGlobalSettingsAction( $actionInfo, $request )
{
$this->AdminAction( $actionInfo, $request );
@@ -19,12 +21,22 @@
$this->requireAdminPermission( "view_global_settings" );
}
+ function validate()
+ {
+ $this->_show = $this->_request->getValue( "show" );
+ $strVal = new StringValidator();
+ if(!$strVal->validate( $this->_show ) ){
+ // view can take care of setting a valid value
+ $this->_show = "";
+ }
+
+ return (parent::validate());
+ }
+
function perform()
{
// if no problem, continue
- // TODO: validate this
- $show = $this->_request->getValue( "show" );
- $this->_view = new AdminGlobalSettingsListView( $this->_blogInfo, $show );
+ $this->_view = new AdminGlobalSettingsListView( $this->_blogInfo, $this->_show );
$this->setCommonData();
return true;
More information about the pLog-svn
mailing list