From: Stéphane Jacob Date: Mon, 28 Feb 2011 10:27:25 +0000 (+0100) Subject: Do not require validation for private names modifications (Closes #1389). X-Git-Tag: xorg/1.1.0~101 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=297bf4c82049f85fe756f7049b520050c1c553a9;p=platal.git Do not require validation for private names modifications (Closes #1389). Signed-off-by: Stéphane Jacob --- diff --git a/ChangeLog b/ChangeLog index 4e44b04..23d1cb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -35,6 +35,7 @@ Bug/Wish: - #1367: Improves postal address formatting -JAC - #1368: Allows admin profile edition even if birthdate is unknown -JAC - #1369: Properly displays moderated jobs -JAC + - #1389: Do not require validation for private names modifications -JAC - #1401: Main addresses are displayed before secondary addresses -JAC * Register: diff --git a/include/name.func.inc.php b/include/name.func.inc.php index d3d11a2..09f8b71 100644 --- a/include/name.func.inc.php +++ b/include/name.func.inc.php @@ -251,13 +251,18 @@ function set_alias_names(&$sn_new, $sn_old, $pid, $uid, $update_new = false, $ne { $has_new = false; foreach ($sn_new as $typeid => $sn) { - if (isset($sn['pub'])) { + if (isset($sn['pub']) && !is_null($sn['fullname'])) { if (isset($sn_old[$typeid]) && $update_new) { XDB::execute("UPDATE profile_name SET particle = {?}, name = {?}, typeid = {?} WHERE id = {?} AND pid = {?}", $sn['particle'], $sn['name'], $typeid, $sn_old[$typeid]['id'], $pid); unset($sn_old[$typeid]); + } elseif ($sn['fullname'] == $sn_old[$typeid]['fullname'] && $sn['name'] == $sn_old[$typeid]['name']) { + XDB::execute('INSERT INTO profile_name (particle, name, typeid, pid) + VALUES ({?}, {?}, {?}, {?})', + $sn_old[$typeid]['particle'], $sn_old[$typeid]['name'], $typeid, $pid); + unset($sn_old[$typeid]); } else { $has_new = true; }