remove more old cruft \o/
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 22 Jul 2006 20:00:58 +0000 (20:00 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Sat, 22 Jul 2006 20:00:58 +0000 (20:00 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@571 839d8a87-29fc-0310-9880-83ba4fa771e5

16 files changed:
include/platal/page.inc.php
plugins/block.min_auth.php [deleted file]
plugins/block.only_public.php [deleted file]
plugins/block.perms.php [deleted file]
templates/fiche.tpl
templates/include/minifiche.tpl
templates/newsletter/show.tpl
templates/password_prompt.tpl
templates/search/adv.form.tpl
templates/search/index.tpl
templates/search/quick.form.tpl
templates/search/quick.tpl
templates/skin/common.footer.tpl
templates/skin/common.menu.tpl
templates/trezo/index.tpl
templates/xnet/skin.tpl

index ccbd60c..83f26a1 100644 (file)
@@ -109,7 +109,7 @@ class PlatalPage extends Smarty
             exit;
 
           case SIMPLE:
-            $page->assign('simple', true);
+            $this->assign('simple', true);
           case SKINNED:
            $this->register_modifier('escape_html', 'escape_html');
            $this->default_modifiers = Array('@escape_html');
diff --git a/plugins/block.min_auth.php b/plugins/block.min_auth.php
deleted file mode 100644 (file)
index 5caa432..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************/
-
-/*
- * Smarty plugin
- * -------------------------------------------------------------
- * File:     block.min_auth.php
- * Type:     block
- * Name:     min_auth
- * Purpose:  
- * -------------------------------------------------------------
- */
-function smarty_block_min_auth($params, $content, &$smarty)
-{
-    if( empty($content) || empty($params['level'] ))
-        return;
-    if( ($params['level'] == 'public') ||
-        ($params['level'] == 'cookie' && S::logged()) ||
-        ($params['level'] == 'auth' && S::identified()) )
-        return $content;
-}
-?>
diff --git a/plugins/block.only_public.php b/plugins/block.only_public.php
deleted file mode 100644 (file)
index 24430a2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************/
-
-/*
- * Smarty plugin
- * -------------------------------------------------------------
- * File:     block.min_auth.php
- * Type:     block
- * Name:     min_auth
- * Purpose:  
- * -------------------------------------------------------------
- */
-function smarty_block_only_public($params, $content, &$smarty)
-{
-    if( empty($content) || S::logged() )
-        return;
-    return $content;
-}
-?>
diff --git a/plugins/block.perms.php b/plugins/block.perms.php
deleted file mode 100644 (file)
index 51ff85d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2006 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************/
-
-/*
- * Smarty plugin
- * -------------------------------------------------------------
- * File:     block.min_perms.php
- * Type:     block
- * Name:     min_perms
- * Purpose:  
- * -------------------------------------------------------------
- */
-function smarty_block_perms($params, $content, &$smarty)
-{
-    if( empty($content) || empty($params['level'] ))
-        return;
-    if( ($params['level'] == 'public') ||
-        ($params['level'] == 'admin' && S::has_perms()) )
-        return $content;
-}
-?>
index 0576af4..4659747 100644 (file)
@@ -56,11 +56,11 @@ function chgMainWinLoc( strPage ) {
           <img src="images/retirer.gif" alt="Retirer de mes contacts" title="Retirer de mes contacts" />
         </a>
         {/if}
-        {perms level=admin}
+        {if $smarty.session.perms eq admin}
         <a href="javascript:x()" onclick="chgMainWinLoc('admin/utilisateurs.php?login={$x.forlife}')">
           <img src="images/admin.png" alt='admin' title="administrer user" />
         </a>
-        {/perms}
+        {/if}
         {/if}
       </div>
       {if $logged}
index 48a8df8..b16f168 100644 (file)
@@ -22,7 +22,7 @@
 
 
 {if !$c.inscrit || $c.dcd}<div class='grayed'>{/if}
-<div class="contact" {if $c.inscrit}{min_auth level='cookie'}title="fiche mise à jour le {$c.date|date_format}"{/min_auth}{/if}>
+<div class="contact" {if $c.inscrit}{if $smarty.session.auth ge AUTH_COOKIE}title="fiche mise à jour le {$c.date|date_format}"{/if}{/if}>
 
   <div class="nom">
     {if $c.sexe}&bull;{/if}
     (X {$c.promo}{if $c.app0text}, {applis_fmt type=$c.app0type text=$c.app0text url=$c.app0url}
     {/if}{if $c.app1text}, {applis_fmt type=$c.app1type text=$c.app1text url=$c.app1url}{/if})
     {if $c.dcd}décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if}
-    {min_auth level="cookie"}
+    {if $smarty.session.auth ge AUTH_COOKIE}
     {if !$c.dcd && !$c.wasinscrit}
     <a href="marketing/public/{$c.user_id}" class='popup'>clique ici si tu connais son adresse email !</a>
     {/if}
-    {/min_auth}
+    {/if}
   </div>
 
   <div class="bits">
-    {min_auth level="cookie"}
+    {if $smarty.session.auth ge AUTH_COOKIE}
     {if !$c.wasinscrit && !$c.dcd}
       {if $show_action eq ajouter}
         <a href="carnet/notifs/add_nonins/{$c.user_id}">{*
@@ -66,9 +66,9 @@
             title="{if $show_action eq "ajouter"}Ajouter à mes{else}Retirer de mes{/if} contacts" /></a>
       {/if}
     {/if}
-    {/min_auth}
+    {/if}
 
-    {perms level='admin'}
+    {if $smarty.session.perms eq admin}
       {if !$c.wasinscrit && !$c.dcd}
         <a href="marketing/private/{$c.user_id}">{*
           *}<img src="images/admin.png" alt='admin' title="marketter user" /></a>
@@ -78,7 +78,7 @@
       {/if}
       <a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&amp;anc_id={$c.matricule_ax}">{*
       *}<img src="images/ax.png" alt='AX' title="fiche AX" /></a>
-    {/perms}
+    {/if}
   </div>
 
   <div class="long">
index a24ef6a..ba2200e 100644 (file)
@@ -31,9 +31,9 @@
 {else}
 [<a href='nl/show/{$nl->_id}?text=1'>version Texte</a>]
 {/if}
-{perms level='admin'}
+{if $smarty.session.perms eq admin}
 [<a href='admin/newsletter_edit.php?nid={$nl->_id}'>Editer</a>]
-{/perms}
+{/if}
 </p>
 
 <form method="post" action="{$platal->path}">
index 58e39c7..b1378ca 100644 (file)
 <h1>
   Accès réservé aux Polytechniciens
 </h1>
-{min_auth level="cookie"}
+{if $smarty.session.auth ge AUTH_COOKIE}
 <p>
 <strong>Merci de rentrer ton mot de passe pour démarrer une connexion au site.</strong>
 Si tu n'es pas {insert name="getName"}, change le login ci-dessous, ou rends-toi sur
 <a href="register/">la page d'inscription</a>.
 </p>
-{/min_auth}
+{/if}
 
-{only_public}
+{if !$smarty.session.auth}
 <p>
 <strong>Tu ne connais pas ton mot de passe ?</strong>
 </p>
@@ -58,7 +58,7 @@ Si tu n'es pas {insert name="getName"}, change le login ci-dessous, ou rends-toi
       paramètres personnels.</a></strong>
   </li>
 </ul>
-{/only_public}
+{/if}
 
 <br />
 
index 70aebb4..5930963 100644 (file)
       <td><input type="text" name="free" size="32" value="{$smarty.request.free}" /></td>
     </tr>
   </table>
-  {min_auth level='cookie'}
+  {if $smarty.session.auth ge AUTH_COOKIE}
   <p>
     <input type='checkbox' name='order' value='date_mod' {if $smarty.request.order eq "date_mod"}checked='checked'{/if} />
     mettre les fiches modifiées récemment en premier
   </p>
-  {/min_auth}
+  {/if}
 </form>
 <p class="center">
   <script type="text/javascript">{literal}
index 8c9b080..71f5c21 100644 (file)
@@ -82,7 +82,7 @@
   {/if}
   {/if}
 
-  {min_auth level='cookie'}
+  {if $smarty.session.auth ge AUTH_COOKIE}
   <br />
   {if $smarty.capture.list|smarty:nodefaults|display_lines > 20}
   {if $advanced}
@@ -95,7 +95,7 @@
   <p>
   <strong>Astuce:</strong>
   Si tu survoles une fiche, tu sauras quand elle a été mise à jour la dernière fois !</p>
-  {/min_auth}
+  {/if}
 {else}
   {if $advanced}
   {include file=search/adv.form.tpl}
index ddf2802..dc95c51 100644 (file)
     <tr>
       <td style="width: 78%">
         <input type='text' name="quick" value="{$smarty.request.quick}" style="width: 100%" /><br />
-        {min_auth level='cookie'}
+        {if $smarty.session.auth ge AUTH_COOKIE}
         <input type='checkbox' name='order' value='date_mod' {if $smarty.request.order eq "date_mod"}checked='checked'{/if} />
         mettre les fiches modifiées récemment en premier
         {if $smarty.request.nonins}
         <br /><input type='checkbox' name='nonins' readonly="readonly" checked='checked' value='1' /> Chercher uniquement des non inscrits
         {/if}
-        {/min_auth}
+        {/if}
       </td>
       <td>
         <input type="submit" value="Chercher" />
-        {min_auth level="cookie"}
+        {if $smarty.session.auth ge AUTH_COOKIE}
         <br /><a class='smaller' href="search/adv">Recherche&nbsp;avancée</a>
-        {/min_auth}
+        {/if}
       </td>
     </tr>
   </table>
index cb38667..9781642 100644 (file)
@@ -50,7 +50,7 @@ En effet, le moteur de recherche va alors chercher tous les utilisateurs dont le
 sans distinction de casse et sans tenir compte des accents.
 </p>
 
-{min_auth level="cookie"}
+{if $smarty.session.auth ge AUTH_COOKIE}
 <h2>Barre de recherche pour Firefox</h2>
 <script type="text/javascript">
 {literal}
@@ -69,7 +69,7 @@ function addEngine() {
 </script>
 <p>Tu peux <a href="javascript:addEngine()">installer</a> la barre de recherche rapide directement dans ton navigateur.
 </p>
-{/min_auth}
+{/if}
 
 <h2>Polytechniciens des promotions 1919 et précédentes</h2>
 <p>Notre base de données ne contient que les polytechniciens depuis la promotion 1920. Pour effectuer des recherches dans les
index 71aa3b1..ebfaa6c 100644 (file)
 <br />
   <a href="Docs/Ethique">Services et Ethique</a>
   | <a href="Docs/Charte">Charte</a>
-{min_auth level=cookie}
+{if $smarty.session.auth ge AUTH_COOKIE}
   | <a href="stats/coupures">Disponibilité</a>
   | <a href="stats">Statistiques</a>
-{/min_auth}
+{/if}
 </div>
 
 {* vim:set et sw=2 sts=2 sws=2: *}
index ec918a3..865e4c0 100644 (file)
@@ -20,7 +20,7 @@
 {*                                                                        *}
 {**************************************************************************}
 
-{only_public}
+{if !$smarty.session.auth}
 <div class="menu_title">Polytechniciens</div>
 <div class="menu_item"><a href="events">Me connecter !</a></div>
 <div class="menu_item"><a href="register">M'inscrire</a></div>
@@ -35,8 +35,7 @@
 <div class="menu_item"><a href="Docs/APropos">A propos du site</a></div>
 <div class="menu_item"><a href="Docs/NousContacter">Nous contacter</a></div>
 <div class="menu_item"><a href="Docs/FAQ">FAQ</a></div>
-
-{/only_public}
+{/if}
 
 {if $smarty.session.auth == AUTH_MDP}
 <div class="menu_item"><a href="exit">Déconnexion</a></div>
@@ -74,8 +73,7 @@
 <div class="menu_item"><a href="Docs/NousContacter">Nous contacter</a></div>
 <div class="menu_item"><a href="Docs/Emploi">Carrières</a></div>
 
-{perms level=admin}
-
+{if $smarty.session.perms eq admin}
 <div class="menu_title">***</div>
 <div class="menu_item"><a href="marketing">Marketing</a></div>
 <div class="menu_item"><a href="admin/">Administration</a></div>
@@ -89,6 +87,6 @@
     <td><a href="admin/valider.php">{insert name="mkStats"}</a></td>
   </tr>
 </table>
-{/perms}
+{/if}
 
 {* vim:set et sw=2 sts=2 sws=2: *}
index e181c2f..219f999 100644 (file)
@@ -22,9 +22,9 @@
 
 <h1>Tr&eacute;sorerie pour {$mon_sel}</h1>
 
-{perms level=admin}
+{if $smarty.session.perms eq admin}
 <p>[<a href="trezo/ops">éditer les comptes</a>]</p>
-{/perms}
+{/if}
 
 <table class="bicol">
 <tr>
index 4e694ea..3ba34e0 100644 (file)
       <tr>
         <td colspan="4" id="perso">
           {list_all_my_groups}
-          {only_public}
+          {if !$smarty.session.auth}
           <div>Me connecter :</div>
           <a class='gp' href="{$smarty.session.loginX}">polytechnicien</a>
-          {/only_public}
+          {/if}
 
           <a href="manuel" title="Manuel d'aide en ligne" style="float: right"><img src="images/manuel.png" alt="manuel" /></a>
         </td>