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

mark at devel.lifetype.net mark at devel.lifetype.net
Fri Jun 20 14:52:18 EDT 2008


Author: mark
Date: 2008-06-20 14:52:18 -0400 (Fri, 20 Jun 2008)
New Revision: 6604

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminaddbloguseraction.class.php
Log:
Add validator to all input fields.

Modified: plog/branches/lifetype-1.2/class/action/admin/adminaddbloguseraction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminaddbloguseraction.class.php	2008-06-20 18:48:54 UTC (rev 6603)
+++ plog/branches/lifetype-1.2/class/action/admin/adminaddbloguseraction.class.php	2008-06-20 18:52:18 UTC (rev 6604)
@@ -3,7 +3,9 @@
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
     lt_include( PLOG_CLASS_PATH."class/view/admin/adminnewbloguserview.class.php" );
     lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/data/validator/usernamevalidator.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/data/validator/usernamevalidator.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/users.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/userpermissions.class.php" );
     lt_include( PLOG_CLASS_PATH."class/view/admin/adminbloguserslistview.class.php" );
@@ -29,18 +31,14 @@
 			
 			// data validation
 			$this->registerFieldValidator( "newBlogUserName", new UsernameValidator());
-			
+			$this->registerFieldValidator( "sendNotification", new IntegerValidator(), true);
+			$this->registerFieldValidator( "perm", new ArrayValidator( new IntegerValidator() ), true );
+			$this->registerFieldValidator( "newBlogUserText", new StringValidator(), true );
+						
 			$this->_sendNotification = ($this->_request->getValue( "sendNotification" ) != "" );
+			if( $this->_sendNotification )
+				$this->registerFieldValidator( "newBlogUserText", new StringValidator());	
 
-			if( $this->_sendNotification ) {
-				$this->registerFieldValidator( "newBlogUserText", new StringValidator());
-			}
-			else {
-				$this->registerField( "newBlogUserText" );		
-			}		
-						
-			$this->registerField( "sendNotification" );
-			$this->registerField( "perm" );
 			$view = new AdminNewBlogUserView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr("error_adding_user"));
 			$this->setValidationErrorView( $view );



More information about the pLog-svn mailing list