Subversion Repositories Applications.projet

Compare Revisions

No changes between revisions

Ignore whitespace Rev 263 → Rev 367

/tags/v3.0-aha/synchroliste/vpopmail/suppression_abonne.php
New file
0,0 → 1,7
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
 
echo exec ('ezmlm-unsub '.$repertoire.' '.$mail, $output, $ret) ;
echo 'ezmlm-unsub '.$repertoire.' '.$mail;
?>
/tags/v3.0-aha/synchroliste/vpopmail/forumRSS.php
New file
0,0 → 1,48
<?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 Lesser 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 |
// | Lesser General Public License for more details. |
// | |
// | You should have received a copy of the GNU Lesser 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: forumRSS.php,v 1.1 2005-11-23 11:40:49 alexandre_tb Exp $
/**
* Générateur de flux RSS à partir d'une liste
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
*
*@copyright Tela-Botanica 2000-2004
*@version $$
// +------------------------------------------------------------------------------------------------------+
*/
 
include_once 'ezmlm-php-2.0/ezmlm-xml.php' ;
 
// test des variables
 
if (!isset($domaine) || !isset($liste)) {
exit() ;
}
 
$list = new ezmlm_xml() ;
$list->listdir = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
header('Content-type: text/xml') ;
$list->show_rss() ;
?>
/tags/v3.0-aha/synchroliste/vpopmail/ajout_abonne.php
New file
0,0 → 1,7
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
 
echo exec ('ezmlm-sub '.$repertoire.' '.$mail, $output, $ret) ;
echo 'ezmlm-sub '.$repertoire.' '.$mail;
?>
/tags/v3.0-aha/synchroliste/vpopmail/creation_liste.php
New file
0,0 → 1,16
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$fichier_qmail = '/home/vpopmail/domains/'.$domaine.'/.qmail-'.$liste ;
 
 
// Transformation de ma chaine $parametres ((de aBud en -a -B -u -D)
$para = '' ;
for ($i = 0; $i < count ($parametres); $i++) {
$para .= '-'.$parametres.' ' ;
}
// On ajoute que la réponse doit repartir à la liste
$para .= ' -3 '.$liste.'@'.$domaine;
echo exec ('ezmlm-make '.$para.' '.$repertoire.' '.$fichier_qmail.' '.$liste.' '.$domaine, $output, $ret) ;
 
?>
/tags/v3.0-aha/synchroliste/vpopmail/liste_abonnes.php
New file
0,0 → 1,18
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
//echo $repertoire;
exec ('ezmlm-list '.$repertoire, $output, $ret) ;
 
include_once 'XML/Util.php' ;
 
$xml = XML_Util::getXMLDeclaration('1.0', 'ISO-8859-15', 'no') ;
 
$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') ;
header ('Content-type: text/xml');
echo $xml ;
?>
/tags/v3.0-aha/synchroliste/vpopmail/ajout_moderateur.php
New file
0,0 → 1,7
<?php
 
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste.'/mod' ;
 
echo exec ('ezmlm-sub '.$repertoire.' '.$mail, $output, $ret) ;
echo 'ezmlm-sub '.$repertoire.' '.$mail ;
?>
/tags/v3.0-aha/synchroliste/vpopmail/suppression_liste.php
New file
0,0 → 1,19
<?php
 
if (!isset ($domaine) || $domaine == '' || !isset($liste) || $liste == '') {
die ('manque paramètre domaine ou liste') ;
}
$repertoire = '/home/vpopmail/domains/'.$domaine.'/'.$liste ;
$fichier_qmail = '/home/vpopmail/domains/'.$domaine.'/.qmail-' ;
 
 
echo exec ('rm '.$fichier_qmail.$liste, $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.$liste.'-default', $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.$liste.'-digest-owner', $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.$liste.'-digest-return-default', $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.$liste.'-owner', $output2, $ret2) ;
echo exec ('rm '.$fichier_qmail.$liste.'-return-default', $output2, $ret2) ;
 
echo exec ('rm -rf '.$repertoire, $output, $ret) ;
 
