[pLog-svn] r6915 - in plog/branches/lifetype-1.2/class: action/admin data data/validator gallery/dao summary/action test/tests/data/validator

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed Sep 9 14:27:07 EDT 2009


Author: jondaley
Date: 2009-09-09 14:27:07 -0400 (Wed, 09 Sep 2009)
New Revision: 6915

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminloginaction.class.php
   plog/branches/lifetype-1.2/class/data/inputfilter.class.php
   plog/branches/lifetype-1.2/class/data/validator/usernamevalidator.class.php
   plog/branches/lifetype-1.2/class/gallery/dao/
   plog/branches/lifetype-1.2/class/summary/action/summarysendresetemail.class.php
   plog/branches/lifetype-1.2/class/test/tests/data/validator/usernamevalidator_test.class.php
Log:
reverted last change until I figure out why he is even running into this error

Modified: plog/branches/lifetype-1.2/class/action/admin/adminloginaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminloginaction.class.php	2009-09-09 18:26:24 UTC (rev 6914)
+++ plog/branches/lifetype-1.2/class/action/admin/adminloginaction.class.php	2009-09-09 18:27:07 UTC (rev 6915)
@@ -40,7 +40,7 @@
             $this->_locale =& Locales::getLocale( $this->_config->getValue( "default_locale" ));
 
 			// data validation
-			$this->registerFieldValidator( "userName", new UsernameValidator(false));
+			$this->registerFieldValidator( "userName", new UsernameValidator());
 			$this->registerFieldValidator( "userPassword", new StringValidator());
 			$view = new AdminDefaultView();
 			$view->setErrorMessage( $this->_locale->tr("error_incorrect_username_or_password"));


Property changes on: plog/branches/lifetype-1.2/class/data/inputfilter.class.php
___________________________________________________________________
Deleted: svn:mergeinfo
   - 

Modified: plog/branches/lifetype-1.2/class/data/validator/usernamevalidator.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/validator/usernamevalidator.class.php	2009-09-09 18:26:24 UTC (rev 6914)
+++ plog/branches/lifetype-1.2/class/data/validator/usernamevalidator.class.php	2009-09-09 18:27:07 UTC (rev 6915)
@@ -25,19 +25,17 @@
      */
     class UsernameValidator extends Validator 
     {
-    	function UsernameValidator($checkForbidden=true)
+    	function UsernameValidator()
         {
         	$this->Validator();
         	
         	$this->addRule( new NonEmptyRule());
 			$this->addRule( new RegExpRule( ONLY_ALPHANUMERIC_REGEXP ));			
 			$this->addRule( new StringRangeRule( 1, 15 ));  // to make sure they're not longer than 15 characters
-            if($checkForbidden){
-                $config =& Config::getConfig();
-                $forbiddenUsernames = $config->getValue( "forbidden_usernames", "" );
-                $forbiddenUsernamesArray = explode( " ", $forbiddenUsernames );
-                $this->addRule( new FilteredPatternsRule( $forbiddenUsernamesArray, false ));
-            }
+			$config =& Config::getConfig();
+			$forbiddenUsernames = $config->getValue( "forbidden_usernames", "" );
+			$forbiddenUsernamesArray = explode( " ", $forbiddenUsernames );
+			$this->addRule( new FilteredPatternsRule( $forbiddenUsernamesArray, false ));
         }
     }
 ?>
\ No newline at end of file


Property changes on: plog/branches/lifetype-1.2/class/gallery/dao
___________________________________________________________________
Modified: svn:mergeinfo
   - /plog/trunk/class/gallery/dao:6457

   + /plog/trunk/class/gallery/dao:6457

Modified: plog/branches/lifetype-1.2/class/summary/action/summarysendresetemail.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/summary/action/summarysendresetemail.class.php	2009-09-09 18:26:24 UTC (rev 6914)
+++ plog/branches/lifetype-1.2/class/summary/action/summarysendresetemail.class.php	2009-09-09 18:27:07 UTC (rev 6915)
@@ -31,7 +31,7 @@
 			$this->_request->registerFilter( "userEmail", $f );
             
             // data validation
-            $this->registerFieldValidator( "userName", new UsernameValidator(false));
+            $this->registerFieldValidator( "userName", new UsernameValidator());
             $this->registerFieldValidator( "userEmail", new EmailValidator());
             $this->setValidationErrorView( new SummaryView( "resetpassword" ));
         }

Modified: plog/branches/lifetype-1.2/class/test/tests/data/validator/usernamevalidator_test.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/test/tests/data/validator/usernamevalidator_test.class.php	2009-09-09 18:26:24 UTC (rev 6914)
+++ plog/branches/lifetype-1.2/class/test/tests/data/validator/usernamevalidator_test.class.php	2009-09-09 18:27:07 UTC (rev 6915)
@@ -47,24 +47,7 @@
 			
 			$this->assertFalse( $this->u->validate( $tmp ), "A forbidden username should not be accepted as valid!" );
 		}
-
-        /**
-		 * tests that a forbidden username does not validate
-		 */
-		function testUnforbiddenUsername()
-		{
-			// get the list of forbidden words, based on our configuration settings
-			lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
-			$config =& Config::getConfig();
-
-			$forbiddenUsernames = $config->getValue( "forbidden_usernames" );
-			$forbiddenUsernamesArray = explode( " ", $forbiddenUsernames );
-			$tmp = array_pop( $forbiddenUsernamesArray );
-			
-			$uf = new UsernameValidator(false);
-			$this->assertTrue( $uf->validate( $tmp ), "A forbidden username should not be blocked when ignoring forbidden names!" );
-		}
-
+		
 		/**
 		 * test a username with upper-case characters
 		 */



More information about the pLog-svn mailing list