[pLog-CVS] plog_devel wizard.php,1.30,1.31
Brought to you by:
jondaley
From: <phu...@us...> - 2003-10-15 17:34:22
|
Update of /cvsroot/plog/plog_devel In directory sc8-pr-cvs1:/tmp/cvs-serv5359 Modified Files: wizard.php Log Message: the wizard checks that the ./tmp folder is writable by the web server user instead of spitting out errors from smarty if it is not so, prompting the user to fix it and gracefully exiting. Index: wizard.php =================================================================== RCS file: /cvsroot/plog/plog_devel/wizard.php,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** wizard.php 14 Oct 2003 19:26:22 -0000 1.30 --- wizard.php 15 Oct 2003 17:34:17 -0000 1.31 *************** *** 18,21 **** --- 18,24 ---- include_once( "userpermissions.class.php" ); include_once( "version.class.php" ); + include_once( "file.class.php" ); + + define( "TEMP_FOLDER", "./tmp" ); // sql querys used to create the tables *************** *** 272,277 **** $t->assign( $this->_params->getAsArray()); $t->template_dir = "./templates"; ! $t->compile_dir = "./tmp"; ! $t->cache_dir = "./tmp"; $t->use_sub_dirs = false; $t->caching = false; --- 275,280 ---- $t->assign( $this->_params->getAsArray()); $t->template_dir = "./templates"; ! $t->compile_dir = TEMP_FOLDER; ! $t->cache_dir = TEMP_FOLDER; $t->use_sub_dirs = false; $t->caching = false; *************** *** 781,784 **** --- 784,795 ---- } + } + + // check if the "./tmp" folder is writable by us, otherwise + // throw an error before the user gets countless errors + // from Smarty + if( !File::isWritable( TEMP_FOLDER ) || !File::isDir( TEMP_FOLDER )) { + print("<span style=\"color:red\">Error</span><br/><br/>This wizard needs the ".TEMP_FOLDER." folder to be writable by the web server user.<br/><br/>Please correct that and try again."); + die(); } |