X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fprofil.func.inc.php;h=cd493cd8f5e597d17b216aad7bede3bec0701c23;hb=3083bd93007e9be01f0536bcb7047989c2bd153e;hp=803dc301ebae0157289a48e4b1e6eef925d55953;hpb=a7de4ef724d1a3b0bf978a50ce7cc9d23412c7a0;p=platal.git diff --git a/include/profil.func.inc.php b/include/profil.func.inc.php index 803dc30..cd493cd 100644 --- a/include/profil.func.inc.php +++ b/include/profil.func.inc.php @@ -46,7 +46,7 @@ function put_in_db($string){ } // example of use for diff_user_details : get $b from database, $a from other site -// calculate diff $c and add $c in database (with set_user_details) +// calculate diff $c and add $c in database (with set_user_details) function diff_user_details(&$a, &$b, $view = 'private') { // compute $c = $a - $b // if (!isset($b) || !$b || !is_array($b) || count($b) == 0) // return $a; @@ -131,11 +131,11 @@ function diff_user_address($a, $b) { $a['pub'] = $b['pub']; if (isset($b['tels'])) { $bvar = $b['tels']; - + $telids_b = array(); - foreach ($bvar as $i => $telb) $telids_b[$telb['telid']] = $i; + foreach ($bvar as $i => $telb) $telids_b[$telb['telid']] = $i; - if (isset($a['tels'])) + if (isset($a['tels'])) $avar = $a['tels']; else $avar = array(); @@ -161,7 +161,7 @@ function diff_user_address($a, $b) { } } } - + foreach ($telids_b as $telidb => $i) $ctels[] = array('telid' => $telidb, 'remove' => 1); @@ -183,8 +183,8 @@ function diff_user_address($a, $b) { function diff_user_addresses(&$a, &$b) { $c = $a; $adrids_b = array(); - foreach ($b as $i => $adrb) $adrids_b[$adrb['adrid']] = $i; - + foreach ($b as $i => $adrb) $adrids_b[$adrb['adrid']] = $i; + foreach ($a as $j => $adra) { if (isset($adra['adrid'])) { // if b has an address with the same adrid, compute diff