Check if lib/settings.php exists first

Because we may include this file from a couple of dirs and I'd rather it
continued to be run from lib/settings.php. By doing it this way round,
we're ensuring this, as lib/lib/settings.php won't exist.
This commit is contained in:
Matt Pass
2013-09-03 08:10:21 +01:00
parent 93c76533d6
commit 568cb08e4a

View File

@@ -321,11 +321,11 @@ if ($_SESSION['loggedIn']) {
}
if ((!$_SESSION['loggedIn'] || $ICEcoder["password"] == "") && !strpos($_SERVER['SCRIPT_NAME'],"lib/settings.php")) {
if (file_exists('settings.php')) {
header('Location: settings.php');
if (file_exists('lib/settings.php')) {
header('Location: lib/settings.php');
die();
} else {
header('Location: lib/settings.php');
header('Location: settings.php');
die();
}
// If we're due to show the settings screen