diff options
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 | } |