{**************************************************************************}
{* *}
-{* Copyright (C) 2003-2007 Polytechnique.org *}
+{* Copyright (C) 2003-2010 Polytechnique.org *}
{* http://opensource.polytechnique.org/ *}
{* *}
{* This program is free software; you can redistribute it and/or modify *}
{**************************************************************************}
<script type="text/javascript">
- {literal}
- function showInformations(box)
- {
- var state = (box.value == 'ext') ? '' : 'none';
- document.getElementById('prenom').style.display = state;
- document.getElementById('sexe').style.display = state;
- }
- {/literal}
+{literal}
+ function showInformations(box)
+ {
+ var state = (box.value != 'virtual') ? '' : 'none';
+ document.getElementById('prenom').style.display = state;
+ document.getElementById('sexe').style.display = state;
+ document.getElementById('make_X').style.display = state;
+ }
+
+ function showXInput(box)
+ {
+ if (box.checked) {
+ document.getElementById('make_X_cb').style.display = 'none';
+ document.getElementById('make_X_login').style.display = '';
+ }
+ }
+{/literal}
</script>
-<h1>{$asso.nom} : gestion des membres</h1>
+<h1>{$asso->nom} : gestion des membres</h1>
<p>
[<a href='{$platal->ns}annuaire'>Retour à l'annuaire</a>]
</p>
<h2>
- Édition du profil de {$user.prenom} {$user.nom}
- {if $user.origine eq 'X'}
- (X{$user.promo})
- <a href="https://www.polytechnique.org/profile/{$user.alias}">{icon name=user_suit title="fiche"}</a>
- {/if}
- <a href="{$platal->ns}member/del/{$user.email}">{icon name=delete title="Suppression du compte"}</a>
- <a href="mailto:{$user.email}">{icon name=email title="mail"}</a>
+ Édition du profil de {profile user=$user groupperms=false sex=false promo=true}
+ <a href="mailto:{$user->bestEmail()}">{icon name=email title="mail"}</a>
</h2>
<form method="post" action="{$platal->ns}member/{$platal->argv[1]}">
+ {xsrf_token_field}
<table cellpadding="0" cellspacing="0" class='tinybicol'>
<tr class="pair">
<td class="titre">
- Permissions:
+ Permissions :
</td>
<td>
- <select name="is_admin">
- <option value="0" {if !$user.perms}selected="selected"{/if}>Membre</option>
- <option value="1" {if $user.perms}selected="selected"{/if}>Administrateur</option>
+ <select name="group_perms">
+ <option value="membre" {if $user->group_perms eq 'membre'}selected="selected"{/if}>Membre</option>
+ <option value="admin" {if $user->group_perms eq 'admin'}selected="selected"{/if}>Animateur</option>
</select>
</td>
</tr>
- {if $user.origine neq X}
+ {if !$user->profile()}
<tr class="impair">
<td class="titre">
- Type d'utilisateur :
+ Type d'utilisateur :
</td>
<td>
- <select name="origine" onchange="showInformations(this); return true">
- <option value="ext" {if $user.origine eq "ext"}selected="selected"{/if}>Personne physique</option>
- <option value="groupe" {if $user.origine eq "groupe"}selected="selected"{/if}>Personne morale</option>
+ <select name="type" onchange="showInformations(this); return true"{if $user->profile()} disabled="disabled"{/if}>
+ <option value="xnet" {if $user->type neq 'virtual'}selected="selected"{/if}>Personne physique</option>
+ <option value="virtual" {if $user->type eq "virtual"}selected="selected"{/if}>Personne morale</option>
</select>
</td>
</tr>
- <tr id="prenom" class="impair" {if $user.origine eq "groupe"}style="display: none"{/if}>
+ <tr id="prenom" class="impair" {if $user->type eq "virtual"}style="display: none"{/if}>
<td class="titre">
- Prénom :
+ Nom affiché :
</td>
<td>
- <input type="text" value="{$user.prenom}" name="prenom" size="40" />
+ <input type="text" value="{$user->displayName()}" name="display_name" size="40"{if $user->profile()} disabled="disabled"{/if} />
</td>
</tr>
<tr class="impair">
<td class="titre">
- Nom :
+ Nom complet :
</td>
<td>
- <input type="text" value="{$user.nom}" name="nom" size="40" />
+ <input type="text" value="{$user->fullName()}" name="full_name" size="40"{if $user->profile()} disabled="disabled"{/if} />
</td>
</tr>
- <tr id="sexe" class="impair" {if $user.origine eq "groupe"}style="display: none"{/if}>
+ <tr id="sexe" class="impair" {if $user->type eq "virtual"}style="display: none"{/if}>
<td class="titre">
- Sexe :
+ Sexe :
</td>
<td>
- <select name="sexe">
- <option value="0"{if $user.sexe eq 0} selected="selected"{/if}>Homme</option>
- <option value="1"{if $user.sexe eq 1} selected="selected"{/if}>Femme</option>
+ <select name="sex"{if $user->profile()} disabled="disabled"{/if}>
+ <option value="male"{if !$user->isFemale()} selected="selected"{/if}>Homme</option>
+ <option value="female"{if $user->isFemale()} selected="selected"{/if}>Femme</option>
</select>
</td>
</tr>
<tr class="impair">
<td class="titre">
- Email:
+ Email :
+ </td>
+ <td>
+ <input type="text" value="{$user->forlifeEmail()}" name="email" size="40"{if $user->profile()} disabled="disabled"{/if} />
+ </td>
+ </tr>
+ {/if}
+ <tr class="impair">
+ <td class="titre">
+ Commentaire :
</td>
<td>
- <input type="text" value="{$user.email}" name="email" size="40" />
+ <input type="text" name="comm" value="{$user->group_comm}" size="40" maxlength="255" /><br />
+ <small>Poste, origine… (accessible à toutes les personnes autorisées à consulter l'annuaire)</small>
+ </td>
+ </tr>
+ {if $user->type eq 'xnet'}
+ <tr id="make_X">
+ <td colspan="2">
+ <span id="make_X_cb">
+ <input type="checkbox" name="is_x" id="is_x" onclick="showXInput(this);" onchange="showXInput(this);" />
+ <label for="is_x">coche cette case s'il s'agit d'un X</label>
+ </span>
+ <span id="make_X_login" style="display: none">
+ <span class="titre">Identifiant (prenom.nom.promo) :</span>
+ <input type="text" name="login_X" value="" />
+ </span>
</td>
</tr>
{/if}
<td>
<a href='{$platal->ns}lists/members/{$liste.list}'>{$liste.list}</a>
</td>
- <td>{$liste.desc}</td>
+ <td>{$liste.desc|smarty:nodefaults}</td>
<td class='right'>{$liste.nbsub}</td>
</tr>
{foreachelse}
<th>Alias</th>
</tr>
- {foreach from=$alias item=a}
+ {foreach from=$alias key=address item=sub}
<tr>
<td align='right'>
- <input type='hidden' name='ml3[{$a.alias}]' value='{$a.sub}' />
- <input type='checkbox' name='ml4[{$a.alias}]' {if $a.sub}checked="checked"{/if} />
+ <input type='hidden' name='ml3[{$address}]' value='{$sub}' />
+ <input type='checkbox' name='ml4[{$address}]' {if $sub}checked="checked"{/if} />
</td>
<td>
- <a href='{$platal->ns}alias/admin/{$a.alias}'>{$a.alias}</a>
+ <a href='{$platal->ns}alias/admin/{$address}'>{$address}</a>
</td>
</tr>
{foreachelse}