[pLog-svn] r6264 - in plog/trunk/class: action action/admin dao data/validator summary/action

mark at devel.lifetype.net mark at devel.lifetype.net
Sun Mar 23 10:55:01 EDT 2008


Author: mark
Date: 2008-03-23 10:55:01 -0400 (Sun, 23 Mar 2008)
New Revision: 6264

Modified:
   plog/trunk/class/action/admin/adminaddblogaction.class.php
   plog/trunk/class/action/admin/adminloginaction.class.php
   plog/trunk/class/action/admin/adminupdateeditblogaction.class.php
   plog/trunk/class/action/admin/adminupdateuserprofileaction.class.php
   plog/trunk/class/action/defaultaction.class.php
   plog/trunk/class/action/viewarticleaction.class.php
   plog/trunk/class/action/viewarticletrackbacksaction.class.php
   plog/trunk/class/dao/model.class.php
   plog/trunk/class/data/validator/usernamevalidator.class.php
   plog/trunk/class/summary/action/activeaccountaction.class.php
   plog/trunk/class/summary/action/summarysendresetemail.class.php
Log:
Merge from LifeType 1.2 branch 6258:6263

Modified: plog/trunk/class/action/admin/adminaddblogaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddblogaction.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/action/admin/adminaddblogaction.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -40,7 +40,7 @@
 				$this->registerFieldValidator( "blogMainDomain", new DomainValidator(), false, $this->_locale->tr("error_invalid_domain"));
 			}
 
-        	$this->registerField( "userName" );	
+        	$this->registerFieldValidator( "userName", new UsernameValidator());
 			$view = new AdminCreateBlogView( $this->_blogInfo );
 			$view->setErrorMessage( $this->_locale->tr( "error_adding_blog" ));
         	$this->setValidationErrorView( $view );
@@ -160,4 +160,4 @@
             return true;			
 		}
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/action/admin/adminloginaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminloginaction.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/action/admin/adminloginaction.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -32,7 +32,7 @@
             $this->_locale =& Locales::getLocale( $this->_config->getValue( "default_locale" ));
 
 			// data validation
-			$this->registerFieldValidator( "userName", new StringValidator());
+			$this->registerFieldValidator( "userName", new UsernameValidator());
 			$this->registerFieldValidator( "userPassword", new StringValidator());
 			$view = new AdminDefaultView();
 			$view->setErrorMessage( $this->_locale->tr("error_incorrect_username_or_password"));
@@ -160,4 +160,4 @@
             return true;			
 		}
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/action/admin/adminupdateeditblogaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateeditblogaction.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/action/admin/adminupdateeditblogaction.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -48,7 +48,7 @@
 			$this->registerFieldValidator( "blogStatus", new IntegerValidator(), false, $this->_locale->tr("error_incorrect_value"));
 			$this->registerFieldValidator( "blogResourcesQuota", new IntegerValidator(), true, $this->_locale->tr("error_incorrect_value"));
         	$this->registerFieldValidator( "userId", new IntegerValidator(), false, $this->_locale->tr("error_incorrect_user"));
-			$this->registerFieldValidator( "userName", new StringValidator());
+			$this->registerFieldValidator( "userName", new UsernameValidator());
 			$this->registerField( "blogTimeOffset" );
 			if( Subdomains::getSubdomainsEnabled()) {
 				$this->registerFieldValidator( "blogSubDomain", new DomainValidator(), false, $this->_locale->tr("error_invalid_subdomain"));
@@ -197,4 +197,4 @@
             return true;			
 		}
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/action/admin/adminupdateuserprofileaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminupdateuserprofileaction.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/action/admin/adminupdateuserprofileaction.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -38,7 +38,7 @@
 			$this->registerField( "userAbout" );
 			$this->registerField( "properties" );
 			$this->registerField( "userIsSiteAdmin" );
-			$this->registerField( "userName" );
+			$this->registerFieldValidator( "userName", new UsernameValidator());
 			$this->registerField( "userPermissions" );
         	$this->registerFieldValidator( "userProfilePassword", new PasswordValidator(), true, $this->_locale->tr("error_invalid_password"));			
 			$this->registerFieldValidator( "userStatus", new IntegerValidator(), false, $this->_locale->tr("error_incorrect_value" ));			
@@ -139,4 +139,4 @@
 			return( true );			
 		}
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/action/defaultaction.class.php
===================================================================
--- plog/trunk/class/action/defaultaction.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/action/defaultaction.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -26,7 +26,7 @@
 			$this->registerFieldValidator( "postCategoryId", new IntegerValidator(), true );
 			$this->registerFieldValidator( "postCategoryName", new StringValidator(), true );
 			$this->registerFieldValidator( "userId", new IntegerValidator(), true );
