From: Stéphane Jacob Date: Fri, 21 Oct 2011 09:34:51 +0000 (+0200) Subject: Allows admins to modify unregisterd users' ref birthdate (Closes #1554). X-Git-Tag: xorg/1.1.4~80 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=26198a046518a4993e9e1ae470ba72c8db6b0543;p=platal.git Allows admins to modify unregisterd users' ref birthdate (Closes #1554). Signed-off-by: Stéphane Jacob --- 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}