mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-10 18:46:48 +01:00
Auto-setting loggedIn not based on demoMode or empty pw, only go to login if req
This commit is contained in:
@@ -127,8 +127,8 @@ include dirname(__FILE__) . "/../lang/" . basename($ICEcoder['languageUser']);
|
||||
$text = array_replace_recursive($baseText, $text);
|
||||
$_SESSION['text'] = $text;
|
||||
|
||||
// Login not required or we're in demo mode and have password set in our settings, log us straight in
|
||||
if ((false === $ICEcoder['loginRequired'] || true === $ICEcoder['demoMode']) && "" !== $ICEcoder['password']) {
|
||||
// Login not required, log us straight in
|
||||
if (false === $ICEcoder['loginRequired']) {
|
||||
$_SESSION['loggedIn'] = true;
|
||||
};
|
||||
$demoMode = $ICEcoder['demoMode'];
|
||||
@@ -194,8 +194,8 @@ include(dirname(__FILE__) . "/settings-save-current-files.php");
|
||||
// Display the plugins
|
||||
include(dirname(__FILE__) . "/plugins-display.php");
|
||||
|
||||
// If loggedIn is false or we don't have a password set yet and we're not on login screen, boot user to that
|
||||
if (false === isset($_POST['password']) && (!$_SESSION['loggedIn'] || "" === $ICEcoder["password"]) && false === strpos($_SERVER['SCRIPT_NAME'], "lib/login.php")) {
|
||||
// If we require a login, loggedIn is false or we don't have a password set yet and we're not on login screen, boot user to that
|
||||
if (true === $ICEcoder['loginRequired'] && false === isset($_POST['password']) && (!$_SESSION['loggedIn'] || "" === $ICEcoder["password"]) && false === strpos($_SERVER['SCRIPT_NAME'], "lib/login.php")) {
|
||||
if (file_exists('lib/login.php')) {
|
||||
header('Location: ' . rtrim($_SERVER['REQUEST_URI'], "/") . '/lib/login.php');
|
||||
echo "<script>window.location = 'lib/login.php';</script>";
|
||||
|
||||
Reference in New Issue
Block a user