From: Vincent Zanotti Date: Sun, 24 Aug 2008 00:30:39 +0000 (+0200) Subject: Switches the core to S::user() paradigm, while retaining older S::v('forlife') model, X-Git-Tag: core/1.0.0~25 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=99132dee513750acb49548c0b9f753d4bc4c95bc;p=platal.git Switches the core to S::user() paradigm, while retaining older S::v('forlife') model, for compatibility reasons. Signed-off-by: Vincent Zanotti --- 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);