[pLog-svn] r6523 - plog/branches/lifetype-1.2/class/action/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Mon Jun 9 03:32:35 EDT 2008


Author: mark
Date: 2008-06-09 03:32:35 -0400 (Mon, 09 Jun 2008)
New Revision: 6523

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminupdatebloguseraction.class.php
Log:
Use ArrayValidator with IntegerValidator to validate them.

Modified: plog/branches/lifetype-1.2/class/action/admin/adminupdatebloguseraction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminupdatebloguseraction.class.php	2008-06-09 07:06:39 UTC (rev 6522)
+++ plog/branches/lifetype-1.2/class/action/admin/adminupdatebloguseraction.class.php	2008-06-09 07:32:35 UTC (rev 6523)
@@ -2,7 +2,8 @@
 
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );	
 	lt_include( PLOG_CLASS_PATH."class/view/admin/adminbloguserslistview.class.php" );	
-	lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );	
+	lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/permissions.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );	
 
@@ -22,6 +23,8 @@
 			
 			// register one validator
 			$this->registerFieldValidator( "userId", new IntegerValidator());
+			$this->registerFieldValidator( "perm", new ArrayValidator( new IntegerValidator() ), true );
+
 			// and the view we should show in case there is a validation error
 			$errorView = new AdminBlogUsersListView( $this->_blogInfo );
 			$errorView->setErrorMessage( $this->_locale->tr("error_invalid_user_id" ));			
@@ -36,7 +39,6 @@
         function perform()
         {
 			// fetch the data, we already know it's valid and that we can trust it!
-            // TODO: I question the above comment - how do we know "perm" is valid?
 			$userId = $this->_request->getValue( "userId" );
 			$this->_perms = $this->_request->getValue( "perm" );			
 			



More information about the pLog-svn mailing list