[pLog-svn] r5014 - in plog/branches/lifetype-1.2/class: action/admin data/captcha

reto at devel.lifetype.net reto at devel.lifetype.net
Tue Mar 6 16:56:29 EST 2007


Author: reto
Date: 2007-03-06 16:56:29 -0500 (Tue, 06 Mar 2007)
New Revision: 5014

Modified:
   plog/branches/lifetype-1.2/class/action/admin/admincleanupaction.class.php
   plog/branches/lifetype-1.2/class/data/captcha/captcha.class.php
Log:
summary captcha is now respecting the global tmp setting and the cleanup page doesn't have a waring icon when called for the first time (e.g. without having clicked on any "purge" button yet).

BTW: I don't remember our coding guidelines word by word, but please use curly braces with if else statements. tnx :)




Modified: plog/branches/lifetype-1.2/class/action/admin/admincleanupaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/admincleanupaction.class.php	2007-03-06 21:51:40 UTC (rev 5013)
+++ plog/branches/lifetype-1.2/class/action/admin/admincleanupaction.class.php	2007-03-06 21:56:29 UTC (rev 5014)
@@ -38,7 +38,7 @@
             else
                 $this->_op = "";
             
-			$this->_message = "";
+			$this->_message = '';
 			$this->_continue = false;
 			
 			$this->requireAdminPermission( "purge_data" );
@@ -202,10 +202,14 @@
 
 			// create the view and see if there was a success message
 			$this->_view = new AdminTemplatedView( $this->_blogInfo, "cleanup" );
-			if( $result ) 
+			if( $result ) {
 				$this->_view->setSuccessMessage( $this->_message );
-            else
+        	}	
+            elseif ($this->_message != '') {
 				$this->_view->setErrorMessage( $this->_message );
+		    }
+		    
+		    
 			$this->_view->setValue( "continue", $this->_continue );
 			$this->_view->setValue( "dest", $this->_url );
 

Modified: plog/branches/lifetype-1.2/class/data/captcha/captcha.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/data/captcha/captcha.class.php	2007-03-06 21:51:40 UTC (rev 5013)
+++ plog/branches/lifetype-1.2/class/data/captcha/captcha.class.php	2007-03-06 21:56:29 UTC (rev 5014)
@@ -55,8 +55,12 @@
 		 */
 		function Captcha()
 		{
+			lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
+			
+			$config =& Config::getConfig();
+			$this->cacheFolder = $config->getValue( "temp_folder", CAPTCHA_CACHE_FOLDER );
+			
 			$this->key = CAPTCHA_DEFAULT_KEY;
-			$this->cacheFolder = CAPTCHA_CACHE_FOLDER;
 			$this->expiredTime = CAPTCHA_DEFAULT_EXPIRATION_TIME;
 			$this->length = CAPTCHA_DEFAULT_CODE_LENGTH;
 		}
@@ -153,4 +157,4 @@
 			}
 		}
 	}
-?>
\ No newline at end of file
+?>



More information about the pLog-svn mailing list