Revert "Merge branch 'fixed-errors-in-login' into 'develop'"

This reverts merge request !559
This commit is contained in:
vgilc 2017-06-07 09:31:46 +02:00
parent a19b321f9a
commit c674892709
3 changed files with 84 additions and 70 deletions

View File

@ -125,24 +125,28 @@ require_once ($ownDir . 'functions.php');
// We need a timezone BEFORE calling config_process_config.
// If not we will get ugly warnings. Set Europe/Madrid by default
// Later will be replaced by the good one.
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, 'enterprise') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, '?login') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
if (!defined('METACONSOLE')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
else{
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'enterprise') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
$config["homeurl"] = rtrim(join("/", $url),"/");
if (!isset($config["homeurl_static"])) {
$config["homeurl_static"] = $config["homeurl"];
@ -168,6 +172,7 @@ require_once ($ownDir. 'functions_config.php');
date_default_timezone_set("Europe/Madrid");
config_process_config();
config_prepare_session();

View File

@ -64,6 +64,8 @@ function db_connect($host = null, $db = null, $user = null, $pass = null, $port
// Something went wrong
if ($return === false) {
if ($critical) {
$login_screen = 'error_authconfig';
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
@ -71,17 +73,9 @@ function db_connect($host = null, $db = null, $user = null, $pass = null, $port
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, 'enterprise') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, '?login') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
$login_screen = 'error_authconfig';
require($config['homedir'] . '/general/error_screen.php');
exit;
}

View File

@ -30,23 +30,28 @@ if ($develop_bypass != 1) {
$login_screen = 'error_noconfig';
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, 'enterprise') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, '?login') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
if (!defined('METACONSOLE')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
else{
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'enterprise') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
$config["homeurl"] = rtrim(join("/", $url),"/");
$config["homeurl_static"] = $config["homeurl"];
require('general/error_screen.php');
exit;
@ -73,23 +78,28 @@ if ($develop_bypass != 1) {
if (file_exists ("install.php")) {
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, 'enterprise') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, '?login') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
if (!defined('METACONSOLE')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
else{
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'enterprise') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
$config["homeurl"] = rtrim(join("/", $url),"/");
$config["homeurl_static"] = $config["homeurl"];
$login_screen = 'error_install';
require('general/error_screen.php');
@ -102,23 +112,28 @@ if ($develop_bypass != 1) {
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0640")) {
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, 'enterprise') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, '?login') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
if (!defined('METACONSOLE')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
else{
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'enterprise') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
$config["homeurl"] = rtrim(join("/", $url),"/");
$config["homeurl_static"] = $config["homeurl"];
$login_screen = 'error_perms';
require('general/error_screen.php');