+ $easy_to_link = XDB::iterator("SELECT
+ xorg.prenom, xorg.nom, xorg.promo, xorg.user_id, ax.id_ancien,
+ CONCAT(ax.prenom,' ',ax.nom_complet,' (X ',ax.promotion_etude,')') AS nom_ax,
+ COUNT(*) AS nbMatches
+ FROM fusionax_anciens AS ax
+ INNER JOIN fusionax_import AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
+ LEFT JOIN auth_user_md5 AS xorg ON (
+ xorg.matricule_ax IS NULL AND
+ ax.Nom_complet = xorg.nom AND
+ ax.prenom = xorg.prenom AND
+ xorg.promo = ax.promotion_etude)
+ GROUP BY xorg.user_id
+ HAVING
+ xorg.user_id IS NOT NULL AND
+ nbMatches = 1
+ ".($limit?('LIMIT '.$limit):''));
+ if ($easy_to_link->total() > 0 || $sure) {
+ return $easy_to_link;
+ }