Check behaviour with a testing suite, fix behaviour when denying trust
[platal.git] / modules / platal.php
index 1f96e68..951803b 100644 (file)
@@ -137,6 +137,14 @@ class PlatalModule extends PLModule
         if (Post::has('rss')) {
             $this->__set_rss_state(Post::b('rss'));
         }
+
+        # FIXME: this code is not multi-domain compatible. We should decide how
+        # carva will extend to users not in the main domain.
+        $res = XDB::query("SELECT  alias
+                             FROM  aliases
+                            WHERE  id = {?} AND FIND_IN_SET('bestalias', flags)",
+                          S::user()->id());
+        $page->assign('bestalias', $res->fetchOneCell());
     }
 
     function handler_webredir(&$page)
@@ -169,6 +177,14 @@ class PlatalModule extends PLModule
                                       WHERE user_id = {?}',
                                     S::v('uid'));
         $page->assign('carva', $res->fetchOneCell());
+
+        # FIXME: this code is not multi-domain compatible. We should decide how
+        # carva will extend to users not in the main domain.
+        $res = XDB::query("SELECT  alias
+                             FROM  aliases
+                            WHERE  id = {?} AND FIND_IN_SET('bestalias', flags)",
+                          S::user()->id());
+        $page->assign('bestalias', $res->fetchOneCell());
     }
 
     function handler_prefs_rss(&$page)
@@ -448,14 +464,14 @@ Adresse de secours : " . Post::v('email') : ""));
 
     function handler_review(&$page, $action = null, $mode = null) 
     {
-        require_once dirname(__FILE__) . '/platal/review.inc.php';
+        $this->load('review.inc.php');
         $dom = 'Review';
         if (@$GLOBALS['IS_XNET_SITE']) {
             $dom .= 'Xnet';
         }
         $wp = new PlWikiPage($dom . '.Admin');
         $conf = explode('%0a', $wp->getField('text'));
-        $wiz = new PlWizard('Tour d\'horizon', 'core/plwizard.tpl', true);
+        $wiz = new PlWizard('Tour d\'horizon', PlPage::getCoreTpl('plwizard.tpl'), true);
         foreach ($conf as $line) {
             $list = preg_split('/\s*[*|]\s*/', $line, -1, PREG_SPLIT_NO_EMPTY);
             $wiz->addPage('ReviewPage', $list[0], $list[1]);