Subversion Repositories Applications.projet

Rev

Rev 249 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 249 Rev 359
Line 1... Line 1...
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
-
 
3
// +------------------------------------------------------------------------------------------------------+
-
 
4
// | PHP version 4.1                                                                                      |
-
 
5
// +------------------------------------------------------------------------------------------------------+
-
 
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
-
 
7
// +------------------------------------------------------------------------------------------------------+
-
 
8
// | This library is free software; you can redistribute it and/or                                        |
-
 
9
// | modify it under the terms of the GNU General Public                                                  |
-
 
10
// | License as published by the Free Software Foundation; either                                         |
-
 
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
-
 
12
// |                                                                                                      |
-
 
13
// | This library is distributed in the hope that it will be useful,                                      |
-
 
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
-
 
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
-
 
16
// | General Public License for more details.                                                             |
-
 
17
// |                                                                                                      |
-
 
18
// | You should have received a copy of the GNU General Public                                            |
-
 
19
// | License along with this library; if not, write to the Free Software                                  |
-
 
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
-
 
21
// +------------------------------------------------------------------------------------------------------+
-
 
22
// CVS : $Id: liste_abonnes.php,v 1.3 2007-06-25 12:15:06 alexandre_tb Exp $
-
 
23
/**
-
 
24
* Application projet
-
 
25
*
-
 
26
* Le service liste abonne
-
 
27
*
-
 
28
*@package projet
-
 
29
//Auteur original :
-
 
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
-
 
31
//Autres auteurs :
-
 
32
*@author        Aucun
-
 
33
*@copyright     Tela-Botanica 2000-2004
-
 
34
*@version       $Revision: 1.3 $
-
 
35
// +------------------------------------------------------------------------------------------------------+
-
 
36
*/
-
 
37
 
-
 
38
/* Le service attend 2 parametres
-
 
39
 * domaine string	le nom de domaine de la liste
-
 
40
 * liste	string	le nom de la liste
-
 
41
 * renvoie	string 	une chaine xml avec la liste des mails des inscrits
-
 
42
 * 
-
 
43
 * <ezmlm_liste_abonnes domaine="dom" liste="list">
-
 
44
 * <email>toto@tsdd...</email>
-
 
45
 * <email>qsdf@fdsq ..</email>
-
 
46
 * ...
-
 
47
 * </ezmlm_liste_abonnes>
-
 
48
 */
-
 
Line -... Line 2...
-
 
2
 
-
 
3
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
Line 49... Line 4...
49
 
4
exec ('ezmlm-list '.$repertoire, $output, $ret) ;
Line 50... Line 5...
50
 
5
 
Line 51... Line 6...
51
include_once 'XML/Util.php' ;
6
include_once 'XML/Util.php' ;
Line 52... Line -...
52
 
-
 
53
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
-
 
54
 
-
 
55
// Les 2 parametres doivent etres present
-
 
56
 
-
 
57
if (!isset($_GET['domaine']) || !isset($_GET['liste'])) {
-
 
58
	$xml .= XML_Util::createTag('erreur', 'Vous devez sp&eacute;cifier un domaine et une liste');
7
 
59
} else {
-
 
60
	$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
-
 
Line -... Line 8...
-
 
8
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
61
	exec ('ezmlm-list '.$repertoire, $output, $ret) ;
9
 
62
	$xml .= XML_Util::createStartElement ('ezmlm_liste_abonnes', array('domaine' => $domaine, 'liste' => $liste)) ;
10
$xml .= XML_Util::createStartElement ('ezmlm_liste_abonnes', array('domaine' => $domaine, 'liste' => $liste)) ;
63
	foreach ($output as $mail) $xml .= XML_Util::createTag('email', '', $mail) ;
-
 
64
	$xml .= XML_Util::createEndElement('ezmlm_liste_abonnes') ;
-
 
65
}
-
 
66
 
-
 
67
header ('Content-type: text/xml');
-
 
68
echo $xml ;
-
 
69
 
-
 
70
/* +--Fin du code ----------------------------------------------------------------------------------------+
-
 
71
* $Log: not supported by cvs2svn $
-
 
72
* Revision 1.2.2.1  2007-05-11 09:45:35  alexandre_tb
-
 
73
* ajout de commentaire et de la gestion des erreurs
11
 
-
 
12
foreach ($output as $mail) $xml .= XML_Util::createTag('email', '', $mail) ;