From 26198a046518a4993e9e1ae470ba72c8db6b0543 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Fri, 21 Oct 2011 11:34:51 +0200 Subject: [PATCH] Allows admins to modify unregisterd users' ref birthdate (Closes #1554). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- ChangeLog | 1 + modules/profile/general.inc.php | 3 ++- templates/profile/general.tpl | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 86d3f0c..826489c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -41,6 +41,7 @@ Bug/Wish: - #1381: Adds levels to medals -JAC - #1446: Adds field for sports and hobbies -JAC - #1535: Moves and displays skills with mentoring informations -JAC + - #1554: Allows admins to modify unregisterd users' ref birthdate -JAC * Search: - #1284: If a country is chosen, only proposes its cities -JAC diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index 93302c9..dc9058d 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -664,6 +664,7 @@ class ProfilePageGeneral extends ProfilePage $this->watched['freetext'] = true; } + Platal::page()->assign('is_registered', ($this->owner->perms ? true : false)); } protected function _fetchData() @@ -777,7 +778,7 @@ class ProfilePageGeneral extends ProfilePage } } } - if ($this->orig['birthdate_ref'] == 0 && !S::user()->isMe($this->owner) && $this->changed['birthdate_ref']) { + if ($this->changed['birthdate_ref'] && S::admin() && !$this->owner->perms) { XDB::execute('UPDATE profiles SET birthdate_ref = {?} WHERE pid = {?}', diff --git a/templates/profile/general.tpl b/templates/profile/general.tpl index 117e8be..8a04c66 100644 --- a/templates/profile/general.tpl +++ b/templates/profile/general.tpl @@ -152,7 +152,7 @@ Date de naissance de référence - {if $birthdate_ref eq 0} + {if hasPerm('admin') && !$is_registered} {else} {$birthdate_ref} -- 2.1.4