backport
authorPierre Habouzit (MadCoder <pierre.habouzit@m4x.org>
Tue, 18 Jan 2005 21:32:54 +0000 (21:32 +0000)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Thu, 26 Jun 2008 21:27:49 +0000 (23:27 +0200)
Patches applied:

 * opensource@polytechnique.org--2005/platal--release--0.9.3--patch-34
   small fixups

git-archimport-id: opensource@polytechnique.org--2005/platal--mainline--0.9--patch-383

htdocs/groupex/export-econfiance.php

index 2a0aa15..67af238 100644 (file)
@@ -22,8 +22,9 @@
 
 /* Script permettant l'export de la liste des membres de la mailing list eConfiance, pour intégration par J-P Figer dans la liste des membres de X-Informatique */
 
-require_once("xorg.inc.php");
-require_once("xml-rpc-client.inc.php");
+require_once('xorg.inc.php');
+require_once('xml-rpc-client.inc.php');
+require_once('lists.inc.php');
 
 $cle = $globals->econfiance;
 
@@ -32,7 +33,7 @@ if (isset($_SESSION["chall"]) && $_SESSION["chall"] != "" && $_GET["PASS"] == md
     $res  = $globals->xdb->query("SELECT password FROM auth_user_md5 WHERE user_id=10154");
     $pass = $res->fetchOneCell();
 
-    $client = new xmlrpc_client("http://10154:$pass@localhost:4949/polytechnique.org");
+    $client =& lists_xmlrpc(10154, $pass, "polytechnique.org");
     $members = $client->get_members('x-econfiance');
     if(is_array($members)) {
         $membres = Array();
@@ -45,7 +46,7 @@ if (isset($_SESSION["chall"]) && $_SESSION["chall"] != "" && $_GET["PASS"] == md
 
     $where = join(' OR ',$membres);
 
-    $all = $globals->xdb->fetchRow(
+    $all = $globals->xdb->iterRow(
             "SELECT  u.prenom,u.nom,a.alias
                FROM  auth_user_md5 AS u
          INNER JOIN  aliases       AS a ON ( u.user_id = a.id AND a.type!='homonyme' )
@@ -56,9 +57,9 @@ if (isset($_SESSION["chall"]) && $_SESSION["chall"] != "" && $_GET["PASS"] == md
 
     while (list ($prenom1,$nom1,$email1) = $all->next()) {
             $res .= "<membre>\n";
-            $res .= "\t<nom>".$nom1."</nom>\n";
-            $res .= "\t<prenom>".$prenom1."</prenom>\n";
-            $res .= "\t<email>".$email1."</email>\n";
+            $res .= "\t<nom>".utf8_encode($nom1)."</nom>\n";
+            $res .= "\t<prenom>".utf8_encode($prenom1)."</prenom>\n";
+            $res .= "\t<email>".utf8_encode($email1)."</email>\n";
             $res .= "</membre>\n\n";
     }