-			$this->registerFieldValidator( "userName", new StringValidator(), true );
+			$this->registerFieldValidator( "userName", new UsernameValidator(), true );
 			
 			$this->setValidationErrorView( new ErrorView( $this->_blogInfo, "error_fetching_articles" ));
         }
@@ -255,4 +255,4 @@
             return true;
         }
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/action/viewarticleaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticleaction.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/action/viewarticleaction.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -31,7 +31,7 @@
 			$this->registerFieldValidator( "postCategoryId", new IntegerValidator(), true );
 			$this->registerFieldValidator( "postCategoryName", new StringValidator(), true );
 			$this->registerFieldValidator( "userId", new IntegerValidator(), true );
-			$this->registerFieldValidator( "userName", new StringValidator(), true );
+			$this->registerFieldValidator( "userName", new UsernameValidator(), true );
 
 			$this->setValidationErrorView( new ErrorView( $this->_blogInfo, "error_fetching_article" ));
         }

Modified: plog/trunk/class/action/viewarticletrackbacksaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticletrackbacksaction.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/action/viewarticletrackbacksaction.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -30,7 +30,7 @@
 			$this->registerFieldValidator( "postCategoryId", new IntegerValidator(), true );
 			$this->registerFieldValidator( "postCategoryName", new StringValidator(), true );
 			$this->registerFieldValidator( "userId", new IntegerValidator(), true );
-			$this->registerFieldValidator( "userName", new StringValidator(), true );
+			$this->registerFieldValidator( "userName", new UsernameValidator(), true );
 
 			$this->setValidationErrorView( new ErrorView( $this->_blogInfo, "error_fetching_article" ));			
         }
@@ -156,4 +156,4 @@
             return true;
         }
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/dao/model.class.php
===================================================================
--- plog/trunk/class/dao/model.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/dao/model.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -138,7 +138,7 @@
                 $error = $this->DbError();
                 $log->error( "The following query = \n" .
                               $query .
-                             "generated the following error message = \n" .
+                             "\ngenerated the following error message = \n" .
                               $error );
             }
 

Modified: plog/trunk/class/data/validator/usernamevalidator.class.php
===================================================================
--- plog/trunk/class/data/validator/usernamevalidator.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/data/validator/usernamevalidator.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -31,7 +31,7 @@
         	
         	$this->addRule( new NonEmptyRule());
 			$this->addRule( new RegExpRule( ONLY_ALPHANUMERIC_REGEXP ));			
-			$this->addRule( new StringRangeRule( 0, 15 ));  // to make sure they're not longer than 15 characters
+			$this->addRule( new StringRangeRule( 1, 15 ));  // to make sure they're not longer than 15 characters
 			$config =& Config::getConfig();
 			$forbiddenUsernames = $config->getValue( "forbidden_usernames", "" );
 			$forbiddenUsernamesArray = explode( " ", $forbiddenUsernames );

Modified: plog/trunk/class/summary/action/activeaccountaction.class.php
===================================================================
--- plog/trunk/class/summary/action/activeaccountaction.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/summary/action/activeaccountaction.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -13,7 +13,7 @@
 	    {
 	        $this->SummaryAction($actionInfo,$httpRequest);
 
-	        $this->registerFieldValidator("username",new StringValidator());
+        $this->registerFieldValidator("username",new UsernameValidator());
 	        $this->registerFieldValidator("activeCode",new StringValidator());
 	    }
 

Modified: plog/trunk/class/summary/action/summarysendresetemail.class.php
===================================================================
--- plog/trunk/class/summary/action/summarysendresetemail.class.php	2008-03-23 14:43:35 UTC (rev 6263)
+++ plog/trunk/class/summary/action/summarysendresetemail.class.php	2008-03-23 14:55:01 UTC (rev 6264)
@@ -31,7 +31,7 @@
 			$this->_request->registerFilter( "userEmail", $f );
             
             // data validation
-            $this->registerFieldValidator( "userName", new StringValidator());
+            $this->registerFieldValidator( "userName", new UsernameValidator());
             $this->registerFieldValidator( "userEmail", new EmailValidator());
             $this->setValidationErrorView( new SummaryView( "resetpassword" ));
         }
@@ -79,4 +79,4 @@
 			return true;
 		}
 	}
-?>
\ No newline at end of file
+?>



More information about the pLog-svn mailing list