From 4cd83ff8c82b3f6b8bfff1d629fdc026306c0824 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Fri, 1 Oct 2010 14:02:29 +0200 Subject: [PATCH] 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 --- modules/admin.php | 5 ++++- templates/admin/accounts.tpl | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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 -- 2.1.4