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
This commit is contained in:
Matt Pass
2013-08-30 09:01:10 +01:00
parent 046bec29b2
commit 1b7d647d60

View File

@@ -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