mirror of
https://github.com/misterunknown/ifm.git
synced 2025-08-10 18:14:00 +02:00
set cookie for root_path instead of /
This commit is contained in:
19
src/main.php
19
src/main.php
@@ -185,7 +185,9 @@ f00bar;
|
|||||||
case "getI18N":
|
case "getI18N":
|
||||||
return $this->getI18N($_REQUEST);
|
return $this->getI18N($_REQUEST);
|
||||||
case "logout":
|
case "logout":
|
||||||
session_start();
|
$session_name = basename($this->config['root_dir']);
|
||||||
|
session_set_cookie_params(0, "/{$session_name}/");
|
||||||
|
session_start(['cookie_path' => "/{$session_name}/",'name' => $session_name,]);
|
||||||
unset($_SESSION);
|
unset($_SESSION);
|
||||||
session_destroy();
|
session_destroy();
|
||||||
header("Location: " . strtok($_SERVER["REQUEST_URI"], '?'));
|
header("Location: " . strtok($_SERVER["REQUEST_URI"], '?'));
|
||||||
@@ -571,7 +573,13 @@ f00bar;
|
|||||||
if (isset($d['filename']) && $this->isFilenameValid($d['filename'])) {
|
if (isset($d['filename']) && $this->isFilenameValid($d['filename'])) {
|
||||||
if (isset($d['content'])) {
|
if (isset($d['content'])) {
|
||||||
// work around magic quotes
|
// work around magic quotes
|
||||||
$content = get_magic_quotes_gpc() == 1 ? stripslashes($d['content']) : $d['content'];
|
if((function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc())
|
||||||
|
|| (ini_get('magic_quotes_sybase') && (strtolower(ini_get('magic_quotes_sybase'))!="off")) ) {
|
||||||
|
$content = stripslashes($d['content']);
|
||||||
|
} else {
|
||||||
|
$content = $d['content'];
|
||||||
|
}
|
||||||
|
|
||||||
if (@file_put_contents($d['filename'], $content) !== false)
|
if (@file_put_contents($d['filename'], $content) !== false)
|
||||||
return ["status" => "OK", "message" => $this->l('file_save_success')];
|
return ["status" => "OK", "message" => $this->l('file_save_success')];
|
||||||
else
|
else
|
||||||
@@ -985,8 +993,11 @@ f00bar;
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session_status() !== PHP_SESSION_ACTIVE)
|
if (session_status() !== PHP_SESSION_ACTIVE) {
|
||||||
session_start();
|
$session_name = basename($this->config['root_dir']);
|
||||||
|
session_set_cookie_params(0, "/{$session_name}/");
|
||||||
|
session_start(['cookie_path' => "/{$session_name}/",'name' => $session_name,]);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($_SESSION['ifmauth']) && $_SESSION['ifmauth'] == true)
|
if (isset($_SESSION['ifmauth']) && $_SESSION['ifmauth'] == true)
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user