Fixes sector and function's display in the profile edition interface.
[platal.git] / modules / platal.php
index a1699d5..1249335 100644 (file)
@@ -62,6 +62,11 @@ class PlatalModule extends PLModule
 
     function handler_index(&$page)
     {
+        // Include X-XRDS-Location response-header for Yadis discovery
+        global $globals;
+        header('X-XRDS-Location: ' . $globals->baseurl . '/openid/idp_xrds');
+
+        // Redirect to the suitable page
         if (S::logged()) {
             pl_redirect('events');
         } else if (!@$GLOBALS['IS_XNET_SITE']) {
@@ -87,7 +92,7 @@ class PlatalModule extends PLModule
         $page->changeTpl('platal/changeLog.tpl');
 
         $clog = pl_entities(file_get_contents(dirname(__FILE__).'/../ChangeLog'));
-        $clog = preg_replace('/=+\s*/', '</pre><hr /><pre>', $clog);
+        $clog = preg_replace('/===+\s*/', '</pre><hr /><pre>', $clog);
         // url catch only (not all wiki syntax)
         $clog = preg_replace(array(
             '/((?:https?|ftp):\/\/(?:\.*,*[\w@~%$£µ&i#\-+=_\/\?;])*)/ui',
@@ -137,6 +142,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 +182,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,6 +469,10 @@ Adresse de secours : " . Post::v('email') : ""));
 
     function handler_review(&$page, $action = null, $mode = null) 
     {
+        // Include X-XRDS-Location response-header for Yadis discovery
+        global $globals;
+        header('X-XRDS-Location: ' . $globals->baseurl . '/openid/idp_xrds');
+
         $this->load('review.inc.php');
         $dom = 'Review';
         if (@$GLOBALS['IS_XNET_SITE']) {