From 297bf4c82049f85fe756f7049b520050c1c553a9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Mon, 28 Feb 2011 11:27:25 +0100 Subject: [PATCH] Do not require validation for private names modifications (Closes #1389). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Jacob --- ChangeLog | 1 + include/name.func.inc.php | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) 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; } -- 2.1.4