Renames uid to pid in search_name table.
[platal.git] / modules / xnetgrp.php
index 254819b..a1f3970 100644 (file)
@@ -340,7 +340,7 @@ class XnetGrpModule extends PLModule
     {
         global $globals;
         $vcard = new VCard($photos == 'photos', 'Membre du groupe ' . $globals->asso('nom'));
-        $vcard->addUsers($globals->asso()->getMembers()->getUIDs());
+        $vcard->addProfiles($globals->asso()->getMembers()->getProfiles());
         $vcard->show();
     }
 
@@ -474,8 +474,8 @@ class XnetGrpModule extends PLModule
                                           CONCAT(al.alias,"@polytechnique.org"),
                                            m.email)
                                  FROM  group_members AS m
-                           INNER JOIN  #x4dat#.aliases   AS al ON (al.type = "a_vie"
-                                                                 AND al.id = m.uid)
+                           INNER JOIN  aliases   AS al ON (al.type = "a_vie"
+                                                                 AND al.uid = m.uid)
                                 WHERE  perms="admin" AND m.asso_id = {?}',
                              $globals->asso('id'));
             $emails = $res->fetchColumn();
@@ -532,7 +532,7 @@ class XnetGrpModule extends PLModule
 
         $it = XDB::iterator('SELECT  s.uid, a.hruid, s.ts AS date
                                FROM  group_member_sub_requests AS s
-                         INNER JOIN  #x4dat#.accounts AS a ON(s.uid = a.uid)
+                         INNER JOIN  accounts AS a ON(s.uid = a.uid)
                               WHERE  s.asso_id = {?}
                            ORDER BY  s.ts',  $globals->asso('id'));
         $page->changeTpl('xnetgrp/subscribe-valid.tpl');
@@ -590,7 +590,7 @@ class XnetGrpModule extends PLModule
         $not_in_group_ext = array();
 
         foreach ($subscribers as $mail) {
-            $uf = new UserFilter(new UFC_And(new UFC_Group($globals->asso('id')),
+            $uf = new UserFilter(new PFC_And(new UFC_Group($globals->asso('id')),
                                              new UFC_Email($mail)));
             if ($uf->getTotalCount() == 0) {
                 if (User::isForeignEmailAddress($mail)) {
@@ -675,12 +675,12 @@ class XnetGrpModule extends PLModule
         }
         if (empty($users)) {
             list($nom, $prenom) = str_replace(array('-', ' ', "'"), '%', array(Env::t('nom'), Env::t('prenom')));
-            $cond = new UFC_And(new UFC_Not(new UFC_Registered()));
+            $cond = new PFC_And(new PFC_Not(new UFC_Registered()));
             if (!empty($nom)) {
-                $cond->addChild(new UFC_Name(UserFilter::LASTNAME, $nom, UFC_Name::CONTAINS));
+                $cond->addChild(new UFC_Name(Profile::LASTNAME, $nom, UFC_Name::CONTAINS));
             }
             if (!empty($prenom)) {
-                $cond->addChild(new UFC_Name(UserFilter::FIRSTNAME, $prenom, UFC_Name::CONTAINS));
+                $cond->addChild(new UFC_Name(Profile::FIRSTNAME, $prenom, UFC_Name::CONTAINS));
             }
             if (Env::i('promo')) {
                 $cond->addChild(new UFC_Promo('=', UserFilter::GRADE_ING, Env::i('promo')));
@@ -794,14 +794,14 @@ class XnetGrpModule extends PLModule
 
     private function changeLogin(PlPage &$page, PlUser &$user, MMList &$mmlist, $login)
     {
-        require_once 'user.func.inc.php';
         // Search the uid of the user...
-        $res = XDB::query("SELECT  f.id, f.alias
+        $res = XDB::query("SELECT  f.uid, f.alias
                              FROM  aliases AS a
-                       INNER JOIN  aliases AS f ON (f.id = a.id AND f.type = 'a_vie')
+                       INNER JOIN  aliases AS f ON (f.uid = a.uid AND f.type = 'a_vie')
                             WHERE  a.alias = {?}",
                           $login);
         if ($res->numRows() == 0) {
+            // TODO: replace this call to a removed function.
             $x = get_not_registered_user($login);
             if (!$x) {
                 $page->trigError("Le login $login ne correspond à aucun X.");