From 51f119e56988d86fa02179b8033ddbf235b5ea17 Mon Sep 17 00:00:00 2001 From: Knah Tsaeb Date: Tue, 21 Jul 2015 13:49:41 +0200 Subject: [PATCH] [fix] install doesn't work --- index.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/index.php b/index.php index 5c13183..6ca029a 100644 --- a/index.php +++ b/index.php @@ -45,10 +45,9 @@ $GLOBALS['config']['DATE_FORMAT'] = '%A %d %B %Y %T'; // see http://php.net/manu // ----------------------------------------------------------------------------------------------- // You should not touch below (or at your own risks !) // Optionnal config file. -// Run config screen if first run: -if (!is_file($GLOBALS['config']['CONFIG_FILE'])) install(); - -require $GLOBALS['config']['CONFIG_FILE']; // Read login/password hash into $GLOBALS. +if(file_exists($GLOBALS['config']['CONFIG_FILE'])){ + require $GLOBALS['config']['CONFIG_FILE']; // Read login/password hash into $GLOBALS. +} if (is_file($GLOBALS['config']['DATADIR'].'/options.php')){ require($GLOBALS['config']['DATADIR'].'/options.php'); @@ -129,6 +128,9 @@ if (empty($GLOBALS['disablejquery'])) $GLOBALS['disablejquery']=false; if (empty($GLOBALS['privateLinkByDefault'])) $GLOBALS['privateLinkByDefault']=false; if (empty($GLOBALS['titleLink'])) $GLOBALS['titleLink']='?'; +// Run config screen if first run: +if (!is_file($GLOBALS['config']['CONFIG_FILE'])) install(); + // a token depending of deployment salt, user password, and the current ip define('STAY_SIGNED_IN_TOKEN', sha1($GLOBALS['hash'].$_SERVER["REMOTE_ADDR"].$GLOBALS['salt'])); @@ -2438,11 +2440,11 @@ function writeConfig() if (is_file($GLOBALS['config']['CONFIG_FILE']) && !isLoggedIn()) die('You are not authorized to alter config.'); // Only logged in user can alter config. $config = "