This commit is contained in:
Ulrich Block 2017-11-04 13:02:44 +01:00
parent 9d262f6c2d
commit 5736b40469
2 changed files with 9 additions and 10 deletions

View File

@ -79,7 +79,7 @@ if ($ui->st('w', 'get') == 'lo') {
if (isset($ui->server['HTTP_REFERER'])) {
$refstring = explode('/', substr(str_replace(array('http://' . $ui->domain('HTTP_HOST', 'server'), 'https://' . $ui->domain('HTTP_HOST', 'server'), '//'), array('', '', '/'), strtolower($ui->server['HTTP_REFERER'])), strlen($ewInstallPath)));
$referrer = (isset($refstring[1])) ? explode('?',$refstring[1]) : '';
$referrer = (isset($refstring[1])) ? explode('?', $refstring[1]) : '';
} else {
$referrer[0] = 'login.php';
}
@ -101,9 +101,12 @@ if ($ui->st('w', 'get') == 'lo') {
redirect('admin.php');
} else {
$target = (isset($pageurl)) ? $pageurl . '/' . $ewInstallPath : $ewInstallPath;
$target .= (empty($target)) ? 'login.php' : '/login.php';
session_unset();
session_destroy();
redirect((isset($pageurl)) ? $pageurl . '/' . $ewInstallPath : $ewInstallPath);
redirect($target);
}
} else if ($ui->st('w', 'get') == 'ba') {

View File

@ -165,21 +165,17 @@ if (!function_exists('passwordgenerate')) {
function redirect($value, $sendHTTP301 = false) {
$value = removeDoubleSlashes($value);
$target = removeDoubleSlashes($value);
if ($value == 'login.php') {
if (substr($target, -9) == 'login.php') {
if (session_status() === PHP_SESSION_ACTIVE) {
session_unset();
session_destroy();
}
}
if ($sendHTTP301 == true) {
header('HTTP/1.1 301 Moved Permanently');
}
header ('Location: ' . $value);
die('Please allow redirection settings');
header ('Location: ' . $target, true, ($sendHTTP301 == true) ? 301 : 302);
die('Please allow redirection or manually navigate to ' . $value);
}
function listDirs ($dir) {