From da368cc84f4d79afc30052a209502fa8fd17241e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 1 Jun 2013 08:23:37 +0200 Subject: [PATCH] update password in config screen --- index.php | 18 +++++++++++++----- tpl/config.html | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 1522a2ec..91d0b304 100644 --- a/index.php +++ b/index.php @@ -25,11 +25,6 @@ $ref = empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER']; if (isset($_GET['login'])) { // Login if (!empty($_POST['login']) && !empty($_POST['password'])) { -// echo $_SESSION['login']."
"; -// echo $_SESSION['pass']."
"; -// echo $_POST['login']."
"; -// echo encode_string($_POST['password'] . $_POST['login']); -// die; if (Session::login($_SESSION['login'], $_SESSION['pass'], $_POST['login'], encode_string($_POST['password'] . $_POST['login']))) { logm('login successful'); $msg->add('s', 'welcome in your poche!'); @@ -55,6 +50,19 @@ elseif (isset($_GET['logout'])) { Session::logout(); MyTool::redirect(); } +elseif (isset($_GET['config'])) { + if (isset($_POST['password']) && isset($_POST['password_repeat'])) { + if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") { + logm('password updated'); + $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login'])); + $msg->add('s', 'your password has been updated'); + } + else + $msg->add('e', 'your password can\'t be empty and you have to repeat it in the second field'); + } + else + $msg->add('e', 'error in your password update'); +} # Traitement des paramètres et déclenchement des actions $view = (isset ($_REQUEST['view'])) ? htmlentities($_REQUEST['view']) : 'index'; diff --git a/tpl/config.html b/tpl/config.html index 7d1c6afe..1100d455 100644 --- a/tpl/config.html +++ b/tpl/config.html @@ -3,6 +3,25 @@

Thanks to the bookmarklet, you will be able to easily add a link to your poche. If you don't know how use a bookmarklet, have a look here.

Drag & drop this link to your bookmarks bar and have fun with poche.

poche it !

+ +

Password

+
+
+
+ + +
+
+ + +
+
+ +
+
+ + +

Export

Click here to export your poche datas.

\ No newline at end of file -- 2.41.0