Fix date_format behaviour with unix timestamps
[platal.git] / templates / admin / utilisateurs.tpl
CommitLineData
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">
26Attention, 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}&nbsp;&nbsp;
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 " /> &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">
79Derniére connexion le <strong>{$lastlogin|date_format:"%d %B %Y, %T"}</strong>
80depuis <strong>{$host}</strong>
81</p>
82
83{literal}
84<script type="text/javascript">
85//<![CDATA[
86function 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
92function del_alias(alias) {
93 document.forms.alias.del_alias.value = alias;
94 document.forms.alias.submit();
95}
96
97function del_fwd(fwd) {
98 document.forms.fwds.del_fwd.value = fwd;
99 document.forms.fwds.submit();
100}
8ffa657a 101function 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>
249Ne pas utiliser [Désinscrire] si le but est d'exclure la personne.
250Pour 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>
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
f81d9dad 292<form id="fwds" method="post" action="admin/user#fwds">
0337d704 293 <table class="bicol" cellpadding="2" cellspacing="0">
294 <tr>
8ffa657a 295 <th colspan="4">
0337d704 296 Redirections
297 </th>
298 </tr>
299 {foreach item=mail from=$emails}
2069538b 300 {cycle assign=class values="impair,pair"}
301 <tr class="{$class}">
0337d704 302 <td class="titre">
303 {if $mail->active}active{/if}
304 </td>
305 <td>
dc557110 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>
8ffa657a 307 </td>
308 <td>
dc557110 309 {if $mail->broken}<span style="color: #f00">{/if}
0337d704 310 {$mail->email}
dc557110 311 {if $mail->broken}<em> (en panne)</em></span>{/if}
0337d704 312 </td>
313 <td class="action">
314 <a href="javascript:del_fwd('{$mail->email}')">delete</a>
315 </td>
316 </tr>
2069538b 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}
0337d704 326 {/foreach}
2069538b 327 <tr class="{cycle values="impair,pair"}">
8ffa657a 328 <td class="titre" colspan="2">
0337d704 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="" />
8ffa657a 337 <input type="hidden" name="activate_fwd" value="" />
338 <input type="hidden" name="deactivate_fwd" value="" />
0337d704 339 <input type="submit" name="add_fwd" value="Ajouter" />
340 </td>
341 </tr>
342 </table>
343</form>
344
0337d704 345{/if}
346{/if}
f97f90f0 347{/if}
0337d704 348
349{* vim:set et sw=2 sts=2 sws=2: *}