?>
/tags/v3.0-aha/synchroliste/fichier_attache.php
New file
0,0 → 1,86
<?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: fichier_attache.php,v 1.2 2005-09-27 16:46:06 alexandre_tb Exp $
/**
* Application projet
*
* Fichier pour afficher les pièces jointes
*
*@package projet
//Auteur original :
*@author Alexandre Granier <alexandre@tela-botanica.org>
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
 
// +------------------------------------------------------------------------------------------------------+
// | ENTETE du PROGRAMME |
// +------------------------------------------------------------------------------------------------------+
 
// A faire
 
include_once '../configuration/projet.config.inc.php' ;
include_once 'Mail/mimeDecode.php' ;
 
 
$num_rep = array_shift ($actionargs) ;
$num_message = array_shift($actionargs) ;
 
$mail = file_get_contents (PROJET_CHEMIN_LISTES.PROJET_DOMAINE_LISTE.'/'.$nom_liste.'/'.'archive/'.$num_rep.'/'.$num_message) ;
$decodeur = new Mail_mimeDecode($mail) ;
$mailDecode = $decodeur->decode(array ('decode_bodies' => 'true', 'include_bodies' => 'true')) ;
 
//var_dump ($mailDecode) ;
function getParts(&$part, $num_part) {
$part = $part->parts[$num_part] ;
return $part ;
}
 
for ($i = 0; $i < count ($actionargs); $i++) {
$part = getParts($mailDecode, $actionargs[$i]) ;
}
 
$content_type = $part->ctype_primary.'/'.$part->ctype_secondary ;
 
// Certain fichiers attaché n'ont pas de ctype_primary et ctype_secondary
if ($content_type == '/') {
$content_type = $part->content_type;
}
 
$nom_du_fichier = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : $part->ctype_parameters['name'] ;
//echo $content_type ;
 
header('Expires: Wen, 01 Dec 1999 01:00:00 GMT');// Date du passé
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');// toujours modifié
header('Cache-Control: Public');// HTTP/1.1
header ('Content-Type: '.$content_type."\r\n") ;
header("Content-Length: ".strlen($part->body).";\r\n");
header ('Content-Disposition: attachment; filename="'.$nom_du_fichier.'"'."\r\n");
header('Content-Transfer-Encoding: '.$part->content-transfer-encoding);
echo $part->body ;
exit(0) ;
 
?>
/tags/v3.0-aha/synchroliste/synchro_listes.php
New file
0,0 → 1,50
<?php
include_once "DB.php" ;
include_once "synchro_listes_conf.php";
 
// Formation du dsn
$dsn = SYN_PROTOCOLE."://".SYN_UTILISATEUR.":".SYN_MOT_DE_PASSE_DB."@".SYN_HOTE."/".SYN_BASE;
 
// Connection à la base
$db = & DB::connect($dsn) ;
 
 
include_once SYN_CHEMIN_GESTION_PROJET.'/classes/commande_serveur.class.php' ;
$commande_serveur = new commande_serveur(SYN_CHEMIN_GESTION_PROJET.'/script_cron/ezmlm.sh') ;
$commande_serveur->enleverToutesCommandes() ;
unset ($commande_serveur) ;
 
$requete = "select distinct pl_adresse_liste from projet_liste";
$resultat = $db->query ($requete);
if (DB::isError($resultat)) {
die ("Echec de la requete<br />".$resultat->getMessage()."<br />".$resultat->getDebugInfo()) ;
}
while ($ligne = $resultat->fetchRow (DB_FETCHMODE_ASSOC)) {
$nomliste=explode('@',$ligne['pl_adresse_liste']) ;
echo "\nSynchronisation de la liste ".$nomliste[0].":\n";
if (!is_dir(SYN_CHEMIN_GESTION_PROJET.'/synchroliste/liste/'.SYN_NOMDOMAINE)) {
mkdir(SYN_CHEMIN_GESTION_PROJET.'/synchroliste/liste/'.SYN_NOMDOMAINE);
}
$commande='/usr/bin/rsync -rptgo --delete --log-format="%o %f %l %t" /home/vpopmail/domains/'
.SYN_NOMDOMAINE.'/'.$nomliste[0].' '.SYN_CHEMIN_GESTION_PROJET.'/synchroliste/liste/'.SYN_NOMDOMAINE.' ';
echo exec ($commande, $sortie) ;
$commande = 'chmod 711 '.SYN_CHEMIN_GESTION_PROJET.'/synchroliste/liste/'.SYN_NOMDOMAINE.'/'.$nomliste[0] ;
echo" $commande\n";
echo exec($commande, $sortie);
$commande = 'chmod 750 '.SYN_CHEMIN_GESTION_PROJET.'/synchroliste/liste/'.SYN_NOMDOMAINE.'/'.$nomliste[0].'/archive/' ;
echo" $commande\n";
echo exec($commande, $sortie);
$commande = 'chmod 755 '.SYN_CHEMIN_GESTION_PROJET.'/synchroliste/liste/'.SYN_NOMDOMAINE.'/'.$nomliste[0].'/text/' ;
echo" $commande\n";
echo exec($commande, $sortie);$commande = 'chmod 755 '.SYN_CHEMIN_GESTION_PROJET.'/synchroliste/liste/'.SYN_NOMDOMAINE.'/'.$nomliste[0].'/text/info' ;
echo" $commande\n";
echo exec($commande, $sortie);
echo "\n--->Synchronisation terminée!!\n\n";
}
echo "\nMise à jour des droits sur le répertoire\n";
$commande='chown '.SYN_UTILISATEUR.':'.SYN_GROUPE.' '.SYN_CHEMIN_GESTION_PROJET.'/synchroliste/liste/ -R';
 
echo "$commande\n" ;
echo exec($commande, $sortie);
 
?>
/tags/v3.0-aha/synchroliste/liste/vide.txt
--- synchro_listes_conf.php (revision 0)
+++ synchro_listes_conf.php (revision 367)
@@ -0,0 +1,17 @@
+<?php
+/**
+//==================================== CONSTANTES ==================================
+* Constantes de l'appli de synchronisation
+//==================================================================================
+*/
+define ("SYN_PROTOCOLE", "mysql") ;
+define ("SYN_UTILISATEUR", "") ;
+define ("SYN_MOT_DE_PASSE_DB", "") ;
+define ("SYN_HOTE", "localhost") ;
+define ("SYN_BASE", "") ;
+define ("SYN_NOMDOMAINE", "");
+define ("SYN_CHEMIN_GESTION_PROJET", "") ;
+define ("SYN_CHEMIN_LOG", "") ;
+define ("SYN_UTILISATEUR", '') ;
+define ('SYN_GROUPE', '') ;
+?>