diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2013-06-01 08:23:37 +0200 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2013-06-01 08:23:37 +0200 |
commit | da368cc84f4d79afc30052a209502fa8fd17241e (patch) | |
tree | 14c551e39ae97dc19b1a6a7fb4343e8ed10f209f /index.php | |
parent | aa8c9f2a32ea75278d52c86c6a3a39d34bce5cc7 (diff) | |
download | wallabag-da368cc84f4d79afc30052a209502fa8fd17241e.tar.gz wallabag-da368cc84f4d79afc30052a209502fa8fd17241e.tar.zst wallabag-da368cc84f4d79afc30052a209502fa8fd17241e.zip |
update password in config screen
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 18 |
1 files changed, 13 insertions, 5 deletions
@@ -25,11 +25,6 @@ $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 | // echo $_SESSION['login']."<br>"; | ||
29 | // echo $_SESSION['pass']."<br>"; | ||
30 | // echo $_POST['login']."<br>"; | ||
31 | // echo encode_string($_POST['password'] . $_POST['login']); | ||
32 | // die; | ||
33 | 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']))) { |
34 | logm('login successful'); | 29 | logm('login successful'); |
35 | $msg->add('s', 'welcome in your poche!'); | 30 | $msg->add('s', 'welcome in your poche!'); |
@@ -55,6 +50,19 @@ elseif (isset($_GET['logout'])) { | |||
55 | Session::logout(); | 50 | Session::logout(); |
56 | MyTool::redirect(); | 51 | MyTool::redirect(); |
57 | } | 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 | $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login'])); | ||
58 | $msg->add('s', 'your password has been updated'); | ||
59 | } | ||
60 | else | ||
61 | $msg->add('e', 'your password can\'t be empty and you have to repeat it in the second field'); | ||
62 | } | ||
63 | else | ||
64 | $msg->add('e', 'error in your password update'); | ||
65 | } | ||
58 | 66 | ||
59 | # Traitement des paramètres et déclenchement des actions | 67 | # Traitement des paramètres et déclenchement des actions |
60 | $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index'; | 68 | $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index'; |