From 1b7d647d60fbcc5dd45378fd4edba5f9dbc33141 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Fri, 30 Aug 2013 09:01:10 +0100 Subject: [PATCH] Allow settings to be called from root or a dir By doing this we don't end up with a lib/lib path issue Used longhand if else statement instead of ternary for clarity Also added die to stop it going any further and having a new header location replace this one --- lib/settings.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/settings.php b/lib/settings.php index bebe185..a72357b 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -321,7 +321,13 @@ if ($_SESSION['loggedIn']) { } if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER['SCRIPT_NAME'],"lib/settings.php")) { - header('Location: lib/settings.php'); + if (file_exists('settings.php')) { + header('Location: settings.php'); + die(); + } else { + header('Location: lib/settings.php'); + die(); + } // If we're due to show the settings screen } elseif (!$_SESSION['loggedIn']) { // If the password hasn't been set and we're setting it