Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 249 → Rev 359

/trunk/classes/ezmlm-php-2.0/services_vpopmail/liste_abonnes.php
1,78 → 1,17
<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1 |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org) |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU General Public |
// | License as published by the Free Software Foundation; either |
// | version 2.1 of the License, or (at your option) any later version. |
// | |
// | This library is distributed in the hope that it will be useful, |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public |
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: liste_abonnes.php,v 1.3 2007-06-25 12:15:06 alexandre_tb Exp $
/**
* Application projet
*
* Le service liste abonne
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.3 $
// +------------------------------------------------------------------------------------------------------+
*/
 
/* Le service attend 2 parametres
* domaine string le nom de domaine de la liste
* liste string le nom de la liste
* renvoie string une chaine xml avec la liste des mails des inscrits
*
* <ezmlm_liste_abonnes domaine="dom" liste="list">
* <email>toto@tsdd...</email>
* <email>qsdf@fdsq ..</email>
* ...
* </ezmlm_liste_abonnes>
*/
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
exec ('ezmlm-list '.$repertoire, $output, $ret) ;
 
 
include_once 'XML/Util.php' ;
 
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
// Les 2 parametres doivent etres present
$xml .= XML_Util::createStartElement ('ezmlm_liste_abonnes', array('domaine' => $domaine, 'liste' => $liste)) ;
 
if (!isset($_GET['domaine']) || !isset($_GET['liste'])) {
$xml .= XML_Util::createTag('erreur', 'Vous devez sp&eacute;cifier un domaine et une liste');
} else {
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
exec ('ezmlm-list '.$repertoire, $output, $ret) ;
$xml .= XML_Util::createStartElement ('ezmlm_liste_abonnes', array('domaine' => $domaine, 'liste' => $liste)) ;
foreach ($output as $mail) $xml .= XML_Util::createTag('email', '', $mail) ;
$xml .= XML_Util::createEndElement('ezmlm_liste_abonnes') ;
}
foreach ($output as $mail) $xml .= XML_Util::createTag('email', '', $mail) ;
 
$xml .= XML_Util::createEndElement('ezmlm_liste_abonnes') ;
header ('Content-type: text/xml');
echo $xml ;
 
/* +--Fin du code ----------------------------------------------------------------------------------------+
* $Log: not supported by cvs2svn $
* Revision 1.2.2.1 2007-05-11 09:45:35 alexandre_tb
* ajout de commentaire et de la gestion des erreurs
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
 
?>
?>