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

fixed errors instalation

See merge request !559
This commit is contained in:
vgilc 2017-06-06 16:01:01 +02:00
commit fe56ad8735
3 changed files with 66 additions and 80 deletions

View File

@ -125,28 +125,24 @@ 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.
if (!defined('METACONSOLE')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
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]);
}
}
$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),"/");
}
if (!isset($config["homeurl_static"])) {
$config["homeurl_static"] = $config["homeurl"];
@ -172,7 +168,6 @@ require_once ($ownDir. 'functions_config.php');
date_default_timezone_set("Europe/Madrid");
config_process_config();
config_prepare_session();

View File

@ -64,8 +64,6 @@ 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) {
@ -73,9 +71,17 @@ 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,7 +30,6 @@ if ($develop_bypass != 1) {
$login_screen = 'error_noconfig';
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
if (!defined('METACONSOLE')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
@ -38,20 +37,16 @@ if ($develop_bypass != 1) {
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, 'enterprise') !== 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) {
else if(strpos($value, '?login') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
$config["homeurl_static"] = $config["homeurl"];
require('general/error_screen.php');
exit;
@ -78,7 +73,6 @@ if ($develop_bypass != 1) {
if (file_exists ("install.php")) {
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
if (!defined('METACONSOLE')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
@ -86,20 +80,16 @@ if ($develop_bypass != 1) {
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, 'enterprise') !== 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) {
else if(strpos($value, '?login') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
$config["homeurl_static"] = $config["homeurl"];
$login_screen = 'error_install';
require('general/error_screen.php');
@ -112,7 +102,6 @@ if ($develop_bypass != 1) {
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0640")) {
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
if (!defined('METACONSOLE')) {
$url = explode('/', $_SERVER['REQUEST_URI']);
$flag_url =0;
foreach ($url as $key => $value) {
@ -120,20 +109,16 @@ if ($develop_bypass != 1) {
$flag_url=1;
unset($url[$key]);
}
else if(strpos($value, 'enterprise') !== 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) {
else if(strpos($value, '?login') !== false || $flag_url){
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
}
$config["homeurl_static"] = $config["homeurl"];
$login_screen = 'error_perms';
require('general/error_screen.php');