[pLog-svn] r5461 - plog/branches/lifetype-1.2

oscar at devel.lifetype.net oscar at devel.lifetype.net
Wed May 30 15:29:26 EDT 2007


Author: oscar
Date: 2007-05-30 15:29:26 -0400 (Wed, 30 May 2007)
New Revision: 5461

Modified:
   plog/branches/lifetype-1.2/wizard.php
Log:
Added the code necessary to make sure that all files have been correctly uploaded to wizard.php. It makes the "checks" step of the installation and upgrade process to take a bit longer, but hopefully it'll help to cut down on the number of support issues related to people uploading files in weird ways...


Modified: plog/branches/lifetype-1.2/wizard.php
===================================================================
--- plog/branches/lifetype-1.2/wizard.php	2007-05-29 20:23:55 UTC (rev 5460)
+++ plog/branches/lifetype-1.2/wizard.php	2007-05-30 19:29:26 UTC (rev 5461)
@@ -70,6 +70,7 @@
 	lt_include( PLOG_CLASS_PATH."class/dao/permission.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/userpermission.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/misc/integritychecker.class.php" );
     
     // table schemas
     include( PLOG_CLASS_PATH."install/dbschemas.properties.php" );
@@ -444,7 +445,37 @@
             return( parent::validate());    
         }
     }
+
+    class WizardFileIntegrityValidator extends WizardValidator
+    {
+        function WizardFileIntegrityValidator()
+        {
+            $this->WizardValidator( "Checking that all files have been correctly uploaded", 
+                                    "will be set later on...",
+                                    true );
+        }    
     
+        function validate()
+        {
+			include( PLOG_CLASS_PATH."install/files.properties.php");
+			
+			$result = IntegrityChecker::checkIntegrity( 
+				$data
+			);	
+	
+		
+            $this->_valid = ( count( $result ) == 0 );
+			if( !$this->_valid ) {
+				/* let's modify a private attribute... */
+				$fileList = implode( "<br/>", array_keys( $result ));
+				$this->_solution = "The following files are not correct, installation cannot continue until they are replaced
+				                    with the correct versions:"."<br/>".$fileList;				
+			}
+
+            return( parent::validate());
+        }
+    }
+    
     class WizardCtypeFunctionsAvailableValidator extends WizardValidator
     {
         function WizardCtypeFunctionsAvailableValidator()
@@ -466,10 +497,11 @@
         function perform()
         {
             // build the array with checks
-            $checkGroups['File permissions checking'] = Array(
+            $checkGroups['File checks'] = Array(
                "writeConfigFile" => new WizardWritableFileValidator( "config/config.properties.php" ),
                "writeTmpFolder" => new WizardWritableFileValidator( "tmp" ),
-               "writeGalleryFolder" => new WizardWritableFileValidator( "gallery" )
+               "writeGalleryFolder" => new WizardWritableFileValidator( "gallery" ),
+			   "fileVersionCheck" => new WizardFileIntegrityValidator()
             );
             
             $checkGroups['PHP version checking'] = Array(



More information about the pLog-svn mailing list