Converts the Platal module to hruid (mainly two FIXME).
authorVincent Zanotti <vincent.zanotti@polytechnique.org>
Sun, 12 Oct 2008 14:13:11 +0000 (16:13 +0200)
committerVincent Zanotti <vincent.zanotti@polytechnique.org>
Sun, 12 Oct 2008 14:13:11 +0000 (16:13 +0200)
Signed-off-by: Vincent Zanotti <vincent.zanotti@polytechnique.org>
modules/platal.php
templates/platal/filrss.tpl
templates/platal/preferences.tpl
templates/platal/webredirect.tpl

index a1699d5..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)
index de808fa..26cd81c 100644 (file)
@@ -52,11 +52,11 @@ En voici les adresses&nbsp;:
 <ul>
   <li>
   Anonces sur la page d'entrée&nbsp;:
-  <a href="rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml" title="Annonces">{icon name=feed title='fil rss'}</a>
+  <a href="rss/{$smarty.session.hruid}/{$smarty.session.core_rss_hash}/rss.xml" title="Annonces">{icon name=feed title='fil rss'}</a>
   </li>
   <li>
   Ton carnet polytechnicien&nbsp;:
-  <a href="carnet/rss/{$smarty.session.forlife}/{$smarty.session.core_rss_hash}/rss.xml" title="Notifications">{icon name=feed title='fil rss'}</a>
+  <a href="carnet/rss/{$smarty.session.hruid}/{$smarty.session.core_rss_hash}/rss.xml" title="Notifications">{icon name=feed title='fil rss'}</a>
   </li>
 </ul>
 <p>
index 12f9062..ecaa4cf 100644 (file)
@@ -49,7 +49,7 @@
       <h3><a href="prefs/webredirect">Ma redirection de page WEB</a></h3>
       <div class='explication'>
         Tu peux configurer tes redirections WEB
-        http://www.carva.org/{$smarty.session.bestalias}.
+        http://www.carva.org/{$bestalias}.
       </div>
     </td>
     <td class="half">
index 6d3da9c..fa9b58a 100644 (file)
@@ -27,8 +27,8 @@
 <p>
   Dans la lignée du service de redirection d'emails de <strong>{#globals.core.sitename#}</strong>,
   il est possible de faire pointer
-    les adresses <strong>http://www.carva.org/{$smarty.session.bestalias}</strong>
-  et <strong>http://www.carva.org/{$smarty.session.forlife}</strong>
+    les adresses <strong>http://www.carva.org/{$bestalias}</strong>
+  et <strong>http://www.carva.org/{$smarty.session.hruid}</strong>
     vers la page WEB de ton choix. Pour de plus amples détails, consulte
   <a href="Xorg/MaRedirectionWeb">cette page</a>
 </p>
 <p>
 {if $carva}
   Actuellement, les adresses
-  <a href="http://www.carva.org/{$smarty.session.bestalias}">
-    http://www.carva.org/{$smarty.session.bestalias}
-  </a> et <a href="http://www.carva.org/{$smarty.session.forlife}">
-    http://www.carva.org/{$smarty.session.forlife}
-  </a> sont redirigées sur <a href="http://{$carva}">http://{$carva}</a>
+  <a href="http://www.carva.org/{$bestalias}">http://www.carva.org/{$bestalias}</a> et
+  <a href="http://www.carva.org/{$smarty.session.hruid}">http://www.carva.org/{$smarty.session.hruid}</a>
+  sont redirigées sur <a href="http://{$carva}">http://{$carva}</a>
 {else}
   La redirection n'est pas utilisée ...
 {/if}