+++ /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");
-require_once("validations.inc.php");
-require_once("xorg.misc.inc.php");
-
-new_skinned_page('nomusage.tpl', AUTH_MDP);
-
-$res = $globals->xdb->query(
- "SELECT u.nom,u.nom_usage,u.flags,e.alias
- FROM auth_user_md5 AS u
- LEFT JOIN aliases AS e ON(u.user_id = e.id AND FIND_IN_SET('usage',e.flags))
- WHERE user_id={?}", Session::getInt('uid'));
-
-list($nom,$usage_old,$flags,$alias_old) = $res->fetchOneRow();
-$flags = new flagset($flags);
-$page->assign('usage_old', $usage_old);
-$page->assign('alias_old', $alias_old);
-
-$nom_usage = replace_accent(trim(Env::get('nom_usage')));
-$nom_usage = strtoupper($nom_usage);
-$page->assign('usage_req', $nom_usage);
-
-if (Env::has('submit') && ($nom_usage != $usage_old)) {
- // on vient de recevoir une requete, differente de l'ancien nom d'usage
- if ($nom_usage == $nom) {
- $page->assign('same', true);
- } else { // le nom de mariage est distinct du nom à l'X
- // on calcule l'alias pour l'afficher
- $reason = Env::get('reason');
- if ($reason == 'other')
- $reason = Env::get('other_reason');
- $myusage = new UsageReq(Session::getInt('uid'), $nom_usage, $reason);
- $myusage->submit();
- $page->assign('myusage', $myusage);
- }
-}
-
-$page->run();
-?>
function handlers()
{
return array(
- 'photo' => $this->make_hook('photo', AUTH_PUBLIC),
- 'photo/change' => $this->make_hook('photo_change', AUTH_MDP),
+ 'photo' => $this->make_hook('photo', AUTH_PUBLIC),
+ 'photo/change' => $this->make_hook('photo_change', AUTH_MDP),
- 'trombi' => $this->make_hook('trombi', AUTH_COOKIE),
+ 'profile/usage' => $this->make_hook('p_usage', AUTH_MDP),
- 'vcard' => $this->make_hook('vcard', AUTH_COOKIE),
+ 'trombi' => $this->make_hook('trombi', AUTH_COOKIE),
+
+ 'vcard' => $this->make_hook('vcard', AUTH_COOKIE),
);
}
return PL_OK;
}
+ function handler_p_usage(&$page)
+ {
+ global $globals;
+
+ $page->changeTpl('nomusage.tpl');
+
+ require_once 'validations.inc.php';
+ require_once 'xorg.misc.inc.php';
+
+ $res = $globals->xdb->query(
+ "SELECT u.nom,u.nom_usage,u.flags,e.alias
+ FROM auth_user_md5 AS u
+ LEFT JOIN aliases AS e ON(u.user_id = e.id AND FIND_IN_SET('usage',e.flags))
+ WHERE user_id={?}", Session::getInt('uid'));
+
+ list($nom,$usage_old,$flags,$alias_old) = $res->fetchOneRow();
+ $flags = new flagset($flags);
+ $page->assign('usage_old', $usage_old);
+ $page->assign('alias_old', $alias_old);
+
+ $nom_usage = replace_accent(trim(Env::get('nom_usage')));
+ $nom_usage = strtoupper($nom_usage);
+ $page->assign('usage_req', $nom_usage);
+
+ if (Env::has('submit') && ($nom_usage != $usage_old)) {
+ // on vient de recevoir une requete, differente de l'ancien nom d'usage
+ if ($nom_usage == $nom) {
+ $page->assign('same', true);
+ } else { // le nom de mariage est distinct du nom à l'X
+ // on calcule l'alias pour l'afficher
+ $reason = Env::get('reason');
+ if ($reason == 'other') {
+ $reason = Env::get('other_reason');
+ }
+ $myusage = new UsageReq(Session::getInt('uid'), $nom_usage, $reason);
+ $myusage->submit();
+ $page->assign('myusage', $myusage);
+ }
+ }
+
+ return PL_OK;
+ }
+
function handler_trombi(&$page, $promo = null)
{
require_once 'trombi.inc.php';
<br />
- <form action="{$smarty.server.PHP_SELF}" method="post">
+ <form action="{rel}/profile/usage" method="post">
<table class="bicol" cellpadding="4" summary="Nom d'usage">
<tr>
<th>Nom d'usage</th>
</td>
<td class="cold">
<span class="nom">{$nom_usage|default:"Aucun"}</span>
- <span class="lien"><a href="nomusage.php">modifier</a></span>
+ <span class="lien"><a href="{rel}/profile/usage">modifier</a></span>
</td>
</tr>
<tr>