From: Florent Bruneau Date: Fri, 1 Oct 2010 12:02:29 +0000 (+0200) Subject: Minor fixes of account administration pages. X-Git-Tag: xorg/1.0.1~124 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=4cd83ff8c82b3f6b8bfff1d629fdc026306c0824;p=platal.git Minor fixes of account administration pages. * 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 --- diff --git a/modules/admin.php b/modules/admin.php index e1e2ceb..e9fbae1 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -413,7 +413,10 @@ class AdminModule extends PLModule 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é."); } diff --git a/templates/admin/accounts.tpl b/templates/admin/accounts.tpl index 1bac1db..52af2e5 100644 --- a/templates/admin/accounts.tpl +++ b/templates/admin/accounts.tpl @@ -47,6 +47,7 @@ function add_user_to_url(f) { +{if $users->total() > 0}
Liste des comptes manuels @@ -58,6 +59,7 @@ function add_user_to_url(f) { {/iterate}
+{/if}
Nouveau compte @@ -82,11 +84,11 @@ function add_user_to_url(f) { Nom - + Prénom - + Sexe