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