aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 13 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'];
25if (isset($_GET['login'])) { 25if (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}
53elseif (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';