aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-07-31 19:37:14 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-07-31 19:37:14 +0200
commit538cdfa8839ca9a3d0bfe9b1a89af8e125aa3490 (patch)
tree2dde1b806eff88eceb30fef9eed589508611267e
parent70b5d24f72d2c3d410b55665162c0ebc78bc0339 (diff)
downloadwallabag-538cdfa8839ca9a3d0bfe9b1a89af8e125aa3490.tar.gz
wallabag-538cdfa8839ca9a3d0bfe9b1a89af8e125aa3490.tar.zst
wallabag-538cdfa8839ca9a3d0bfe9b1a89af8e125aa3490.zip
fix #70: if demo mode, fields are filled
-rw-r--r--inc/config.php4
-rw-r--r--index.php4
-rw-r--r--tpl/login.html4
3 files changed, 7 insertions, 5 deletions
diff --git a/inc/config.php b/inc/config.php
index bd9287fe..a21b388d 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -8,13 +8,13 @@
8 * @license http://www.wtfpl.net/ see COPYING file 8 * @license http://www.wtfpl.net/ see COPYING file
9 */ 9 */
10 10
11define ('POCHE_VERSION', '0.2.1'); 11define ('POCHE_VERSION', '0.3');
12 12
13if (!is_dir('db/')) { 13if (!is_dir('db/')) {
14 @mkdir('db/',0705); 14 @mkdir('db/',0705);
15} 15}
16 16
17define ('MODE_DEMO', FALSE); 17define ('MODE_DEMO', TRUE);
18define ('ABS_PATH', 'assets/'); 18define ('ABS_PATH', 'assets/');
19define ('CONVERT_LINKS_FOOTNOTES', TRUE); 19define ('CONVERT_LINKS_FOOTNOTES', TRUE);
20define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE); 20define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE);
diff --git a/index.php b/index.php
index 0a778d08..5de8f7f0 100644
--- a/index.php
+++ b/index.php
@@ -54,7 +54,7 @@ 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 if (!DEMO) { 57 if (!MODE_DEMO) {
58 $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login'])); 58 $store->updatePassword(encode_string($_POST['password'] . $_SESSION['login']));
59 $msg->add('s', 'your password has been updated'); 59 $msg->add('s', 'your password has been updated');
60 } 60 }
@@ -79,6 +79,7 @@ $tpl->assign('isLogged', Session::isLogged());
79$tpl->assign('referer', $ref); 79$tpl->assign('referer', $ref);
80$tpl->assign('view', $view); 80$tpl->assign('view', $view);
81$tpl->assign('poche_url', myTool::getUrl()); 81$tpl->assign('poche_url', myTool::getUrl());
82$tpl->assign('demo', MODE_DEMO);
82$tpl->assign('title', 'poche, a read it later open source system'); 83$tpl->assign('title', 'poche, a read it later open source system');
83 84
84if (Session::isLogged()) { 85if (Session::isLogged()) {
@@ -86,5 +87,6 @@ if (Session::isLogged()) {
86 display_view($view, $id, $full_head); 87 display_view($view, $id, $full_head);
87} 88}
88else { 89else {
90
89 $tpl->draw('login'); 91 $tpl->draw('login');
90} 92}
diff --git a/tpl/login.html b/tpl/login.html
index 69c17a55..6db742c3 100644
--- a/tpl/login.html
+++ b/tpl/login.html
@@ -9,11 +9,11 @@
9 <h2 class="mbs txtcenter">login to your poche</h2> 9 <h2 class="mbs txtcenter">login to your poche</h2>
10 <div class="row"> 10 <div class="row">
11 <label class="col w150p" for="login">Login</label> 11 <label class="col w150p" for="login">Login</label>
12 <input class="col" type="text" id="login" name="login" placeholder="Login" tabindex="1" autofocus /> 12 <input class="col" type="text" id="login" name="login" placeholder="Login" tabindex="1" autofocus {if="$demo == '1'"}value="poche"{/if} />
13 </div> 13 </div>
14 <div class="row"> 14 <div class="row">
15 <label class="col w150p" for="password">Password</label> 15 <label class="col w150p" for="password">Password</label>
16 <input class="col" type="password" id="password" name="password" placeholder="Password" tabindex="2"> 16 <input class="col" type="password" id="password" name="password" placeholder="Password" tabindex="2" {if="$demo == '1'"}value="poche"{/if} />
17 </div> 17 </div>
18 <div class="row"> 18 <div class="row">
19 <label class="col w150p">Stay signed in</label> 19 <label class="col w150p">Stay signed in</label>