From 99132dee513750acb49548c0b9f753d4bc4c95bc Mon Sep 17 00:00:00 2001 From: Vincent Zanotti Date: Sun, 24 Aug 2008 02:30:39 +0200 Subject: [PATCH] Switches the core to S::user() paradigm, while retaining older S::v('forlife') model, for compatibility reasons. Signed-off-by: Vincent Zanotti --- include/wiki.engine.inc.php | 7 ++++++- modules/core.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/wiki.engine.inc.php b/include/wiki.engine.inc.php index d8cb60a..fe72475 100644 --- a/include/wiki.engine.inc.php +++ b/include/wiki.engine.inc.php @@ -125,7 +125,12 @@ $page->addJsLink('wiki.js'); if (!Env::v('action')) { $url = '/' . str_replace('.', '/', $n) . '?action=rss'; if (S::logged()) { - $url .= '&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash'); + if (S::user()) { + $url .= '&user=' . S::user()->login() . '&hash=' . S::v('core_rss_hash'); + } else { + // TODO(vzanotti): trash that code when forlife support will be gone. + $url .= '&user=' . S::v('forlife') . '&hash=' . S::v('core_rss_hash'); + } } $page->setRssLink($n, $url); } diff --git a/modules/core.php b/modules/core.php index d025c4a..b82c2ef 100644 --- a/modules/core.php +++ b/modules/core.php @@ -113,7 +113,12 @@ class CoreModule extends PLModule } if (isset($_SESSION['log'])) { - S::logger()->log("suid_start", "login by ".S::v('forlife')); + if (S::user()) { + S::logger()->log("suid_start", "login by " . S::user()->login()); + } else { + // TODO(vzanotti): trash that code when support of forlife will be gone. + S::logger()->log("suid_start", "login by ".S::v('forlife')); + } } Platal::session()->startSUID(S::i('uid')); Platal::session()->makePerms($level); -- 2.1.4