diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2013-07-31 17:19:50 +0200 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2013-07-31 17:19:50 +0200 |
commit | 85ebc80c7eaf88e4d57a52adb8e4c32d8cc34b64 (patch) | |
tree | 0012345c93b1fe8a242963bede0db370598d6f2b /index.php | |
parent | 6588517b2d46cbc524260758d1fafd92b19ab681 (diff) | |
parent | 6d37de5f828b700843567a91418671919eed4be4 (diff) | |
download | wallabag-85ebc80c7eaf88e4d57a52adb8e4c32d8cc34b64.tar.gz wallabag-85ebc80c7eaf88e4d57a52adb8e4c32d8cc34b64.tar.zst wallabag-85ebc80c7eaf88e4d57a52adb8e4c32d8cc34b64.zip |
Merge branch 'dev'0.3
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -25,9 +25,9 @@ $ref = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; | |||
25 | if (isset($_GET['login'])) { | 25 | 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('poche', 'poche', $_POST['login'], $_POST['password'])) { | 28 | if (Session::login($_SESSION['login'], $_SESSION['pass'], $_POST['login'], encode_string($_POST['password'] . $_POST['login']))) { |
29 | logm('login successful'); | 29 | logm('login successful'); |
30 | $msg->add('s', 'welcome in your pocket!'); | 30 | $msg->add('s', 'welcome in your poche!'); |
31 | if (!empty($_POST['longlastingsession'])) { | 31 | if (!empty($_POST['longlastingsession'])) { |
32 | $_SESSION['longlastingsession'] = 31536000; | 32 | $_SESSION['longlastingsession'] = 31536000; |
33 | $_SESSION['expires_on'] = time() + $_SESSION['longlastingsession']; | 33 | $_SESSION['expires_on'] = time() + $_SESSION['longlastingsession']; |
@@ -50,6 +50,22 @@ elseif (isset($_GET['logout'])) { | |||
50 | Session::logout(); | 50 | Session::logout(); |
51 | MyTool::redirect(); | 51 | MyTool::redirect(); |
52 | } | 52 | } |
53 | elseif (isset($_GET['config'])) { | ||
54 | if (isset($_POST['password']) && isset($_POST['password_repeat'])) { | ||
55 | if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") { | ||
56 | logm('password updated'); | ||
57 | if (!DEMO) { | ||
58 | $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login'])); | ||
59 | $msg->add('s', 'your password has been updated'); | ||
60 | } | ||
61 | else { | ||
62 | $msg->add('i', 'in demo mode, you can\'t update password'); | ||
63 | } | ||
64 | } | ||
65 | else | ||
66 | $msg->add('e', 'your password can\'t be empty and you have to repeat it in the second field'); | ||
67 | } | ||
68 | } | ||
53 | 69 | ||
54 | # Traitement des paramètres et déclenchement des actions | 70 | # Traitement des paramètres et déclenchement des actions |
55 | $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index'; | 71 | $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index'; |