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