Add the list of the groups of the user and the lists of the mailing lists
[platal.git] / templates / admin / user.tpl
CommitLineData
0337d704 1{**************************************************************************}
2{* *}
9f5bd98e 3{* Copyright (C) 2003-2010 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
40965e32
SJ
24{if t($smarty.post.delete_account)}
25<form method="post" action="admin/user/{$user->login()}">
e61326ed 26 {xsrf_token_field}
879d38da
FB
27 <fieldset>
28 <legend>Confirmer la suppression de l'utilisateur {$user->hruid}</legend>
29
30 {if $user->hasProfile()}
31 <p>
32 <input type="checkbox" name="clear_profile" /> Vider la fiche de
33 l'utilisateur.
34 </p>
35 {else}
36 <p>
37 <input type="checkbox" name="erase_account" {if $user->state eq 'pending'}checked="checked"{/if} /> Supprimer le compte définitivement.
38 </p>
39 {/if}
40 <p>
41 <input type="hidden" name="uid" value="{$user->uid}" />
42 <input type="submit" name="account_deletion_cancel" value="Annuler" />
43 <input type="submit" name="account_deletion_confirmation" value="Confirmer" />
44 </p>
45 </fieldset>
0337d704 46</form>
879d38da
FB
47{elseif t($smarty.post.erase_account)}
48<p>
49 <a href="admin/accounts">Retourner à la gestion des comptes</a>
50</p>
8338711c 51{else}
0337d704 52{literal}
16019034 53
0337d704 54<script type="text/javascript">
55//<![CDATA[
0337d704 56function del_alias(alias) {
57 document.forms.alias.del_alias.value = alias;
58 document.forms.alias.submit();
59}
60
f9743cf1
FB
61function del_profile(pid) {
62 document.forms.profiles.del_profile.value = pid;
63 document.forms.profiles.submit();
64}
65
0337d704 66function del_fwd(fwd) {
67 document.forms.fwds.del_fwd.value = fwd;
68 document.forms.fwds.submit();
69}
83353c71
FB
70
71function del_openid(id) {
72 document.forms.openid.del_openid.value = id;
73 document.forms.openid.submit();
74}
75
8ffa657a 76function act_fwd(fwd, activate) {
77 if (activate)
78 document.forms.fwds.activate_fwd.value = fwd;
79 else
80 document.forms.fwds.deactivate_fwd.value = fwd;
81 document.forms.fwds.submit();
82}
441c2451 83function clean_fwd(fwd) {
84 document.forms.fwds.clean_fwd.value = fwd;
85 document.forms.fwds.submit();
86}
669cb0e0 87function ban_write()
88{
89 document.forms.bans.write_perm.value = "!xorg.*";
90}
91function ban_read()
92{
93 document.forms.bans.read_perm.value = "!xorg.*";
94}
95
16019034
FB
96$(document).ready(function() {
97 $('#tabs > ul').tabs();
83353c71 98 $('.ui-tabs-nav li').width('24%')
73e4718a 99 .click(function() { $(this).children('a').click() });
16019034
FB
100});
101
0337d704 102// ]]>
103</script>
104{/literal}
105
16019034 106<div id="tabs">
7679a55a 107 <ul style="margin-top: 0">
83353c71 108 <li><a href="{$platal->pl_self()}#account"><span >Compte de {$user->login()}</span></a></li>
7679a55a 109 <li><a href="{$platal->pl_self()}#emails"><span>Emails</span></a></li>
83353c71 110 <li><a href="{$platal->pl_self()}#authext"><span>OpenID</span></a></li>
7679a55a
VZ
111 <li><a href="{$platal->pl_self()}#forums"><span>Forums</span></a></li>
112 </ul>
113</div>
16019034
FB
114
115<div id="account">
f9743cf1 116<form id="auth" method="post" action="admin/user/{$user->login()}#account">
e61326ed 117 {xsrf_token_field}
8f2104cb
FB
118 <h1>Informations sur le compte</h1>
119 <p class="smaller">
120 Dernière connexion le <strong>{$lastlogin|date_format:"%d %B %Y, %T"}</strong>
121 depuis <strong>{$host}</strong>.
122 </p>
123
7679a55a 124 <table class="bicol">
0337d704 125 <tr>
f97f90f0 126 <th colspan="2">
127 <div style="float: right; text-align: right">
98f28a5f
SJ
128 {if $user->state eq 'pending'}
129 Non-inscrit
130 {else}
8f2104cb 131 Inscrit le {$user->registration_date|date_format}
98f28a5f 132 {/if}
f97f90f0 133 </div>
134 <div style="float: left; text-align: left">
210c547f 135 {icon name=user_gray} {$user->hruid} (uid {$user->id()})
f97f90f0 136 </div>
8f2104cb 137 <input type="hidden" name="uid" value="{$user->id()}" />
0337d704 138 </th>
139 </tr>
8f2104cb 140 <tr>
675f3174
FB
141 <td class="titre">Nom complet<br />
142 <span class="smaller">Prénom NOM</span>
143 </br></td>
aef87266 144 <td>{if $hasProfile}{$user->fullName()}{else}<input type="text" name="full_name" maxlength="255" value="{$user->fullName()}" />{/if}</td>
8f2104cb
FB
145 </tr>
146 <tr>
675f3174
FB
147 <td class="titre">Nom annuaire<br />
148 <span class="smaller">NOM Prénom</span>
149 </td>
aef87266 150 <td>{if $hasProfile}{$user->directoryName()}{else}<input type="text" name="directory_name" maxlength="255" value="{$user->directoryName()}" />{/if}</td>
d081acb2
SJ
151 </tr>
152 <tr>
8f2104cb 153 <td class="titre">Nom affiché</td>
aef87266 154 <td>{if $hasProfile}{$user->displayName()}{else}<input type="text" name="display_name" maxlength="255" value="{$user->displayName()}" />{/if}</td>
8f2104cb
FB
155 </tr>
156 <tr>
157 <td class="titre">Sexe</td>
158 <td>
159 <label>femme <input type="radio" name="sex" value="female" {if $user->isFemale()}checked="checked"{/if} /></label>
83752d10 160 <label><input type="radio" name="sex" value="male" {if !$user->isFemale()}checked="checked"{/if} /> homme</label>
0337d704 161 </td>
8f2104cb
FB
162 </tr>
163 <tr class="impair">
164 <td class="titre">Mot de passe</td>
0337d704 165 <td>
5f4ce949 166 <div style="float: left">
853c66f2 167 <input type="text" name="new_plain_password" size="10" maxlength="256" value="********" />
2477a631 168 <input type="hidden" name="pwhash" value="" />
5f4ce949
FB
169 </div>
170 <div style="float: left; margin-top: 5px;">
853c66f2 171 {checkpasswd prompt="new_plain_password" submit="dummy_none"}
5f4ce949 172 </div>
0337d704 173 </td>
174 </tr>
8f2104cb
FB
175 <tr class="impair">
176 <td class="titre">Mot de passe SMTP</td>
177 <td>
178 <div style="float: left">
179 <input type="password" name="weak_password" size="10" maxlength="256" value="" />
180 {if $user->weak_access}
181 <input type="submit" name="disable_weak_access" value="Supprimer" />
182 {/if}
183 </div>
184 </td>
185 </tr>
186 <tr class="impair">
187 <td class="titre">Accès RSS</td>
188 <td>
189 <label>
83752d10 190 <input type="checkbox" name="token_access" {if $user->token_access}checked="checked"{/if} value="1" />
8f2104cb
FB
191 activer l'accès
192 </label>
193 </td>
194 </tr>
195 <tr class="impair">
196 <td class="titre">Skin</td>
197 <td>
198 <select name="skin">
199 <option value="" {if !$user->skin}selected="selected"{/if}>Aucune (défaut du système)</option>
200 {iterate from=$skins item=skin}
201 <option value="{$skin.id}" {if $user->skin eq $skin.id}selected="selected"{/if}>{$skin.name}</option>
202 {/iterate}
203 </select>
204 </td>
205 </tr>
206 <tr class="pair">
207 <td class="titre">Etat du compte</td>
208 <td>
209 <select name="state">
210 <option value="pending" {if $user->state eq 'pending'}selected="selected"{/if}>pending (Non-inscrit)</option>
16019034 211 <option value="active" {if $user->state eq 'active'}selected="selected"{/if}>active (Inscrit, peut se logguer)</option>
8f2104cb
FB
212 <option value="disabled" {if $user->state eq 'disabled'}selected="selected"{/if}>disabled (Inscrit, accès interdit)</option>
213 </select><br />
214 <label>
215 <input type="checkbox" name="is_admin" value="1" {if $user->is_admin}checked="checked"{/if} />
216 administrateur du site
217 </label>
218 </td>
219 </tr>
220 <tr class="pair">
221 <td class="titre">Type de compte</td>
222 <td>
223 <select name="type">
224 {iterate from=$account_types item=type}
225 <option value="{$type.type}" {if $user->type eq $type.type}selected="selected"{/if}>{$type.type} ({$type.perms})</option>
226 {/iterate}
227 </select>
f9743cf1 228 <a href="admin/account/types">{icon name=wrench title=Gérer} gérer</a>
8f2104cb
FB
229 </td>
230 </tr>
231 <tr class="pair">
232 <td class="titre">
233 Surveillance
234 </td>
235 <td>
83752d10 236 <label><input type="checkbox" name="watch" {if $user->watch}checked="checked"{/if} value="1" />
8f2104cb
FB
237 Surveiller l'activité de ce compte</label><br />
238 <span class="smaller">Cette option permet d'avoir des logs complets de l'activité
239 du compte via le logger, et d'être alerté lors des connexions de l'utilisateur.</span>
240 </td>
241 </tr>
242 <tr class="pair">
243 <td class="titre">
244 Commentaire
245 </td>
246 <td>
247 <input type="text" name="comment" size="40" maxlength="64" value="{$user->comment}" />
248 </td>
249 </tr>
7679a55a
VZ
250 <tr class="impair">
251 <td colspan="2" class="center">
2477a631 252 <input type="submit" name="update_account" value="Mettre à jour" onclick="return hashResponse('new_plain_password', false, false);" />
7679a55a
VZ
253 <input type="submit" name="su_account" value="Prendre l'identité" />
254 <input type="submit" name="log_account" value="Consulter les logs" />
879d38da
FB
255 {if $user->state neq 'pending'}
256 <input type="submit" name="delete_account" value="Désinscrire" />
257 {elseif !$user->hasProfile()}
40965e32 258 <input type="submit" name="delete_account" value="Supprimer le compte" />
879d38da 259 {/if}
7679a55a
VZ
260 </td>
261 </tr>
8f2104cb 262 </table>
83752d10 263</form>
f9743cf1
FB
264
265<h1>Fiches associées au compte</h1>
266
267<form id="profiles" method="post" action="admin/user/{$user->login()}#account">
268 {xsrf_token_field}
7679a55a 269 <table class="bicol">
f9743cf1
FB
270 <tr>
271 <th></th>
272 <th>Identifiant de la fiche</th>
273 <th></th>
274 </tr>
275 {iterate from=$profiles item=profile}
276 <tr>
277 <td><input type="radio" name="owner" value="{$profile.pid}" {if $profile.owner}checked="checked"{/if}
278 onclick="this.form.submit()" /></td>
e4e58ca6 279 <td>{$profile.hrpid} (pid {$profile.pid})</td>
f9743cf1
FB
280 <td class="right">
281 <a href="profile/edit/{$profile.hrpid}">{icon name=user_edit}</a>
282 <a href="profile/{$profile.hrpid}" class="popup2">{icon name=user_suit}</a>
283 <a href="javascript:del_profile({$profile.pid})">{icon name=cross}</a>
284 </td>
285 </tr>
286 {/iterate}
879d38da 287 {if $profiles->total() > 0}
f9743cf1
FB
288 <tr>
289 <td>
290 <input type="radio" name="owner" value="0" onclick="this.form.submit()" />
291 </td>
292 <td>None</td>
293 <td></td>
294 </tr>
879d38da 295 {/if}
f9743cf1
FB
296 <tr class="pair">
297 <td colspan="3">
298 <input type="hidden" name="del_profile" value="" />
299 <input type="text" maxlength="64" name="new_profile" />
300 <input type="submit" name="add_profile" value="Ajouter" />
301 </td>
302 </tr>
303 </table>
304</form>
305
1d889ac4
FB
306<h1>Groupes dont l'utilisateur est membre</h1>
307
308<table class="bicol">
309 <tr>
310 <th>Nom du groupe</th>
311 <th>Permissions</th>
312 </tr>
313 {foreach from=$user->groups() item=group}
314 <tr class="impair">
315 <td>{$group.nom}</td>
316 <td style="text-align: right">
317 {$group.perms}
318 <a href="http://www.polytechnique.net/{$group.diminutif}/member/{$user->hruid}">
319 {icon name="user_edit" title="Modifier l'inscription"}
320 </a>
321 </td>
322 </tr>
323 {/foreach}
324</table>
325
16019034 326</div>
8f2104cb 327
16019034 328<div id="emails">
7679a55a 329<h1>Gestion de l'adresse X.org</h1>
16019034 330
f9743cf1 331<form id="alias" method="post" action="admin/user/{$user->login()}#emails">
e61326ed 332 {xsrf_token_field}
7679a55a 333 <table class="bicol" cellpadding="2" cellspacing="0">
0337d704 334 <tr>
5c5554b7 335 <th class="alias" colspan="3">
73e4718a 336 Alias email de l'utilisateur
0337d704 337 </th>
338 </tr>
339 {iterate from=$aliases item=a}
340 <tr class="{cycle values="impair,pair"}">
341 <td>
342 <input type="radio" name='best' {if $a.best}checked="checked"{/if} value='{$a.alias}' onclick="this.form.submit()" />
5c5554b7 343 </td>
344 <td>
0337d704 345 {if $a.for_life}<strong>{$a.alias}</strong>{else}{$a.alias}{/if}
346 {if $a.expire}<span class='erreur'>(expire le {$a.expire|date_format})</span>{/if}
347 </td>
348 {if $a.for_life}
a7de4ef7 349 <td>garanti à vie*</td>
0337d704 350 {else}
351 <td class="action">
f9743cf1 352 <a href="javascript:del_alias('{$a.alias}')">{icon name=cross}</a>
0337d704 353 </td>
354 {/if}
355 </tr>
356 {/iterate}
357 <tr class="{cycle values="impair,pair"}">
5c5554b7 358 <td colspan="2" class="detail">
0337d704 359 <input type="text" name="email" size="29" maxlength="60" value="" />
360 </td>
361 <td class="action">
210c547f 362 <input type="hidden" name="uid" value="{$user->id()}" />
0337d704 363 <input type="hidden" name="del_alias" value="" />
364 <input type="submit" name="add_alias" value="Ajouter" />
365 </td>
366 </tr>
73e4718a
FB
367 <tr class="{cycle values="impair,pair"}">
368 <td colspan="3" class="desc">
369 <strong>* à ne modifier qu'avec l'accord express de l'utilisateur !!!</strong>
370 </td>
371 </tr>
0337d704 372 </table>
373</form>
374
73e4718a 375<br />
5ff3f06b 376
f9743cf1 377<form id="fwds" method="post" action="admin/user/{$user->login()}#emails">
e61326ed 378 {xsrf_token_field}
0337d704 379 <table class="bicol" cellpadding="2" cellspacing="0">
380 <tr>
8ffa657a 381 <th colspan="4">
0337d704 382 Redirections
383 </th>
384 </tr>
11ed26e5
VZ
385 {assign var=actives value=false}
386 {assign var=disabled value=false}
0337d704 387 {foreach item=mail from=$emails}
2069538b 388 {cycle assign=class values="impair,pair"}
389 <tr class="{$class}">
afde0a3a 390 {if $mail->active && $mail->has_disable()}
441c2451 391 {assign var=actives value=true}
afde0a3a 392 {elseif $mail->disabled && $mail->has_disable()}
441c2451 393 {assign var=disabled value=true}
394 {/if}
0337d704 395 <td class="titre">
441c2451 396 {if $mail->active}active{elseif $mail->disabled}suspendue{/if}
0337d704 397 </td>
398 <td>
441c2451 399 <span class="smaller">
400 {if !$mail->disabled}
401 <a href="javascript:act_fwd('{$mail->email}',{if $mail->active}false{else}true{/if})">
402 {if $mail->active}des{elseif $mail->broken}ré{/if}activer
403 </a>
404 {/if}
405 </span>
8ffa657a 406 </td>
407 <td>
dc557110 408 {if $mail->broken}<span style="color: #f00">{/if}
7679a55a 409 {if $mail->email == 'googleapps'}<a href="admin/googleapps/user/{$user->login()}">{/if}
11ed26e5 410 {$mail->display_email}
1edd4e69 411 {if $mail->email == 'googleapps'}</a>{/if}
dc557110 412 {if $mail->broken}<em> (en panne)</em></span>{/if}
0337d704 413 </td>
414 <td class="action">
afde0a3a 415 {if $mail->is_removable()}
f9743cf1 416 <a href="javascript:del_fwd('{$mail->email}')">{icon name=cross}</a>
afde0a3a 417 {/if}
0337d704 418 </td>
419 </tr>
2069538b 420 {if $mail->panne && $mail->panne neq "0000-00-00"}
421 <tr class="{$class}">
441c2451 422 <td colspan="3" class="smaller" style="color: #f00">
2069538b 423 {icon name=error title="Panne"}
11ed26e5 424 Panne de {$mail->display_email} le {$mail->panne|date_format}
a7de4ef7 425 {if $mail->panne neq $mail->last}confirmée le {$mail->last|date_format}{/if}
2069538b 426 </td>
441c2451 427 <td class="action">
428 <a href="javascript:clean_fwd('{$mail->email}')">effacer les pannes</a>
429 </td>
2069538b 430 </tr>
431 {/if}
0337d704 432 {/foreach}
441c2451 433 {cycle assign=class values="impair,pair"}
434 <tr class="{$class}">
8ffa657a 435 <td class="titre" colspan="2">
faefdbb7 436 Ajouter une adresse
0337d704 437 </td>
438 <td>
439 <input type="text" name="email" size="29" maxlength="60" value="" />
440 </td>
441 <td class="action">
1844170a 442 <input type="hidden" name="uid" value="{$user->id()}" />
0337d704 443 <input type="hidden" name="del_fwd" value="" />
441c2451 444 <input type="hidden" name="clean_fwd" value="" />
8ffa657a 445 <input type="hidden" name="activate_fwd" value="" />
446 <input type="hidden" name="deactivate_fwd" value="" />
0337d704 447 <input type="submit" name="add_fwd" value="Ajouter" />
448 </td>
449 </tr>
441c2451 450 <tr class="{$class}">
451 <td colspan="4" class="center">
452 {if $actives}
faefdbb7 453 <input type="submit" name="disable_fwd" value="Désactiver la redirection des emails" />
441c2451 454 {/if}
455 {if $disabled}
faefdbb7 456 <input type="submit" name="enable_fwd" value="Réactiver la redirection des emails" />
441c2451 457 {/if}
458 </td>
459 </tr>
0337d704 460 </table>
461</form>
462
73e4718a
FB
463{javascript name="ajax"}
464{test_email hruid=$user->login()}
465
466<h1>Autres adresses de l'utilisateur</h1>
467
7679a55a 468<table class="bicol">
b5997e90 469 <tr>
1d889ac4
FB
470 <th colspan="3">Mailing lists auquelles l'utilisateur appartient</th>
471 </tr>
472 {foreach from=$mlists item=mlist}
473 <tr>
474 <td>
475 <a href="http://listes.polytechnique.org/members/{$mlist.addr|replace:"@":"_"}">
476 {$mlist.addr}
477 </a>
478 </td>
479 <td>
480 <input type="checkbox" disabled="disabled" {if $mlist.sub}checked="checked"{/if} /> Membre
481 </td>
482 <td>
483 <input type="checkbox" disabled="disabled" {if $mlist.own}checked="checked"{/if} /> Modérateur
484 </td>
485 </tr>
486 {/foreach}
487</table>
488
489<br />
490<table class="bicol">
491 <tr>
b5997e90
FB
492 <th>Virtual aliases auquel l'utilisateur appartient</th>
493 </tr>
73e4718a
FB
494 {foreach from=$virtuals item=virtual}
495 <tr class="{cycle values="impair,pair"}">
496 <td>{$virtual}</td>
497 </tr>
498 {/foreach}
499</table>
83353c71 500</div>
73e4718a 501
83353c71
FB
502<div id="authext">
503<h1>Gestion des autorisations d'authentification externe</h1>
504
505<form id="openid" method="post" action="admin/user/{$user->login()}#authext">
506 {xsrf_token_field}
507 <table class="bicol">
508 <tr>
509 <th colspan="2">Sites de confiance</th>
510 </tr>
511 {iterate from=$openid item=site}
512 <tr class="{cycle values="pair,impair"}">
513 <td><a href="{$site.url}">{$site.url}</a></td>
514 <td><a href="javascript:del_openid({$site.id})">{icon name=cross}</a></td>
515 </tr>
516 {/iterate}
517 </table>
518 <div><input type="hidden" name="del_openid"/></div>
519</form>
16019034
FB
520</div>
521
522<div id="forums">
7679a55a 523<h1>Gestion de l'accès au forums</h1>
16019034 524
f9743cf1 525<form id="bans" method="post" action="admin/user/{$user->login()}#forums">
16019034 526 {xsrf_token_field}
7679a55a 527 <table class="bicol">
16019034
FB
528 <tr>
529 <th colspan="4">
530 Permissions sur les forums
531 </th>
532 </tr>
533 <tr class="impair">
534 <td class="titre">
535 Poster
536 </td>
537 <td>
538 <input type="text" name="write_perm" size="32" maxlength="255" value="{$bans.write_perm}" />
539 </td>
540 <td class="action">
541 <a href="javascript:ban_write()">Bannir</a>
542 </td>
543 </tr>
544 <tr class="pair">
545 <td class="titre">
546 Lire
547 </td>
548 <td>
549 <input type="text" name="read_perm" size="32" maxlength="255" value="{$bans.read_perm}" />
550 </td>
551 <td class="action">
552 <a href="javascript:ban_read()">Bannir</a>
553 </td>
554 </tr>
555 <tr class="impair">
556 <td class="titre">
557 Commentaire
558 </td>
559 <td colspan="2">
560 <input type="text" name="comment" size="40" maxlength="255" value="{$bans.comment}" />
561 </td>
562 </tr>
563 <tr class="center">
564 <td colspan="3">
210c547f 565 <input type="hidden" name="uid" value="{$user->id()}" />
16019034
FB
566 <input type="submit" name="b_edit" value="Modifier" />
567 </td>
568 </tr>
569 </table>
570</form>
571</div>
0337d704 572{/if}
0337d704 573
a7de4ef7 574{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}