aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorVirtualTam <virtualtam@flibidi.net>2018-04-18 23:45:05 +0200
committerVirtualTam <virtualtam@flibidi.net>2018-06-02 16:46:06 +0200
commit89ccc83ba497fa91eaaf2a2a52d8549aea5e2aee (patch)
tree195d230527b3a6dbd22aefb7d0b09df66f160bf8 /index.php
parent847420847455c1339f3302b1b67568ee0f382a11 (diff)
downloadShaarli-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 'index.php')
-rw-r--r--index.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/index.php b/index.php
index 04b0e4ba..c87ebf65 100644
--- a/index.php
+++ b/index.php
@@ -182,9 +182,11 @@ define('STAY_SIGNED_IN_TOKEN', sha1($conf->get('credentials.hash') . $_SERVER['R
182$loginManager->checkLoginState($_SESSION, $_COOKIE, WEB_PATH, $clientIpId, STAY_SIGNED_IN_TOKEN); 182$loginManager->checkLoginState($_SESSION, $_COOKIE, WEB_PATH, $clientIpId, STAY_SIGNED_IN_TOKEN);
183 183
184/** 184/**
185 * Adapter function for PageBuilder 185 * Adapter function to ensure compatibility with third-party templates
186 * 186 *
187 * TODO: update PageBuilder and tests 187 * @see https://github.com/shaarli/Shaarli/pull/1086
188 *
189 * @return bool true when the user is logged in, false otherwise
188 */ 190 */
189function isLoggedIn() 191function isLoggedIn()
190{ 192{
@@ -383,9 +385,10 @@ function showDailyRSS($conf, $loginManager) {
383 * @param PageBuilder $pageBuilder Template engine wrapper. 385 * @param PageBuilder $pageBuilder Template engine wrapper.
384 * @param LinkDB $LINKSDB LinkDB instance. 386 * @param LinkDB $LINKSDB LinkDB instance.
385 * @param ConfigManager $conf Configuration Manager instance. 387 * @param ConfigManager $conf Configuration Manager instance.
386 * @param PluginManager $pluginManager Plugin Manager instane. 388 * @param PluginManager $pluginManager Plugin Manager instance.
389 * @param LoginManager $loginManager Login Manager instance
387 */ 390 */
388function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager) 391function showDaily($pageBuilder, $LINKSDB, $conf, $pluginManager, $loginManager)
389{ 392{
390 $day = date('Ymd', strtotime('-1 day')); // Yesterday, in format YYYYMMDD. 393 $day = date('Ymd', strtotime('-1 day')); // Yesterday, in format YYYYMMDD.
391 if (isset($_GET['day'])) { 394 if (isset($_GET['day'])) {
@@ -523,7 +526,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
523 die($e->getMessage()); 526 die($e->getMessage());
524 } 527 }
525 528
526 $PAGE = new PageBuilder($conf, $LINKSDB, $sessionManager->generateToken()); 529 $PAGE = new PageBuilder($conf, $LINKSDB, $sessionManager->generateToken(), $loginManager->isLoggedIn());
527 $PAGE->assign('linkcount', count($LINKSDB)); 530 $PAGE->assign('linkcount', count($LINKSDB));
528 $PAGE->assign('privateLinkcount', count_private($LINKSDB)); 531 $PAGE->assign('privateLinkcount', count_private($LINKSDB));
529 $PAGE->assign('plugin_errors', $pluginManager->getErrors()); 532 $PAGE->assign('plugin_errors', $pluginManager->getErrors());
@@ -708,7 +711,7 @@ function renderPage($conf, $pluginManager, $LINKSDB, $history, $sessionManager,
708 711
709 // Daily page. 712 // Daily page.
710 if ($targetPage == Router::$PAGE_DAILY) { 713 if ($targetPage == Router::$PAGE_DAILY) {
711 showDaily($PAGE, $LINKSDB, $conf, $pluginManager); 714 showDaily($PAGE, $LINKSDB, $conf, $pluginManager, $loginManager);
712 } 715 }
713 716
714 // ATOM and RSS feed. 717 // ATOM and RSS feed.