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