0337d704 |
1 | {**************************************************************************} |
2 | {* *} |
50a40a33 |
3 | {* Copyright (C) 2003-2006 Polytechnique.org *} |
0337d704 |
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} |
f81d9dad |
36 | <form method="post" action="admin/user"> |
0337d704 |
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} |
40 | <input type="submit" name="u_kill" value="continuer" /> |
41 | </div> |
42 | </form> |
43 | {else} |
44 | |
f81d9dad |
45 | <form method="post" action="admin/user"> |
0337d704 |
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 " /> |
68 | <input type="submit" name="suid_button" value=" su " /> |
69 | <input type="submit" name="ax_button" value=" AX " /> |
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() { |
46bde4d1 |
87 | document.forms.auth.hashpass.value = hash_encrypt(document.forms.edit.password.value); |
0337d704 |
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 | } |
8ffa657a |
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 | } |
0337d704 |
108 | // ]]> |
109 | </script> |
110 | {/literal} |
111 | |
f81d9dad |
112 | <form id="auth" method="post" action="admin/user"> |
0337d704 |
113 | <table cellspacing="0" cellpadding="2" class="tinybicol"> |
114 | <tr> |
f97f90f0 |
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> |
0337d704 |
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"> |
d2958bcf |
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"> |
0337d704 |
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> |
3c1e6a1e |
183 | {if $mr.perms neq 'pending'} |
0337d704 |
184 | <tr class="pair"> |
185 | <td class="titre"> |
3c1e6a1e |
186 | {if $mr.naiss_err}<span class="erreur">{/if} |
0337d704 |
187 | Date de naissance |
3c1e6a1e |
188 | {if $mr.naiss_err}</span>{/if} |
0337d704 |
189 | </td> |
190 | <td> |
191 | <input type="text" name="naissanceN" size="12" maxlength="10" value="{$mr.naissance}" /> |
3c1e6a1e |
192 | {if $mr.naiss_err}<span class="erreur smaller">({icon name=error}Date de naissance incohérente)</span>{/if} |
0337d704 |
193 | </td> |
194 | </tr> |
3c1e6a1e |
195 | {/if} |
0337d704 |
196 | <tr class="pair"> |
197 | <td class="titre"> |
34ffe99a |
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"> |
0337d704 |
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> |
f97f90f0 |
220 | {if $mr.perms eq 'pending'} |
221 | <tr class="center"> |
222 | <td colspan="2"> |
3c1e6a1e |
223 | <input type="hidden" name="naissanceN" value="{$mr.naissance}" /> |
f97f90f0 |
224 | <input onclick="doEditUser(); return true;" type="submit" name="u_edit" value="UPDATE" /> |
225 | </td> |
226 | </tr> |
227 | {else} |
0337d704 |
228 | <tr class="center"> |
229 | <td> |
7b2413f6 |
230 | <a href="profile/{$mr.forlife}" class="popup2">[Voir fiche]</a> |
0337d704 |
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> |
86f0a6af |
238 | <a href="admin/trombino/{$mr.user_id}">[Trombino]</a> |
0337d704 |
239 | </td> |
240 | <td> |
241 | <input type="submit" name="u_kill_conf" value="Désinscrire" /> |
242 | </td> |
243 | </tr> |
f97f90f0 |
244 | {/if} |
0337d704 |
245 | </table> |
246 | </form> |
f97f90f0 |
247 | {if $mr.perms neq 'pending'} |
0337d704 |
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> |
f81d9dad |
252 | <form id="alias" method="post" action="admin/user"> |
0337d704 |
253 | <table class="tinybicol" cellpadding="2" cellspacing="0"> |
254 | <tr> |
5c5554b7 |
255 | <th class="alias" colspan="3"> |
0337d704 |
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()" /> |
5c5554b7 |
263 | </td> |
264 | <td> |
0337d704 |
265 | {if $a.for_life}<strong>{$a.alias}</strong>{else}{$a.alias}{/if} |
266 | {if $a.expire}<span class='erreur'>(expire le {$a.expire|date_format})</span>{/if} |
267 | </td> |
268 | {if $a.for_life} |
269 | <td>garanti à vie*</td> |
270 | {else} |
271 | <td class="action"> |
272 | <a href="javascript:del_alias('{$a.alias}')">delete</a> |
273 | </td> |
274 | {/if} |
275 | </tr> |
276 | {/iterate} |
5c5554b7 |
277 | {if $virtual} |
278 | <tr class="{cycle values="impair,pair"}"> |
279 | <td></td> |
280 | <td>{$virtual}</td> |
281 | <td></td> |
282 | </tr> |
283 | {/if} |
0337d704 |
284 | <tr class="{cycle values="impair,pair"}"> |
5c5554b7 |
285 | <td colspan="2" class="detail"> |
0337d704 |
286 | <input type="text" name="email" size="29" maxlength="60" value="" /> |
287 | </td> |
288 | <td class="action"> |
289 | <input type="hidden" name="user_id" value="{$mr.user_id}" /> |
290 | <input type="hidden" name="del_alias" value="" /> |
291 | <input type="submit" name="add_alias" value="Ajouter" /> |
292 | </td> |
293 | </tr> |
294 | </table> |
295 | </form> |
296 | |
297 | <p> |
298 | <strong>* à ne modifier qu'avec l'accord express de l'utilisateur !!!</strong> |
299 | </p> |
300 | |
f81d9dad |
301 | <form id="fwds" method="post" action="admin/user#fwds"> |
0337d704 |
302 | <table class="bicol" cellpadding="2" cellspacing="0"> |
303 | <tr> |
8ffa657a |
304 | <th colspan="4"> |
0337d704 |
305 | Redirections |
306 | </th> |
307 | </tr> |
308 | {foreach item=mail from=$emails} |
2069538b |
309 | {cycle assign=class values="impair,pair"} |
310 | <tr class="{$class}"> |
0337d704 |
311 | <td class="titre"> |
312 | {if $mail->active}active{/if} |
313 | </td> |
314 | <td> |
dc557110 |
315 | <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> |
8ffa657a |
316 | </td> |
317 | <td> |
dc557110 |
318 | {if $mail->broken}<span style="color: #f00">{/if} |
0337d704 |
319 | {$mail->email} |
dc557110 |
320 | {if $mail->broken}<em> (en panne)</em></span>{/if} |
0337d704 |
321 | </td> |
322 | <td class="action"> |
323 | <a href="javascript:del_fwd('{$mail->email}')">delete</a> |
324 | </td> |
325 | </tr> |
2069538b |
326 | {if $mail->panne && $mail->panne neq "0000-00-00"} |
327 | <tr class="{$class}"> |
328 | <td colspan="4" class="smaller" style="color: #f00"> |
329 | {icon name=error title="Panne"} |
330 | Panne de {$mail->email} le {$mail->panne|date_format} |
331 | {if $mail->panne neq $mail->last}confirmée le {$mail->last|date_format}{/if} |
332 | </td> |
333 | </tr> |
334 | {/if} |
0337d704 |
335 | {/foreach} |
2069538b |
336 | <tr class="{cycle values="impair,pair"}"> |
8ffa657a |
337 | <td class="titre" colspan="2"> |
0337d704 |
338 | Ajouter un email |
339 | </td> |
340 | <td> |
341 | <input type="text" name="email" size="29" maxlength="60" value="" /> |
342 | </td> |
343 | <td class="action"> |
344 | <input type="hidden" name="user_id" value="{$mr.user_id}" /> |
345 | <input type="hidden" name="del_fwd" value="" /> |
8ffa657a |
346 | <input type="hidden" name="activate_fwd" value="" /> |
347 | <input type="hidden" name="deactivate_fwd" value="" /> |
0337d704 |
348 | <input type="submit" name="add_fwd" value="Ajouter" /> |
349 | </td> |
350 | </tr> |
351 | </table> |
352 | </form> |
353 | |
0337d704 |
354 | {/if} |
355 | {/if} |
f97f90f0 |
356 | {/if} |
0337d704 |
357 | |
358 | {* vim:set et sw=2 sts=2 sws=2: *} |