From 6499b26ae8e148fa5481db5b7a4e9fc0e55aad94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 1 Jun 2013 08:29:37 +0200 Subject: demo mode (you can't update password in demo mode --- index.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 91d0b304..0a778d08 100644 --- a/index.php +++ b/index.php @@ -54,14 +54,17 @@ 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'); + if (!DEMO) { + $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login'])); + $msg->add('s', 'your password has been updated'); + } + else { + $msg->add('i', 'in demo mode, you can\'t update password'); + } } 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 -- cgit v1.2.3