diff options
author | nicosomb <nicolas@loeuillet.org> | 2013-04-20 10:22:00 +0200 |
---|---|---|
committer | nicosomb <nicolas@loeuillet.org> | 2013-04-20 10:22:00 +0200 |
commit | 8c72b98d9d6f3e8a4d88afbe5f499f115d2d532a (patch) | |
tree | 445745316e8201ba065435e8e4a86b2ab1f5ee49 /index.php | |
parent | 6a02410a9b0edb0d95e5355bc1793043d63d6a10 (diff) | |
download | wallabag-8c72b98d9d6f3e8a4d88afbe5f499f115d2d532a.tar.gz wallabag-8c72b98d9d6f3e8a4d88afbe5f499f115d2d532a.tar.zst wallabag-8c72b98d9d6f3e8a4d88afbe5f499f115d2d532a.zip |
Fixed #63 - le referer n'était plus pris en compte
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -20,6 +20,8 @@ if (!empty($_POST)) { | |||
20 | unset($_SESSION['tokens']); | 20 | unset($_SESSION['tokens']); |
21 | } | 21 | } |
22 | 22 | ||
23 | $ref = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; | ||
24 | |||
23 | if (isset($_GET['login'])) { | 25 | if (isset($_GET['login'])) { |
24 | // Login | 26 | // Login |
25 | if (!empty($_POST['login']) && !empty($_POST['password'])) { | 27 | if (!empty($_POST['login']) && !empty($_POST['password'])) { |
@@ -34,7 +36,7 @@ if (isset($_GET['login'])) { | |||
34 | } | 36 | } |
35 | session_regenerate_id(true); | 37 | session_regenerate_id(true); |
36 | 38 | ||
37 | MyTool::redirect(); | 39 | MyTool::redirect($ref); |
38 | } | 40 | } |
39 | logm('login failed'); | 41 | logm('login failed'); |
40 | die("Login failed !"); | 42 | die("Login failed !"); |
@@ -55,7 +57,6 @@ $action = (isset ($_REQUEST['action'])) ? htmlentities($_REQUEST['ac | |||
55 | $_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id'; | 57 | $_SESSION['sort'] = (isset ($_REQUEST['sort'])) ? htmlentities($_REQUEST['sort']) : 'id'; |
56 | $id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : ''; | 58 | $id = (isset ($_REQUEST['id'])) ? htmlspecialchars($_REQUEST['id']) : ''; |
57 | $url = (isset ($_GET['url'])) ? $_GET['url'] : ''; | 59 | $url = (isset ($_GET['url'])) ? $_GET['url'] : ''; |
58 | $ref = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; | ||
59 | 60 | ||
60 | $tpl->assign('isLogged', Session::isLogged()); | 61 | $tpl->assign('isLogged', Session::isLogged()); |
61 | $tpl->assign('referer', $ref); | 62 | $tpl->assign('referer', $ref); |
@@ -69,4 +70,4 @@ if (Session::isLogged()) { | |||
69 | } | 70 | } |
70 | else { | 71 | else { |
71 | $tpl->draw('login'); | 72 | $tpl->draw('login'); |
72 | } \ No newline at end of file | 73 | } |