diff options
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | include dirname(__FILE__).'/inc/config.php'; | 11 | include dirname(__FILE__).'/inc/config.php'; |
12 | 12 | ||
13 | pocheTool::initPhp(); | 13 | pocheTools::initPhp(); |
14 | 14 | ||
15 | # XSRF protection with token | 15 | # XSRF protection with token |
16 | if (!empty($_POST)) { | 16 | if (!empty($_POST)) { |
@@ -26,7 +26,7 @@ if (isset($_GET['login'])) { | |||
26 | // Login | 26 | // Login |
27 | if (!empty($_POST['login']) && !empty($_POST['password'])) { | 27 | if (!empty($_POST['login']) && !empty($_POST['password'])) { |
28 | if (Session::login($_SESSION['login'], $_SESSION['pass'], $_POST['login'], encode_string($_POST['password'] . $_POST['login']))) { | 28 | if (Session::login($_SESSION['login'], $_SESSION['pass'], $_POST['login'], encode_string($_POST['password'] . $_POST['login']))) { |
29 | pocheTool::logm('login successful'); | 29 | pocheTools::logm('login successful'); |
30 | if (!empty($_POST['longlastingsession'])) { | 30 | if (!empty($_POST['longlastingsession'])) { |
31 | $_SESSION['longlastingsession'] = 31536000; | 31 | $_SESSION['longlastingsession'] = 31536000; |
32 | $_SESSION['expires_on'] = time() + $_SESSION['longlastingsession']; | 32 | $_SESSION['expires_on'] = time() + $_SESSION['longlastingsession']; |
@@ -36,23 +36,23 @@ if (isset($_GET['login'])) { | |||
36 | } | 36 | } |
37 | session_regenerate_id(true); | 37 | session_regenerate_id(true); |
38 | 38 | ||
39 | pocheTool::redirect($referer); | 39 | pocheTools::redirect($referer); |
40 | } | 40 | } |
41 | pocheTool::logm('login failed'); | 41 | pocheTools::logm('login failed'); |
42 | die(_("Login failed !")); | 42 | die(_("Login failed !")); |
43 | } else { | 43 | } else { |
44 | pocheTool::logm('login failed'); | 44 | pocheTools::logm('login failed'); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | elseif (isset($_GET['logout'])) { | 47 | elseif (isset($_GET['logout'])) { |
48 | pocheTool::logm('logout'); | 48 | pocheTools::logm('logout'); |
49 | Session::logout(); | 49 | Session::logout(); |
50 | pocheTool::redirect(); | 50 | pocheTools::redirect(); |
51 | } | 51 | } |
52 | elseif (isset($_GET['config'])) { | 52 | elseif (isset($_GET['config'])) { |
53 | if (isset($_POST['password']) && isset($_POST['password_repeat'])) { | 53 | if (isset($_POST['password']) && isset($_POST['password_repeat'])) { |
54 | if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") { | 54 | if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") { |
55 | pocheTool::logm('password updated'); | 55 | pocheTools::logm('password updated'); |
56 | if (!MODE_DEMO) { | 56 | if (!MODE_DEMO) { |
57 | $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login'])); | 57 | $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login'])); |
58 | #your password has been updated | 58 | #your password has been updated |
@@ -78,7 +78,7 @@ $tpl_vars = array( | |||
78 | 'isLogged' => Session::isLogged(), | 78 | 'isLogged' => Session::isLogged(), |
79 | 'referer' => $referer, | 79 | 'referer' => $referer, |
80 | 'view' => $view, | 80 | 'view' => $view, |
81 | 'poche_url' => pocheTool::getUrl(), | 81 | 'poche_url' => pocheTools::getUrl(), |
82 | 'demo' => MODE_DEMO, | 82 | 'demo' => MODE_DEMO, |
83 | 'title' => _('poche, a read it later open source system'), | 83 | 'title' => _('poche, a read it later open source system'), |
84 | ); | 84 | ); |