Updates owner's directory name when profile's name has been updated.
[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[
38function doEditUser() {
46bde4d1 39 document.forms.auth.hashpass.value = hash_encrypt(document.forms.edit.password.value);
0337d704 40 document.forms.auth.password.value = "";
41 document.forms.auth.submit();
42}
43
44function del_alias(alias) {
45 document.forms.alias.del_alias.value = alias;
46 document.forms.alias.submit();
47}
48
f9743cf1
FB
49function del_profile(pid) {
50 document.forms.profiles.del_profile.value = pid;
51 document.forms.profiles.submit();
52}
53
0337d704 54function del_fwd(fwd) {
55 document.forms.fwds.del_fwd.value = fwd;
56 document.forms.fwds.submit();
57}
83353c71
FB
58
59function del_openid(id) {
60 document.forms.openid.del_openid.value = id;
61 document.forms.openid.submit();
62}
63
8ffa657a 64function act_fwd(fwd, activate) {
65 if (activate)
66 document.forms.fwds.activate_fwd.value = fwd;
67 else
68 document.forms.fwds.deactivate_fwd.value = fwd;
69 document.forms.fwds.submit();
70}
441c2451 71function clean_fwd(fwd) {
72 document.forms.fwds.clean_fwd.value = fwd;
73 document.forms.fwds.submit();
74}
669cb0e0 75function ban_write()
76{
77 document.forms.bans.write_perm.value = "!xorg.*";
78}
79function ban_read()
80{
81 document.forms.bans.read_perm.value = "!xorg.*";
82}
83
16019034
FB
84$(document).ready(function() {
85 $('#tabs > ul').tabs();
83353c71 86 $('.ui-tabs-nav li').width('24%')
73e4718a 87 .click(function() { $(this).children('a').click() });
16019034
FB
88});
89
0337d704 90// ]]>
91</script>
92{/literal}
93
16019034 94<div id="tabs">
7679a55a 95 <ul style="margin-top: 0">
83353c71 96 <li><a href="{$platal->pl_self()}#account"><span >Compte de {$user->login()}</span></a></li>
7679a55a 97 <li><a href="{$platal->pl_self()}#emails"><span>Emails</span></a></li>
83353c71 98 <li><a href="{$platal->pl_self()}#authext"><span>OpenID</span></a></li>
7679a55a
VZ
99 <li><a href="{$platal->pl_self()}#forums"><span>Forums</span></a></li>
100 </ul>
101</div>
16019034
FB
102
103<div id="account">
f9743cf1 104<form id="auth" method="post" action="admin/user/{$user->login()}#account">
e61326ed 105 {xsrf_token_field}
8f2104cb
FB
106 <h1>Informations sur le compte</h1>
107 <p class="smaller">
108 Dernière connexion le <strong>{$lastlogin|date_format:"%d %B %Y, %T"}</strong>
109 depuis <strong>{$host}</strong>.
110 </p>
111
7679a55a 112 <table class="bicol">
0337d704 113 <tr>
f97f90f0 114 <th colspan="2">
115 <div style="float: right; text-align: right">
98f28a5f
SJ
116 {if $user->state eq 'pending'}
117 Non-inscrit
118 {else}
8f2104cb 119 Inscrit le {$user->registration_date|date_format}
98f28a5f 120 {/if}
f97f90f0 121 </div>
122 <div style="float: left; text-align: left">
210c547f 123 {icon name=user_gray} {$user->hruid} (uid {$user->id()})
f97f90f0 124 </div>
8f2104cb 125 <input type="hidden" name="uid" value="{$user->id()}" />
0337d704 126 </th>
127 </tr>
8f2104cb
FB
128 <tr>
129 <td class="titre">Nom complet</td>
130 <td><input type="text" name="full_name" maxlength="255" value="{$user->fullName()}" /></td>
131 </tr>
132 <tr>
d081acb2
SJ
133 <td class="titre">Nom annuaire</td>
134 <td><input type="text" name="directory_name" maxlength="255" value="{$user->directoryName()}" /></td>
135 </tr>
136 <tr>
8f2104cb
FB
137 <td class="titre">Nom affiché</td>
138 <td><input type="text" name="display_name" maxlength="255" value="{$user->displayName()}" /></td>
139 </tr>
140 <tr>
141 <td class="titre">Sexe</td>
142 <td>
143 <label>femme <input type="radio" name="sex" value="female" {if $user->isFemale()}checked="checked"{/if} /></label>
83752d10 144 <label><input type="radio" name="sex" value="male" {if !$user->isFemale()}checked="checked"{/if} /> homme</label>
0337d704 145 </td>
8f2104cb
FB
146 </tr>
147 <tr class="impair">
148 <td class="titre">Mot de passe</td>
0337d704 149 <td>
5f4ce949 150 <div style="float: left">
ed130f47 151 <input type="text" name="newpass_clair" size="10" maxlength="256" value="********" />
5f4ce949
FB
152 <input type="hidden" name="hashpass" value="" />
153 </div>
154 <div style="float: left; margin-top: 5px;">
155 {checkpasswd prompt="newpass_clair" submit="dummy_none"}
156 </div>
0337d704 157 </td>
158 </tr>
8f2104cb
FB
159 <tr class="impair">
160 <td class="titre">Mot de passe SMTP</td>
161 <td>
162 <div style="float: left">
163 <input type="password" name="weak_password" size="10" maxlength="256" value="" />
164 {if $user->weak_access}
165 <input type="submit" name="disable_weak_access" value="Supprimer" />
166 {/if}
167 </div>
168 </td>
169 </tr>
170 <tr class="impair">
171 <td class="titre">Accès RSS</td>
172 <td>
173 <label>
83752d10 174 <input type="checkbox" name="token_access" {if $user->token_access}checked="checked"{/if} value="1" />
8f2104cb
FB
175 activer l'accès
176 </label>
177 </td>
178 </tr>
179 <tr class="impair">
180 <td class="titre">Skin</td>
181 <td>
182 <select name="skin">
183 <option value="" {if !$user->skin}selected="selected"{/if}>Aucune (défaut du système)</option>
184 {iterate from=$skins item=skin}
185 <option value="{$skin.id}" {if $user->skin eq $skin.id}selected="selected"{/if}>{$skin.name}</option>
186 {/iterate}
187 </select>
188 </td>
189 </tr>
190 <tr class="pair">
191 <td class="titre">Etat du compte</td>
192 <td>
193 <select name="state">
194 <option value="pending" {if $user->state eq 'pending'}selected="selected"{/if}>pending (Non-inscrit)</option>
16019034 195 <option value="active" {if $user->state eq 'active'}selected="selected"{/if}>active (Inscrit, peut se logguer)</option>
8f2104cb
FB
196 <option value="disabled" {if $user->state eq 'disabled'}selected="selected"{/if}>disabled (Inscrit, accès interdit)</option>
197 </select><br />
198 <label>
199 <input type="checkbox" name="is_admin" value="1" {if $user->is_admin}checked="checked"{/if} />
200 administrateur du site
201 </label>
202 </td>
203 </tr>
204 <tr class="pair">
205 <td class="titre">Type de compte</td>
206 <td>
207 <select name="type">
208 {iterate from=$account_types item=type}
209 <option value="{$type.type}" {if $user->type eq $type.type}selected="selected"{/if}>{$type.type} ({$type.perms})</option>
210 {/iterate}
211 </select>
f9743cf1 212 <a href="admin/account/types">{icon name=wrench title=Gérer} gérer</a>
8f2104cb
FB
213 </td>
214 </tr>
215 <tr class="pair">
216 <td class="titre">
217 Surveillance
218 </td>
219 <td>
83752d10 220 <label><input type="checkbox" name="watch" {if $user->watch}checked="checked"{/if} value="1" />
8f2104cb
FB
221 Surveiller l'activité de ce compte</label><br />
222 <span class="smaller">Cette option permet d'avoir des logs complets de l'activité
223 du compte via le logger, et d'être alerté lors des connexions de l'utilisateur.</span>
224 </td>
225 </tr>
226 <tr class="pair">
227 <td class="titre">
228 Commentaire
229 </td>
230 <td>
231 <input type="text" name="comment" size="40" maxlength="64" value="{$user->comment}" />
232 </td>
233 </tr>
7679a55a
VZ
234 <tr class="impair">
235 <td colspan="2" class="center">
236 {* TODO: on 'update_account', update the hashpass field before sending the form. *}
237 <input type="submit" name="update_account" value="Mettre à jour" />
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: *}