X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fname.func.inc.php;h=7b56365d8aaca7e8a337c90a90f01c8269515d78;hb=e7fb8e061fb7d785b433057c0c1a399c70d4a6e0;hp=d9542635c48b4eadc1a0a03e7b85abdd416dea60;hpb=12ddbc2037b16496dfb9d91c4f7091850146fcde;p=platal.git diff --git a/include/name.func.inc.php b/include/name.func.inc.php index d954263..7b56365 100644 --- a/include/name.func.inc.php +++ b/include/name.func.inc.php @@ -1,6 +1,6 @@ $sn) { if (isset($sn['pub'])) { - if (isset($sn_old[$typeid]) && ($sn_old[$typeid]['fullname'] == $sn['fullname'] && $update_new)) { + 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 ($update_new - || (isset($sn_old[$typeid]) && compare_basename($sn_old[$typeid]['fullname'], $sn['fullname']))) { - XDB::execute("INSERT INTO profile_name (particle, name, typeid, pid) - VALUES ({?}, {?}, {?}, {?})", - $sn['particle'], $sn['name'], $typeid, $pid); - unset($sn_old[$typeid]); } else { $has_new = true; } @@ -308,7 +302,7 @@ function set_alias_names(&$sn_new, $sn_old, $pid, $uid, $update_new = false, $ne VALUES ({?}, 'alias', 'usage', {?})", $new_alias, $uid); } - Profile::rebuildSearchTokens($pid); + Profile::rebuildSearchTokens($pid, false); return $has_new; }