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