diff options
author | VirtualTam <virtualtam@flibidi.net> | 2018-04-18 23:45:05 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2018-06-02 16:46:06 +0200 |
commit | 89ccc83ba497fa91eaaf2a2a52d8549aea5e2aee (patch) | |
tree | 195d230527b3a6dbd22aefb7d0b09df66f160bf8 /application | |
parent | 847420847455c1339f3302b1b67568ee0f382a11 (diff) | |
download | Shaarli-89ccc83ba497fa91eaaf2a2a52d8549aea5e2aee.tar.gz Shaarli-89ccc83ba497fa91eaaf2a2a52d8549aea5e2aee.tar.zst Shaarli-89ccc83ba497fa91eaaf2a2a52d8549aea5e2aee.zip |
Login: update PageBuilder and default/vintage templates
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'application')
-rw-r--r-- | application/PageBuilder.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/application/PageBuilder.php b/application/PageBuilder.php index 3233d6b6..a4483870 100644 --- a/application/PageBuilder.php +++ b/application/PageBuilder.php | |||
@@ -25,6 +25,9 @@ class PageBuilder | |||
25 | * @var LinkDB $linkDB instance. | 25 | * @var LinkDB $linkDB instance. |
26 | */ | 26 | */ |
27 | protected $linkDB; | 27 | protected $linkDB; |
28 | |||
29 | /** @var bool $isLoggedIn Whether the user is logged in **/ | ||
30 | protected $isLoggedIn = false; | ||
28 | 31 | ||
29 | /** | 32 | /** |
30 | * PageBuilder constructor. | 33 | * PageBuilder constructor. |
@@ -34,12 +37,13 @@ class PageBuilder | |||
34 | * @param LinkDB $linkDB instance. | 37 | * @param LinkDB $linkDB instance. |
35 | * @param string $token Session token | 38 | * @param string $token Session token |
36 | */ | 39 | */ |
37 | public function __construct(&$conf, $linkDB = null, $token = null) | 40 | public function __construct(&$conf, $linkDB = null, $token = null, $isLoggedIn = false) |
38 | { | 41 | { |
39 | $this->tpl = false; | 42 | $this->tpl = false; |
40 | $this->conf = $conf; | 43 | $this->conf = $conf; |
41 | $this->linkDB = $linkDB; | 44 | $this->linkDB = $linkDB; |
42 | $this->token = $token; | 45 | $this->token = $token; |
46 | $this->isLoggedIn = $isLoggedIn; | ||
43 | } | 47 | } |
44 | 48 | ||
45 | /** | 49 | /** |
@@ -55,7 +59,7 @@ class PageBuilder | |||
55 | $this->conf->get('resource.update_check'), | 59 | $this->conf->get('resource.update_check'), |
56 | $this->conf->get('updates.check_updates_interval'), | 60 | $this->conf->get('updates.check_updates_interval'), |
57 | $this->conf->get('updates.check_updates'), | 61 | $this->conf->get('updates.check_updates'), |
58 | isLoggedIn(), | 62 | $this->isLoggedIn, |
59 | $this->conf->get('updates.check_updates_branch') | 63 | $this->conf->get('updates.check_updates_branch') |
60 | ); | 64 | ); |
61 | $this->tpl->assign('newVersion', escape($version)); | 65 | $this->tpl->assign('newVersion', escape($version)); |
@@ -67,6 +71,7 @@ class PageBuilder | |||
67 | $this->tpl->assign('versionError', escape($exc->getMessage())); | 71 | $this->tpl->assign('versionError', escape($exc->getMessage())); |
68 | } | 72 | } |
69 | 73 | ||
74 | $this->tpl->assign('is_logged_in', $this->isLoggedIn); | ||
70 | $this->tpl->assign('feedurl', escape(index_url($_SERVER))); | 75 | $this->tpl->assign('feedurl', escape(index_url($_SERVER))); |
71 | $searchcrits = ''; // Search criteria | 76 | $searchcrits = ''; // Search criteria |
72 | if (!empty($_GET['searchtags'])) { | 77 | if (!empty($_GET['searchtags'])) { |