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