aliases.id => aliases.uid
[platal.git] / include / webservices / manageurs.server.inc.php
index 562f402..2fa54f8 100644 (file)
@@ -35,7 +35,7 @@ function get_annuaire_infos($method, $params) {
                     "SELECT  ph.display_tel  AS cell, a.naissance AS age
                        FROM  auth_user_md5   AS a
                  INNER JOIN  auth_user_quick AS q USING (user_id)
-                  LEFT JOIN  profile_phones  AS ph ON (ph.uid = a.user_id AND link_type='user' AND tel_type = 'mobile')
+                  LEFT JOIN  profile_phones  AS ph ON (ph.pid = a.user_id AND link_type='user' AND tel_type = 'mobile')
                       WHERE  a.matricule = {?} LIMIT 1", $params[1]);
             $array = $res->next();
         } else {
@@ -58,7 +58,7 @@ function get_annuaire_infos($method, $params) {
                     explode("\n", Geocoder::getFirstLines($text, $adr['cp'], 3));
                 $sql = XDB::query("SELECT  display_tel
                                      FROM  profile_phones
-                                    WHERE  uid = {?} AND link_type = 'user' AND tel_type = 'mobile'
+                                    WHERE  pid = {?} AND link_type = 'user' AND tel_type = 'mobile'
                                     LIMIT  1", $uid);
                 if ($sql->numRows() > 0) {
                     $array['cell'] = $sql->fetchOneCell();
@@ -100,7 +100,7 @@ function get_annuaire_infos($method, $params) {
                            "SELECT  t.display_tel AS tel, t.tel_type, t.link_id as adrid
                               FROM  profile_phones    AS t
                         INNER JOIN  profile_addresses AS a ON (t.link_id = a.id AND t.uid = a.pid)
-                             WHERE  t.uid = {?} AND t.link_type = 'address'
+                             WHERE  t.pid = {?} AND t.link_type = 'address'
                                     AND NOT FIND_IN_SET('pro', a.statut)", $uid);
                 while ($tel = $restel->next()) {
                     $array['adresse'][$adrid_index[$tel['adrid']]]['tels'][] = $tel;
@@ -181,7 +181,7 @@ function get_nouveau_infos($method, $params) {
                 "SELECT  a.nom, a.nom_usage,a.prenom, FIND_IN_SET('femme', a.flags) as femme,
                          a.deces!= 0 as decede, a.naissance, a.promo, concat(al.alias, '@m4x.org') as mail
                    FROM  auth_user_md5 AS a
-             INNER JOIN  aliases       AS al ON (a.user_id = al.id)
+             INNER JOIN  aliases       AS al ON (a.user_id = al.uid)
                   WHERE  al.flags = 'bestalias' AND a.matricule = {?}",$params[1]);
         $data=$res->fetchOneAssoc();
         //$data['mail'].='@polytechnique.org';