diff options
author | VirtualTam <virtualtam+github@flibidi.net> | 2018-06-03 18:26:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-03 18:26:32 +0200 |
commit | d9cd27322a97e6ed3a8b11a380ef0080e3baf79c (patch) | |
tree | c4299a352b3f4c518f79eb7208f667f68f8e9388 /application/PageBuilder.php | |
parent | 8f816d8ddfe9219e15580cef6e5c9037d1d4fd28 (diff) | |
parent | 8edd7f15886620b07064aa889aea05c5acbc0e58 (diff) | |
download | Shaarli-d9cd27322a97e6ed3a8b11a380ef0080e3baf79c.tar.gz Shaarli-d9cd27322a97e6ed3a8b11a380ef0080e3baf79c.tar.zst Shaarli-d9cd27322a97e6ed3a8b11a380ef0080e3baf79c.zip |
Merge pull request #1086 from virtualtam/refactor/login
Refactor user login and session management
Diffstat (limited to 'application/PageBuilder.php')
-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'])) { |