$globals->menu->addPrivateEntry(XOM_CUSTOM, 20, 'Mes contacts', 'carnet/mescontacts.php');
$globals->menu->addPrivateEntry(XOM_CUSTOM, 30, 'Mon carnet', 'carnet/');
$globals->menu->addPrivateEntry(XOM_CUSTOM, 40, 'Mon mot de passe', 'password');
- $globals->menu->addPrivateEntry(XOM_CUSTOM, 50, 'Mes préférences', 'preferences');
+ $globals->menu->addPrivateEntry(XOM_CUSTOM, 50, 'Mes préférences', 'prefs');
$globals->menu->addPrivateEntry(XOM_GROUPS, 10, 'Trombi/Site promo', 'trombipromo.php');
$globals->menu->addPrivateEntry(XOM_GROUPS, 20, 'Conseil Pro.', 'referent.php');
$fmt2 = Session::get('mail_fmt', 'html') == 'html' ? 'texte' : 'HTML';
return Array(
Array(
- 'url' => 'preferences?mail_fmt='.$fmt,
+ 'url' => 'prefs?mail_fmt='.$fmt,
'title' => 'Recevoir les mails en format '.$fmt2,
'text' => 'Tu recois les mails envoyés par le site (lettre mensuelle, carnet, ...) de préférence <strong>sous forme de '
.Session::get('mail_fmt', 'html').'</strong>',
'weight' => 80
),
Array(
- 'url' => 'preferences?rss='.(intval(Session::get('core_rss_hash')=='')),
+ 'url' => 'prefs?rss='.(intval(Session::get('core_rss_hash')=='')),
'title' => (Session::get('core_rss_hash') ? 'Désactiver' : 'Activer').' les fils rss',
'text' => 'Ceci te permet d\'utiliser les fils rss du site. Attention, désactiver puis réactiver les fils en change les URL !',
'weight' => 90
+++ /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 *
- ***************************************************************************/
-
-require_once("xorg.inc.php");
-new_skinned_page('filrss.tpl',AUTH_MDP);
-
-if (Env::has('referer')) {
- $param = Env::get('referer');
- $page->assign('goback',$param);
-}
-
-if (Env::has('referer')) {
- $act = Env::get('act_rss');
- if ($act == 'Activer') {
- $page->trig("Ton Fil RSS est activé.");
- $_SESSION['core_rss_hash'] = rand_url_id(16);
- $globals->xdb->execute('UPDATE auth_user_quick SET core_rss_hash={?} WHERE user_id={?}',
- Session::get('core_rss_hash'), Session::getInt('uid'));
- }
-}
-
-if (Session::get('core_rss_hash')) {
- $page->assign('rsshash','oui');
-}
-
-$page->run();
-
-// vim:set et sws=4 sw=4 sts=4:
-?>
function handlers()
{
return array(
- 'preferences' => $this->make_hook('prefs', AUTH_COOKIE),
+ 'prefs' => $this->make_hook('prefs', AUTH_COOKIE),
+ 'prefs/rss' => $this->make_hook('rss', AUTH_COOKIE),
'password' => $this->make_hook('password', AUTH_MDP),
'tmpPWD' => $this->make_hook('tmpPWD', AUTH_PUBLIC),
'skin' => $this->make_hook('skin', AUTH_COOKIE),
);
}
+ function __set_rss_state($state)
+ {
+ global $globals;
+
+ if ($state) {
+ $_SESSION['core_rss_hash'] = rand_url_id(16);
+ $globals->xdb->execute('UPDATE auth_user_quick
+ SET core_rss_hash={?} WHERE user_id={?}',
+ Session::get('core_rss_hash'),
+ Session::getInt('uid'));
+ } else {
+ $globals->xdb->execute('UPDATE auth_user_quick
+ SET core_rss_hash="" WHERE user_id={?}',
+ Session::getInt('uid'));
+ Session::kill('core_rss_hash');
+ }
+ }
+
function handler_prefs(&$page)
{
global $globals;
}
if (Env::has('rss')) {
- if (Env::getBool('rss')) {
- $_SESSION['core_rss_hash'] = rand_url_id(16);
- $globals->xdb->execute('UPDATE auth_user_quick
- SET core_rss_hash={?} WHERE user_id={?}',
- Session::get('core_rss_hash'),
- Session::getInt('uid'));
- } else {
- $globals->xdb->execute('UPDATE auth_user_quick
- SET core_rss_hash="" WHERE user_id={?}',
- Session::getInt('uid'));
- Session::kill('core_rss_hash');
- }
- redirect('preferences');
+ $this->__set_rss_state(Env::getBool('rss'));
}
$page->assign('prefs', $globals->hook->prefs());
return PL_OK;
}
+ function handler_rss(&$page)
+ {
+ global $globals;
+
+ $page->changeTpl('filrss.tpl');
+
+ $page->assign('goback', Env::get('referer', 'login'));
+
+ if (Env::get('act_rss') == 'Activer') {
+ $this->__set_rss_state(true);
+ $page->trig("Ton Fil RSS est activé.");
+ }
+
+ return PL_OK;
+ }
+
function handler_password(&$page)
{
global $globals;
</div>
{else}
<div class="right">
- <a href='{rel}/filrss.php?referer={$refe}'><img src='{rel}/images/rssact.gif' alt='fil rss' /></a>
+ <a href='{rel}/prefs/rss/?referer=carnet/index.php'><img src='{rel}/images/rssact.gif' alt='fil rss' /></a>
</div>
{/if}
</div>
<h1>Fil RSS</h1>
-{if !$rsshash }
+{if !$smarty.session.core_rss_hash}
Tu viens de cliquer sur le lien d'activation des fils RSS. Les fils RSS du site <br/>
ne sont pas activés dans tes préférences.
<ul>
</li>
</ul>
-<form method="get" action="{$goback}">
+<form method="get" action="{rel}/{$goback}">
<div>
<input type="hidden" name="referer" value="{$goback}" />
- <input type="submit" name="" value="Retour" />
- <input type="submit" name="act_rss" value="Activer" onclick="this.form.action='filrss.php'" />
+ <input type="submit" value="Retour" />
+ <input type="submit" name="act_rss" value="Activer" onclick="this.form.action='{rel}/prefs/rss'" />
</div>
</form>
<p>
Attention: désactiver, puis réactiver le fil RSS en change l'adresse.
</p>
-<p>[<a href="{$goback}">retour à la page dont tu venais</a>]</p>
+<p>[<a href="{rel}/{$goback}">retour à la page dont tu venais</a>]</p>
{/if}
{* vim:set et sw=2 sts=2 sws=2: *}
</div>
{else}
<div class="right">
- <a href='{rel}/filrss.php?referer={$refe}'><img src='{rel}/images/rssact.gif' alt='fil rss' /></a>
+ <a href='{rel}/prefs/rss?referer=login.php'><img src='{rel}/images/rssact.gif' alt='fil rss' /></a>
</div>
{/if}
{/if}