Switches the core to S::user() paradigm, while retaining older S::v('forlife') model,
authorVincent Zanotti <vincent.zanotti@polytechnique.org>
Sun, 24 Aug 2008 00:30:39 +0000 (02:30 +0200)
committerVincent Zanotti <vincent.zanotti@polytechnique.org>
Sun, 24 Aug 2008 00:30:39 +0000 (02:30 +0200)
for compatibility reasons.

Signed-off-by: Vincent Zanotti <vincent.zanotti@polytechnique.org>
include/wiki.engine.inc.php
modules/core.php

index d8cb60a..fe72475 100644 (file)
@@ -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);
 }
index d025c4a..b82c2ef 100644 (file)
@@ -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);