From 6ee90d7e004338045b94c3b5ebcbaafd9b15351c Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Mon, 19 May 2008 14:25:32 +0200 Subject: [PATCH] Changed install.php handling, so it is not necessary to remove the script anymore. To avoid problems with automatic package updating, we changed the installer handling. From now, the install.php will be allowed to run only in two cases, first if the config.php file is missing, and second if the config.php file is empty. Also removed the install file remove warning. --- src/include/functions_common.php | 17 ++++++++++++++--- src/include/functions_frontendhelpers.php | 2 +- src/install.php | 2 ++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/include/functions_common.php b/src/include/functions_common.php index c56f98c..497f810 100644 --- a/src/include/functions_common.php +++ b/src/include/functions_common.php @@ -43,6 +43,7 @@ if ( !defined('IN_PHPLOGCON') ) include($gl_root_path . 'include/constants_general.php'); include($gl_root_path . 'include/constants_logstream.php'); +/* if ( is_file($gl_root_path . 'config.php') ) include($gl_root_path . 'config.php'); else @@ -51,6 +52,7 @@ else if ( !defined('IN_PHPLOGCON_INSTALL') ) CheckForInstallPhp(); } +*/ include($gl_root_path . 'classes/class_template.php'); include($gl_root_path . 'include/functions_themes.php'); @@ -104,7 +106,7 @@ function InitBasicPhpLogCon() StartPHPSession(); } -function InitPhpLogConConfigFile() +function InitPhpLogConConfigFile($bHandleMissing = true) { // Needed to make global global $CFG, $gl_root_path, $content; @@ -131,11 +133,20 @@ function InitPhpLogConConfigFile() $content['ShowPageRenderStats'] = "true"; InitPageRenderStats(); } + + // return result + return true; } else { - // Check for installscript! - CheckForInstallPhp(); + // if handled ourselfe, we die in CheckForInstallPhp. + if ( $bHandleMissing == true ) + { + // Check for installscript! + CheckForInstallPhp(); + } + else + return false; } } diff --git a/src/include/functions_frontendhelpers.php b/src/include/functions_frontendhelpers.php index f93c5ec..2ee8a2d 100644 --- a/src/include/functions_frontendhelpers.php +++ b/src/include/functions_frontendhelpers.php @@ -51,7 +51,7 @@ function InitFrontEndDefaults() // --- END Main Info Area // Check if install file still exists - InstallFileReminder(); + // NOT NEEDED ANYMORE InstallFileReminder(); } function InstallFileReminder() diff --git a/src/install.php b/src/install.php index 391d9aa..7efdb38 100644 --- a/src/install.php +++ b/src/install.php @@ -45,6 +45,8 @@ include($gl_root_path . 'include/functions_frontendhelpers.php'); IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/main.php' ); InitBasicPhpLogCon(); +if ( InitPhpLogConConfigFile(false) ) + DieWithErrorMsg( 'phpLogCon is already configured!

If you want to reconfigure phpLogCon, either delete the current config.php or replace it with an empty file.

Click here to return to pgpLogCon start page.'); //InitPhpLogCon(); // Set some static values