[pLog-svn] r6638 - plog/branches/lifetype-1.2/class/summary/action

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sat Jun 21 16:44:27 EDT 2008


Author: jondaley
Date: 2008-06-21 16:44:27 -0400 (Sat, 21 Jun 2008)
New Revision: 6638

Modified:
   plog/branches/lifetype-1.2/class/summary/action/dousercreation.class.php
Log:
validation stuff.

Modified: plog/branches/lifetype-1.2/class/summary/action/dousercreation.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/summary/action/dousercreation.class.php	2008-06-21 20:03:26 UTC (rev 6637)
+++ plog/branches/lifetype-1.2/class/summary/action/dousercreation.class.php	2008-06-21 20:44:27 UTC (rev 6638)
@@ -17,7 +17,8 @@
      */
     class doUserCreation extends RegisterAction 
 	{
-	
+        var _config;
+        
 		function doUserCreation( $actionInfo, $request )
 		{
 			$this->RegisterAction( $actionInfo, $request );
@@ -30,17 +31,16 @@
 			$this->_request->registerFilter( "userEmail", $f );
 			$this->_request->registerFilter( "userPassword", $f );
 			$this->_request->registerFilter( "userPasswordCheck", $f );
-			
+            
 			// data validation and stuff like that :)
 			$this->registerFieldValidator( "userName", new UsernameValidator());
 			$this->registerFieldValidator( "userPassword", new PasswordValidator());
 			$this->registerFieldValidator( "userPasswordCheck", new PasswordValidator());
 			$this->registerFieldValidator( "userEmail", new EmailValidator());
+            $this->registerFieldValidator( "userAuth", new StringValidator(), true);
+			$this->registerFieldValidator( "userFullName", new StringValidator(), true );
             $this->_config =& Config::getConfig();
-            if( $this->_config->getValue( "use_captcha_auth" )) {
-				$this->registerFieldValidator( "userAuth", new StringValidator());
-			}
-			$this->registerField( "userFullName" );
+
 			$view = new SummaryUserCreationView();
 			$view->setErrorMessage( $this->_locale->tr("error_adding_user" ));
 			$this->setValidationErrorView( $view );
@@ -54,7 +54,6 @@
             $this->confirmPassword = $this->_request->getValue( "userPasswordCheck" );
             $this->userEmail = $this->_request->getValue( "userEmail" );
 			$this->userFullName = $this->_request->getValue( "userFullName" );
-			$this->captcha = $this->_request->getValue( "userAuth" );
 			
 			// check if there is already a user with the same username and quit if so
 			$users = new Users();
@@ -89,6 +88,7 @@
             
             // check if the captcha matches
             if( $this->_config->getValue( "use_captcha_auth")) {
+                $this->captcha = $this->_request->getValue( "userAuth" );
             	lt_include( PLOG_CLASS_PATH."class/data/captcha/captcha.class.php" );
             	$captcha = new Captcha();
             	if( !$captcha->validate( $this->captcha )) {



More information about the pLog-svn mailing list