migration d'admin
[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/users">
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/users">
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/users">
113   <table cellspacing="0" cellpadding="2" class="tinybicol">
114     <tr>
115       <th>
116         UID et Matricule
117       </th>
118       <th>
119         {$mr.user_id} / {$mr.matricule}
120         <input type="hidden" name="user_id" value="{$mr.user_id}" />
121       </th>
122     </tr>
123     <tr class="pair">
124       <td class="titre">
125         Mot de passe
126       </td>
127       <td>
128         <input type="text" name="newpass_clair" size="10" maxlength="10" value="********" />
129         <input type="hidden" name="passw" size="32" maxlength="32" value="{$mr.password}" />
130         <input type="hidden" name="hashpass" value="" />
131       </td>
132     </tr>
133     <tr class="pair">
134       <td class="titre">
135         Nom
136       </td>
137       <td>
138         <input type="text" name="nomN" size="20" maxlength="255" value="{$mr.nom}" />
139       </td>
140     </tr>
141     <tr class="pair">
142       <td class="titre">
143         Nom d'usage
144       </td>
145       <td>
146         <input type="text" name="nomusageN" size="20" maxlength="255" value="{$mr.nom_usage}" />
147       </td>
148     </tr>
149     <tr class="pair">
150       <td class="titre">
151         Prénom
152       </td>
153       <td>
154         <input type="text" name="prenomN" size="20" maxlength="30" value="{$mr.prenom}" />
155       </td>
156     </tr>
157     <tr class="pair">
158       <td class="titre">
159         Sexe
160       </td>
161       <td>
162         femme <input type="radio" name="sexeN" {if $mr.sexe eq 'femme'}checked="checked"{/if} value='femme'/>
163         <input type="radio" name="sexeN" {if $mr.sexe neq 'femme'}checked="checked"{/if} value=''/> homme
164       </td>
165     </tr>
166     <tr class="pair">
167       <td class="titre">
168         Droits
169       </td>
170       <td>
171         <select name="permsN">
172           <option value="user" {if $mr.perms eq "user"}selected="selected"{/if}>user</option>
173           <option value="admin" {if $mr.perms eq "admin"}selected="selected"{/if}>admin</option>
174           <option value="pending" {if $mr.perms eq "pending"}selected="selected"{/if}>pending</option>
175           <option value="disabled" {if $mr.perms eq "disabled"}selected="selected"{/if}>disabled</option>
176         </select>
177       </td>
178     </tr>
179     <tr class="pair">
180       <td class="titre">
181         Date de naissance
182       </td>
183       <td>
184         <input type="text" name="naissanceN" size="12" maxlength="10" value="{$mr.naissance}" />
185       </td>
186     </tr>
187     <tr class="pair">
188       <td class="titre">
189         Promo
190       </td>
191       <td>
192         <input type="text" name="promoN" size="4" maxlength="4" value="{$mr.promo}" />
193       </td>
194     </tr>
195     <tr class="impair">
196       <td class="titre">
197         Commentaire
198       </td>
199       <td>
200         <input type="text" name="commentN" size="40" maxlength="64" value="{$mr.comment}" />
201       </td>
202     </tr>
203     <tr class="center">
204       <td>
205         <a href="profile/{$mr.forlife}" class="popup2">[Voir fiche]</a>
206       </td>
207       <td>
208         <input onclick="doEditUser(); return true;" type="submit" name="u_edit" value="UPDATE" />
209       </td>
210     </tr>
211     <tr class="center">
212       <td>
213         <a href="admin/trombino/{$mr.user_id}">[Trombino]</a>
214       </td>
215       <td>
216         <input type="submit" name="u_kill_conf" value="Désinscrire" />
217       </td>
218     </tr>
219   </table>
220 </form>
221 <p>
222 Ne pas utiliser [Désinscrire] si le but est d'exclure la personne.
223 Pour ceci changer ses permissions en 'disabled'.
224 </p>
225 <form id="alias" method="post" action="admin/users">
226   <table class="tinybicol" cellpadding="2" cellspacing="0">
227     <tr>
228       <th class="alias" colspan="2">
229         Alias e-mail
230       </th>
231     </tr>
232     {iterate from=$aliases item=a}
233     <tr class="{cycle values="impair,pair"}">
234       <td>
235         <input type="radio" name='best' {if $a.best}checked="checked"{/if} value='{$a.alias}' onclick="this.form.submit()" />
236         {if $a.for_life}<strong>{$a.alias}</strong>{else}{$a.alias}{/if}
237         {if $a.expire}<span class='erreur'>(expire le {$a.expire|date_format})</span>{/if}
238       </td>
239       {if $a.for_life}
240       <td>garanti à vie*</td>
241       {else}
242       <td class="action">
243         <a href="javascript:del_alias('{$a.alias}')">delete</a>
244       </td>
245       {/if}
246     </tr>
247     {/iterate}
248     <tr class="{cycle values="impair,pair"}">
249       <td class="detail">
250         <input type="text" name="email" size="29" maxlength="60" value="" />
251       </td>
252       <td class="action">
253         <input type="hidden" name="user_id" value="{$mr.user_id}" />
254         <input type="hidden" name="del_alias" value="" />
255         <input type="submit" name="add_alias" value="Ajouter" />
256       </td>
257     </tr>
258   </table>
259 </form>
260
261 <p>
262 <strong>* à ne modifier qu'avec l'accord express de l'utilisateur !!!</strong>
263 </p>
264
265 <form id="fwds" method="post" action="admin/users#fwds">
266   <table class="bicol" cellpadding="2" cellspacing="0">
267     <tr>
268       <th colspan="4">
269         Redirections
270       </th>
271     </tr>
272     {foreach item=mail from=$emails}
273     <tr>
274       <td class="titre">
275         {if $mail->active}active{/if}
276       </td>
277       <td>
278         <span class="smaller"><a href="javascript:act_fwd('{$mail->email}',{if $mail->active}false{else}true{/if})">{if $mail->active}des{/if}activer</a></span>
279       </td>
280       <td>
281         {$mail->email}
282       </td>
283       <td class="action">
284         <a href="javascript:del_fwd('{$mail->email}')">delete</a>
285       </td>
286     </tr>
287     {/foreach}
288     <tr>
289       <td class="titre" colspan="2">
290         Ajouter un email
291       </td>
292       <td>
293         <input type="text" name="email" size="29" maxlength="60" value="" />
294       </td>
295       <td class="action">
296         <input type="hidden" name="user_id" value="{$mr.user_id}" />
297         <input type="hidden" name="del_fwd" value="" />
298         <input type="hidden" name="activate_fwd" value="" />
299         <input type="hidden" name="deactivate_fwd" value="" />
300         <input type="submit" name="add_fwd" value="Ajouter" />
301       </td>
302     </tr>
303   </table>
304 </form>
305
306 {foreach from=$emails item=mail}
307 {if $email->panne && $email->panne neq "0000-00-00"}
308 <p class="erreur">
309 Panne pour l'email "{$mail->email}" le {$mail->panne|date_format}
310 </p>
311 {/if}
312 {/foreach}
313 {/if}
314 {/if}
315
316 {* vim:set et sw=2 sts=2 sws=2: *}