diff options
author | Nicolas Lœuillet <nicolas@loeuillet.org> | 2013-06-01 08:29:37 +0200 |
---|---|---|
committer | Nicolas Lœuillet <nicolas@loeuillet.org> | 2013-06-01 08:29:37 +0200 |
commit | 6499b26ae8e148fa5481db5b7a4e9fc0e55aad94 (patch) | |
tree | 4974d01d7813d78ae9760332cba3006aaffc20c4 | |
parent | da368cc84f4d79afc30052a209502fa8fd17241e (diff) | |
download | wallabag-6499b26ae8e148fa5481db5b7a4e9fc0e55aad94.tar.gz wallabag-6499b26ae8e148fa5481db5b7a4e9fc0e55aad94.tar.zst wallabag-6499b26ae8e148fa5481db5b7a4e9fc0e55aad94.zip |
demo mode (you can't update password in demo mode
-rw-r--r--[-rwxr-xr-x] | img/messages/close.png | bin | 662 -> 662 bytes | |||
-rw-r--r--[-rwxr-xr-x] | img/messages/cross.png | bin | 655 -> 655 bytes | |||
-rw-r--r--[-rwxr-xr-x] | img/messages/help.png | bin | 786 -> 786 bytes | |||
-rw-r--r--[-rwxr-xr-x] | img/messages/tick.png | bin | 537 -> 537 bytes | |||
-rw-r--r--[-rwxr-xr-x] | img/messages/warning.png | bin | 666 -> 666 bytes | |||
-rw-r--r-- | inc/config.php | 1 | ||||
-rw-r--r-- | inc/store/sqlite.class.php | 7 | ||||
-rw-r--r-- | index.php | 11 |
8 files changed, 15 insertions, 4 deletions
diff --git a/img/messages/close.png b/img/messages/close.png index 731aa018..731aa018 100755..100644 --- a/img/messages/close.png +++ b/img/messages/close.png | |||
Binary files differ | |||
diff --git a/img/messages/cross.png b/img/messages/cross.png index 1514d51a..1514d51a 100755..100644 --- a/img/messages/cross.png +++ b/img/messages/cross.png | |||
Binary files differ | |||
diff --git a/img/messages/help.png b/img/messages/help.png index 5c870176..5c870176 100755..100644 --- a/img/messages/help.png +++ b/img/messages/help.png | |||
Binary files differ | |||
diff --git a/img/messages/tick.png b/img/messages/tick.png index a9925a06..a9925a06 100755..100644 --- a/img/messages/tick.png +++ b/img/messages/tick.png | |||
Binary files differ | |||
diff --git a/img/messages/warning.png b/img/messages/warning.png index 628cf2da..628cf2da 100755..100644 --- a/img/messages/warning.png +++ b/img/messages/warning.png | |||
Binary files differ | |||
diff --git a/inc/config.php b/inc/config.php index 2de725f4..bd9287fe 100644 --- a/inc/config.php +++ b/inc/config.php | |||
@@ -14,6 +14,7 @@ if (!is_dir('db/')) { | |||
14 | @mkdir('db/',0705); | 14 | @mkdir('db/',0705); |
15 | } | 15 | } |
16 | 16 | ||
17 | define ('MODE_DEMO', FALSE); | ||
17 | define ('ABS_PATH', 'assets/'); | 18 | define ('ABS_PATH', 'assets/'); |
18 | define ('CONVERT_LINKS_FOOTNOTES', TRUE); | 19 | define ('CONVERT_LINKS_FOOTNOTES', TRUE); |
19 | define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE); | 20 | define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE); |
diff --git a/inc/store/sqlite.class.php b/inc/store/sqlite.class.php index 4bfbb29e..21081608 100644 --- a/inc/store/sqlite.class.php +++ b/inc/store/sqlite.class.php | |||
@@ -74,6 +74,13 @@ class Sqlite extends Store { | |||
74 | return isset($pass[0]['value']) ? $pass[0]['value'] : FALSE; | 74 | return isset($pass[0]['value']) ? $pass[0]['value'] : FALSE; |
75 | } | 75 | } |
76 | 76 | ||
77 | public function updatePassword($password) | ||
78 | { | ||
79 | $sql_update = "UPDATE config SET value=? WHERE name='password'"; | ||
80 | $params_update = array($password); | ||
81 | $query = $this->executeQuery($sql_update, $params_update); | ||
82 | } | ||
83 | |||
77 | private function executeQuery($sql, $params) { | 84 | private function executeQuery($sql, $params) { |
78 | try | 85 | try |
79 | { | 86 | { |
@@ -54,14 +54,17 @@ elseif (isset($_GET['config'])) { | |||
54 | if (isset($_POST['password']) && isset($_POST['password_repeat'])) { | 54 | if (isset($_POST['password']) && isset($_POST['password_repeat'])) { |
55 | if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") { | 55 | if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") { |
56 | logm('password updated'); | 56 | logm('password updated'); |
57 | $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login'])); | 57 | if (!DEMO) { |
58 | $msg->add('s', 'your password has been updated'); | 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 | } | ||
59 | } | 64 | } |
60 | else | 65 | else |
61 | $msg->add('e', 'your password can\'t be empty and you have to repeat it in the second field'); | 66 | $msg->add('e', 'your password can\'t be empty and you have to repeat it in the second field'); |
62 | } | 67 | } |
63 | else | ||
64 | $msg->add('e', 'error in your password update'); | ||
65 | } | 68 | } |
66 | 69 | ||
67 | # Traitement des paramètres et déclenchement des actions | 70 | # Traitement des paramètres et déclenchement des actions |