aboutsummaryrefslogtreecommitdiffhomepage
path: root/install
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2015-05-09 18:30:28 +0200
committerThomas Citharel <tcit@tcit.fr>2015-05-09 18:30:28 +0200
commit02d4ab1a60eb48f00ad60ec48d02b65509a27e56 (patch)
treeccd76e9b1d8a7e09b246f084f366e31e32239c8e /install
parentdc20ddf9b8836880d0abc0aa3d7fbd636c11ee81 (diff)
downloadwallabag-02d4ab1a60eb48f00ad60ec48d02b65509a27e56.tar.gz
wallabag-02d4ab1a60eb48f00ad60ec48d02b65509a27e56.tar.zst
wallabag-02d4ab1a60eb48f00ad60ec48d02b65509a27e56.zip
fix sessions lasting through reinstallations, they are now deleted
Diffstat (limited to 'install')
-rwxr-xr-xinstall/index.php20
-rw-r--r--install/install_functions.php2
2 files changed, 21 insertions, 1 deletions
diff --git a/install/index.php b/install/index.php
index 77e50864..81fd407a 100755
--- a/install/index.php
+++ b/install/index.php
@@ -16,6 +16,26 @@ $email = "";
16 16
17require_once('install_functions.php'); 17require_once('install_functions.php');
18 18
19// Start by destroying session to avoid wrong logins from previous installations
20// cookie part
21$cookiedir = '';
22if (dirname($_SERVER['SCRIPT_NAME'])!='/') {
23 $cookiedir = dirname($_SERVER["SCRIPT_NAME"]).'/';
24}
25
26if (isset($_SERVER['HTTP_COOKIE'])) {
27 $cookies = explode(';', $_SERVER['HTTP_COOKIE']);
28 foreach($cookies as $cookie) {
29 $parts = explode('=', $cookie);
30 $name = trim($parts[0]);
31 setcookie($name, '', time()-1000);
32 setcookie($name, '', time()-1000, $cookiedir);
33 }
34}
35// session part
36session_destroy();
37
38
19if (isset($_GET['clean'])) { 39if (isset($_GET['clean'])) {
20 if (is_dir('install')){ 40 if (is_dir('install')){
21 delTree('install', true); 41 delTree('install', true);
diff --git a/install/install_functions.php b/install/install_functions.php
index a40db373..a3bf3661 100644
--- a/install/install_functions.php
+++ b/install/install_functions.php
@@ -110,4 +110,4 @@ function executeQuery($handle, $sql, $params) {
110 } 110 }
111} 111}
112 112
113?> \ No newline at end of file 113?>