Revert "Merge branch '961_Error_al_cambiar_ruta_de_pandora_v7_rev' into 'develop'"

This reverts merge request !558
This commit is contained in:
vgilc 2017-06-07 09:32:35 +02:00
parent c674892709
commit 149a77a559
3 changed files with 23 additions and 113 deletions

View File

@ -37,21 +37,9 @@ else {
//home dir bad defined
if (!is_dir($config['homedir'])) {
$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),"/");
$config["homeurl_static"] = $config["homeurl"];
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
$config["error"] = "homedir_bad_defined";
return;
}
@ -126,28 +114,23 @@ require_once ($ownDir . 'functions.php');
// 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) {
$flag_url=1;
unset($url[$key]);
if(!isset($config["homeurl"])){
$url = explode('/', $_SERVER['REQUEST_URI']);
$config["homeurl"] = $url[1];
$config["homeurl_static"] = $url[1];
$config["error"] = "homeurl_bad_defined";
return;
}
else{
$url = explode('/', $_SERVER['REQUEST_URI']);
if($config["homeurl"] != '/'.$url[1]){
$config["homeurl"] = '/'.$url[1];
$config["homeurl_static"] = '/'.$url[1];
$config["error"] = "homeurl_bad_defined";
return;
}
}
$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"];
}

View File

@ -64,17 +64,7 @@ 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) {
if (strpos($value, 'index.php?') !== false || $flag_url) {
$flag_url=1;
unset($url[$key]);
}
}
$config["homeurl"] = rtrim(join("/", $url),"/");
require($config['homedir'] . '/general/error_screen.php');
exit;

View File

@ -28,31 +28,13 @@ if ($develop_bypass != 1) {
if (! file_exists ("include/config.php")) {
if (! file_exists ("install.php")) {
$login_screen = 'error_noconfig';
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$config['homedir'] = $ownDir;
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_static"] = $config["homeurl"];
$config['homeurl'] = $_SERVER['REQUEST_URI'];
$config['homeurl_static'] = $_SERVER['REQUEST_URI'];
require('general/error_screen.php');
exit;
}
@ -76,31 +58,6 @@ if ($develop_bypass != 1) {
// Check for installer presence
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) {
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_static"] = $config["homeurl"];
$login_screen = 'error_install';
require('general/error_screen.php');
exit;
@ -111,30 +68,10 @@ if ($develop_bypass != 1) {
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0660") &&
(substr (sprintf ('%o', fileperms('include/config.php')), -4) != "0640")) {
$ownDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
$url = explode('/', $_SERVER['REQUEST_URI']);
$config['homedir'] = $ownDir;
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_static"] = $config["homeurl"];
$config['homeurl'] = "/" . $url[1];
$config['homeurl_static'] = "/" . $url[1];
$login_screen = 'error_perms';
require('general/error_screen.php');
exit;