Integrate payment directly in Xnet
[platal.git] / templates / admin / utilisateurs.tpl
1 {**************************************************************************}
2 {*                                                                        *}
3 {*  Copyright (C) 2003-2006 Polytechnique.org                             *}
4 {*  http://opensource.polytechnique.org/                                  *}
5 {*                                                                        *}
6 {*  This program is free software; you can redistribute it and/or modify  *}
7 {*  it under the terms of the GNU General Public License as published by  *}
8 {*  the Free Software Foundation; either version 2 of the License, or     *}
9 {*  (at your option) any later version.                                   *}
10 {*                                                                        *}
11 {*  This program is distributed in the hope that it will be useful,       *}
12 {*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *}
13 {*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *}
14 {*  GNU General Public License for more details.                          *}
15 {*                                                                        *}
16 {*  You should have received a copy of the GNU General Public License     *}
17 {*  along with this program; if not, write to the Free Software           *}
18 {*  Foundation, Inc.,                                                     *}
19 {*  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA               *}
20 {*                                                                        *}
21 {**************************************************************************}
22
23
24 {if $smarty.session.suid}
25 <p class="erreur">
26 Attention, déjà en SUID !!!
27 </p>
28 {/if}
29
30 <h1>
31   Gestion des utilisateurs
32 </h1>
33
34
35 {if $smarty.post.u_kill_conf}
36 <form method="post" action="admin/user">
37   <div class="center">
38     <input type="hidden" name="user_id" value="{$smarty.request.user_id}" />
39     Confirmer la suppression de {$smarty.request.user_id}&nbsp;&nbsp;
40     <input type="submit" name="u_kill" value="continuer" />
41   </div>
42 </form>
43 {else}
44
45 <form method="post" action="admin/user">
46   <table class="tinybicol" cellspacing="0" cellpadding="2">
47     <tr>
48       <th>
49         Administrer
50       </th>
51     </tr>
52     {if !$smarty.request.login && !$mr.forlife}
53     <tr class="pair">
54       <td class="center">
55         Il est possible d'entrer ici n'importe quelle adresse mail : redirection, melix, ou alias.
56       </td>
57     </tr>
58     {/if}
59     <tr>
60       <td class="center">
61         <input type="text" name="login" size="40" maxlength="255" value="{$smarty.request.login|default:$mr.forlife}" />
62       </td>
63     </tr>
64     <tr>
65       <td class="center">
66         <input type="hidden" name="hashpass" value="" />
67         <input type="submit" name="select" value=" edit " /> &nbsp;&nbsp;
68         <input type="submit" name="suid_button" value=" su " />  &nbsp;&nbsp;
69         <input type="submit" name="ax_button" value=" AX " /> &nbsp;&nbsp;
70         <input type="submit" name="logs_button" value=" logs " />
71       </td>
72     </tr>
73   </table>
74 </form>
75
76 {if $mr}
77
78 <p class="smaller">
79 Derniére connexion le <strong>{$lastlogin|date_format:"%d %B %Y, %T"}</strong>
80 depuis <strong>{$host}</strong>
81 </p>
82
83 {literal}
84 <script type="text/javascript">
85 //<![CDATA[
86 function doEditUser() {
87   document.forms.auth.hashpass.value = hash_encrypt(document.forms.edit.password.value);
88   document.forms.auth.password.value = "";
89   document.forms.auth.submit();
90 }
91
92 function del_alias(alias) {
93   document.forms.alias.del_alias.value = alias;
94   document.forms.alias.submit();
95 }
96
97 function del_fwd(fwd) {
98   document.forms.fwds.del_fwd.value = fwd;
99   document.forms.fwds.submit();
100 }
101 function act_fwd(fwd, activate) {
102   if (activate)
103     document.forms.fwds.activate_fwd.value = fwd;
104   else
105     document.forms.fwds.deactivate_fwd.value = fwd;
106   document.forms.fwds.submit();
107 }
108 // ]]>
109 </script>
110 {/literal}
111
112 <form id="auth" method="post" action="admin/user">
113   <table cellspacing="0" cellpadding="2" class="tinybicol">
114     <tr>
115       <th colspan="2">
116         <div style="float: right; text-align: right">
117           Matricule = {$mr.matricule}<br />
118           Matricule AX = {$mr.matricule_ax}
119         </div>
120         <div style="float: left; text-align: left">
121           UID = {$mr.user_id}<br />
122           Inscription = {$mr.date_ins|date_format}
123         </div>
124         <input type="hidden" name="user_id" value="{$mr.user_id}" />
125       </th>
126     </tr>
127     <tr class="pair">
128       <td class="titre">
129         Mot de passe
130       </td>
131       <td>
132         <input type="text" name="newpass_clair" size="10" maxlength="10" value="********" />
133         <input type="hidden" name="passw" size="32" maxlength="32" value="{$mr.password}" />
134         <input type="hidden" name="hashpass" value="" />
135       </td>
136     </tr>
137     <tr class="pair">
138       <td class="titre">
139         Nom
140       </td>
141       <td>
142         <input type="text" name="nomN" size="20" maxlength="255" value="{$mr.nom}" />
143       </td>
144     </tr>
145     <tr class="pair">
146       <td class="titre">
147         Nom d'usage
148       </td>
149       <td>
150         <input type="text" name="nomusageN" size="20" maxlength="255" value="{$mr.nom_usage}" />
151       </td>
152     </tr>
153     <tr class="pair">
154       <td class="titre">
155         Prénom
156       </td>
157       <td>
158         <input type="text" name="prenomN" size="20" maxlength="30" value="{$mr.prenom}" />
159       </td>
160     </tr>
161     <tr class="pair">
162       <td class="titre">
163         Sexe
164       </td>
165       <td>
166         femme <input type="radio" name="sexeN" {if $mr.sexe eq 'femme'}checked="checked"{/if} value='femme'/>
167         <input type="radio" name="sexeN" {if $mr.sexe neq 'femme'}checked="checked"{/if} value=''/> homme
168       </td>
169     </tr>
170     <tr class="pair">
171       <td class="titre">
172         Droits
173       </td>
174       <td>
175         <select name="permsN">
176           <option value="user" {if $mr.perms eq "user"}selected="selected"{/if}>user</option>
177           <option value="admin" {if $mr.perms eq "admin"}selected="selected"{/if}>admin</option>
178           <option value="pending" {if $mr.perms eq "pending"}selected="selected"{/if}>pending</option>
179           <option value="disabled" {if $mr.perms eq "disabled"}selected="selected"{/if}>disabled</option>
180         </select>
181       </td>
182     </tr>
183     {if $mr.perms neq 'pending'}
184     <tr class="pair">
185       <td class="titre">
186         {if $mr.naiss_err}<span class="erreur">{/if}
187         Date de naissance
188         {if $mr.naiss_err}</span>{/if}
189       </td>
190       <td>
191         <input type="text" name="naissanceN" size="12" maxlength="10" value="{$mr.naissance}" />
192         {if $mr.naiss_err}<span class="erreur smaller">({icon name=error}Date de naissance incohérente)</span>{/if}
193       </td>
194     </tr>
195     {/if}
196     <tr class="pair">
197       <td class="titre">
198         Date de décès
199       </td>
200       <td>
201         <input type="text" name="decesN" size="12" maxlength="10" value="{$mr.deces}" />
202       </td>
203     </tr>
204     <tr class="pair">
205       <td class="titre">
206         Promo
207       </td>
208       <td>
209         <input type="text" name="promoN" size="4" maxlength="4" value="{$mr.promo}" />
210       </td>
211     </tr>
212     <tr class="impair">
213       <td class="titre">
214         Commentaire
215       </td>
216       <td>
217         <input type="text" name="commentN" size="40" maxlength="64" value="{$mr.comment}" />
218       </td>
219     </tr>
220     {if $mr.perms eq 'pending'}
221     <tr class="center">
222       <td colspan="2">
223         <input type="hidden" name="naissanceN" value="{$mr.naissance}" />
224         <input onclick="doEditUser(); return true;" type="submit" name="u_edit" value="UPDATE" />
225       </td>
226     </tr>
227     {else}
228     <tr class="center">
229       <td>
230         <a href="profile/{$mr.forlife}" class="popup2">[Voir fiche]</a>
231       </td>
232       <td>
233         <input onclick="doEditUser(); return true;" type="submit" name="u_edit" value="UPDATE" />
234       </td>
235     </tr>
236     <tr class="center">
237       <td>
238         <a href="admin/trombino/{$mr.user_id}">[Trombino]</a>
239       </td>
240       <td>
241         <input type="submit" name="u_kill_conf" value="Désinscrire" />
242       </td>
243     </tr>
244     {/if}
245   </table>
246 </form>
247 {if $mr.perms neq 'pending'}
248 <p>
249 Ne pas utiliser [Désinscrire] si le but est d'exclure la personne.
250 Pour ceci changer ses permissions en 'disabled'.
251 </p>
252 <form id="alias" method="post" action="admin/user">
253   <table class="tinybicol" cellpadding="2" cellspacing="0">
254     <tr>
255       <th class="alias" colspan="2">
256         Alias e-mail
257       </th>
258     </tr>
259     {iterate from=$aliases item=a}
260     <tr class="{cycle values="impair,pair"}">
261       <td>
262         <input type="radio" name='best' {if $a.best}checked="checked"{/if} value='{$a.alias}' onclick="this.form.submit()" />
263         {if $a.for_life}<strong>{$a.alias}</strong>{else}{$a.alias}{/if}
264         {if $a.expire}<span class='erreur'>(expire le {$a.expire|date_format})</span>{/if}
265       </td>
266       {if $a.for_life}
267       <td>garanti à vie*</td>
268       {else}
269       <td class="action">
270         <a href="javascript:del_alias('{$a.alias}')">delete</a>
271       </td>
272       {/if}
273     </tr>
274     {/iterate}
275     <tr class="{cycle values="impair,pair"}">
276       <td class="detail">
277         <input type="text" name="email" size="29" maxlength="60" value="" />
278       </td>
279       <td class="action">
280         <input type="hidden" name="user_id" value="{$mr.user_id}" />
281         <input type="hidden" name="del_alias" value="" />
282         <input type="submit" name="add_alias" value="Ajouter" />
283       </td>
284     </tr>
285   </table>
286 </form>
287
288 <p>
289 <strong>* à ne modifier qu'avec l'accord express de l'utilisateur !!!</strong>
290 </p>
291
292 <form id="fwds" method="post" action="admin/user#fwds">
293   <table class="bicol" cellpadding="2" cellspacing="0">
294     <tr>
295       <th colspan="4">
296         Redirections
297       </th>
298     </tr>
299     {foreach item=mail from=$emails}
300     {cycle assign=class values="impair,pair"}
301     <tr class="{$class}">
302       <td class="titre">
303         {if $mail->active}active{/if}
304       </td>
305       <td>
306         <span class="smaller"><a href="javascript:act_fwd('{$mail->email}',{if $mail->active}false{else}true{/if})">{if $mail->active}des{elseif $mail->broken}ré{/if}activer</a></span>
307       </td>
308       <td>
309         {if $mail->broken}<span style="color: #f00">{/if}
310         {$mail->email}
311         {if $mail->broken}<em> (en panne)</em></span>{/if}
312       </td>
313       <td class="action">
314         <a href="javascript:del_fwd('{$mail->email}')">delete</a>
315       </td>
316     </tr>
317     {if $mail->panne && $mail->panne neq "0000-00-00"}
318     <tr class="{$class}">
319       <td colspan="4" class="smaller" style="color: #f00">
320         {icon name=error title="Panne"}
321         Panne de {$mail->email} le {$mail->panne|date_format}
322         {if $mail->panne neq $mail->last}confirmée le {$mail->last|date_format}{/if}
323       </td>
324     </tr>
325     {/if}
326     {/foreach}
327     <tr class="{cycle values="impair,pair"}">
328       <td class="titre" colspan="2">
329         Ajouter un email
330       </td>
331       <td>
332         <input type="text" name="email" size="29" maxlength="60" value="" />
333       </td>
334       <td class="action">
335         <input type="hidden" name="user_id" value="{$mr.user_id}" />
336         <input type="hidden" name="del_fwd" value="" />
337         <input type="hidden" name="activate_fwd" value="" />
338         <input type="hidden" name="deactivate_fwd" value="" />
339         <input type="submit" name="add_fwd" value="Ajouter" />
340       </td>
341     </tr>
342   </table>
343 </form>
344
345 {/if}
346 {/if}
347 {/if}
348
349 {* vim:set et sw=2 sts=2 sws=2: *}