X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuser.func.inc.php;h=4c4373158f319eb0b55b2b9a42e8afdc43b5d092;hb=a1ee34a40854bad35ee0663f17352ec51ab83365;hp=ee2cb3954617af56a67e30b7a50929c0f21ffd69;hpb=23e39ac352fbe095a80da11c7d97a37cf860b91e;p=platal.git diff --git a/include/user.func.inc.php b/include/user.func.inc.php index ee2cb39..4c43731 100644 --- a/include/user.func.inc.php +++ b/include/user.func.inc.php @@ -103,8 +103,10 @@ function get_not_registered_user($login, $iterator = false) return null; } @list($prenom, $nom, $promo) = explode('.', $login); - $where = 'REPLACE(REPLACE(REPLACE(nom, " ", ""), "-", ""), "\'", "") LIKE CONCAT("%", {?}, "%") - AND REPLACE(REPLACE(REPLACE(prenom, " ", ""), "-", ""), "\'", "") LIKE CONCAT("%", {?}, "%")'; + $where = 'REPLACE(REPLACE(REPLACE(nom, " ", ""), "-", ""), "\'", "") + LIKE CONCAT("%", REPLACE(REPLACE(REPLACE({?}, " ", ""), "-", ""), "\'", ""), "%") + AND REPLACE(REPLACE(REPLACE(prenom, " ", ""), "-", ""), "\'", "") + LIKE CONCAT("%", REPLACE(REPLACE(REPLACE({?}, " ", ""), "-", ""), "\'", ""), "%")'; if ($promo) { if (preg_match('/^[0-9]{2}$/', $promo)) { $where .= 'AND MOD(promo, 100) = {?}'; @@ -536,8 +538,10 @@ function set_user_details_addresses($uid, $adrs) { $adrid = 0; } foreach ($adrs as $adr) { - add_user_address($uid, $adrid, $adr); - ++$adrid; + if (!@$adr['remove']) { + add_user_address($uid, $adrid, $adr); + ++$adrid; + } } require_once 'geoloc.inc.php'; localize_addresses($uid); @@ -555,8 +559,10 @@ function set_user_details_pro($uid, $pros) $entrid = 0; } foreach ($pros as $pro) { - add_user_pro($uid, $entrid, $pro); - ++$entrid; + if (!@$pro['remove']) { + add_user_pro($uid, $entrid, $pro); + ++$entrid; + } } }