* Don't try to clear the profile of the user when the user has no associated
profile.
* Fix inverted firstname <-> lastname in account creation form
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
if (Post::has('account_deletion_confirmation')) {
$uid = $user->id();
$name = $user->fullName();
- $user->profile()->clear();
+ $profile = $user->profile();
+ if ($profile) {
+ $user->profile()->clear();
+ }
$user->clear(true);
$page->trigSuccess("L'utilisateur $name ($uid) a bien été supprimé.");
}
</form>
</fieldset>
+{if $users->total() > 0}
<fieldset>
<legend>Liste des comptes manuels</legend>
{/iterate}
</ul>
</fieldset>
+{/if}
<fieldset>
<legend>Nouveau compte</legend>
</tr>
<tr>
<td class="titre">Nom</td>
- <td><input type="text" name="firstname" size=60 maxlength="255" value="" /></td>
+ <td><input type="text" name="lastname" size=60 maxlength="255" value="" /></td>
</tr>
<tr>
<td class="titre">Prénom</td>
- <td><input type="text" name="lastname" size=60" maxlength="255" value="" /></td>
+ <td><input type="text" name="firstname" size=60" maxlength="255" value="" /></td>
</tr>
<tr>
<td class="titre">Sexe</td>