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');
+++ /dev/null
-<?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;
-}
-?>
+++ /dev/null
-<?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;
-}
-?>
+++ /dev/null
-<?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;
-}
-?>
<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}
{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}•{/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}">{*
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>
{/if}
<a href="http://www.polytechniciens.com/index.php?page=AX_FICHE_ANCIEN&anc_id={$c.matricule_ax}">{*
*}<img src="images/ax.png" alt='AX' title="fiche AX" /></a>
- {/perms}
+ {/if}
</div>
<div class="long">
{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}">
<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>
paramètres personnels.</a></strong>
</li>
</ul>
-{/only_public}
+{/if}
<br />
<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}
{/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}
<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}
<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 avancée</a>
- {/min_auth}
+ {/if}
</td>
</tr>
</table>
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}
</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
<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: *}
{* *}
{**************************************************************************}
-{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>
<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>
<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>
<td><a href="admin/valider.php">{insert name="mkStats"}</a></td>
</tr>
</table>
-{/perms}
+{/if}
{* vim:set et sw=2 sts=2 sws=2: *}
<h1>Tré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>
<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>