Subversion Repositories Applications.projet

Compare Revisions

Ignore whitespace Rev 10 → Rev 11

/trunk/classes/inscription_liste.class.php
19,7 → 19,7
// | 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: inscription_liste.class.php,v 1.1 2005-09-22 14:02:47 ddelon Exp $
// CVS : $Id: inscription_liste.class.php,v 1.2 2005-09-27 16:36:01 alexandre_tb Exp $
/**
* Application projet
*
31,7 → 31,7
//Autres auteurs :
*@author Aucun
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.1 $
*@version $Revision: 1.2 $
// +------------------------------------------------------------------------------------------------------+
*/
 
164,6 → 164,7
*/
function modifierTypeInscription( $liste, $utilisateur, $type_inscription )
{
/*
$requete = 'update projet_inscription_liste set '.
'pil_id_liste='.$liste->getId().', pil_id_statut='.$type_inscription.' where pil_id_utilisateur='.$utilisateur->getInfo('identifiant') ;
$resultat = $this->_db->query ($requete) ;
178,11 → 179,13
echo ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
}
*/
// envoie d'une demande d'inscription par email à la liste
include_once 'Mail.php' ;
//include_once 'Mail.php' ;
switch ($type_inscription) {
case 0 :
/*
$commande_serveur = new commande_serveur(PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ;
if (PEAR::isError($commande_serveur)) {
echo $commande_serveur->getMessage() ;
192,8 → 195,14
'/home/vpopmail/domains/'.$liste->getDomaine().'/'.$liste->getNom().' '.
$utilisateur->getInfo('mail');
$commande_serveur->ajouterCommande ($commande_supressoin_utilisateur) ;
*/
// Ajout du modérateur en tant qu'utilisateur
$resultat_suppression_utilisateur = file_get_contents ('http://vpopmail.'.$liste->getDomaine().'/suppression_abonne.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
 
break ;
case 1 :
/*
$commande_serveur = new commande_serveur(PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ;
if (PEAR::isError($commande_serveur)) {
echo $commande->getMessage() ;
215,8 → 224,10
$objet_mail =& Mail::factory('smtp');
$objet_mail->send($entetes['To'], $entetes, '');
*/
break ;
case 2 :
/*
$commande_serveur = new commande_serveur(PROJET_CHEMIN_APPLI.'script_cron/ezmlm.sh') ;
if (PEAR::isError($commande_serveur)) {
echo $commande_serveur->getMessage() ;
226,6 → 237,10
'/home/vpopmail/domains/'.$liste->getDomaine().'/'.$liste->getNom().' '.
$utilisateur->getInfo('mail');
$commande_serveur->ajouterCommande ($commande_ajout_utilisateur) ;
*/
// Ajout d'un utilisateur
$resultat_ajout_utilisateur = file_get_contents ('http://vpopmail.'.$liste->getDomaine().'/ajout_abonne.php?domaine='.
$liste->getDomaine().'&liste='.$liste->getNom().'&mail='.$utilisateur->getInfo('mail')) ;
break ;
}
} // end of member function modifierTypeInscription
239,8 → 254,9
*/
function getStatutsInscrit( $id_utilisateur )
{
$requete = 'select pil_id_liste, pil_id_statut from projet_inscription_liste where pil_id_utilisateur='.$id_utilisateur ;
$resultat = $this->_db->query ($requete) ;
$resultat = $this->_db->query ($requete) ;echo $requete;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
249,6 → 265,8
$tableau_resultat[$ligne->pil_id_liste] = $ligne->pil_id_statut ;
}
return $tableau_resultat ;
 
} // end of member function getStatutsInscrit
 
/**
259,8 → 277,9
* @return int
* @access public
*/
function getStatutInscrit( $id_liste, $id_utilisateur )
function getStatutInscrit( $id_liste, &$auth )
{
/*
$requete = 'select pil_id_liste, pil_id_statut from projet_inscription_liste where pil_id_utilisateur='.$id_utilisateur.
' and pil_id_liste='.$id_liste;
$resultat = $this->_db->query ($requete) ;
271,6 → 290,24
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
return $ligne->pil_id_statut;
*/
// Récupération de la liste des listes !!
$requete = 'select pl_nom_liste, pl_domaine from projet_liste where pl_id_liste='.$id_liste ;
$resultat = $this->_db->query ($requete) ;
if (DB::isError ($resultat)) {
die ('Echec de la requete : '.$requete.'<br />'.$resultat->getMessage()) ;
}
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
$xml = file_get_contents('http://vpopmail.'.$ligne->pl_domaine.'/liste_abonnes.php?domaine='.
$ligne->pl_domaine.'&liste='.$ligne->pl_nom_liste) ;
$tableau_mail = array() ;
$tableau_ligne = explode ('<email>', $xml) ;
foreach ($tableau_ligne as $ligne) array_push ($tableau_mail, strip_tags($ligne)) ;
array_shift($tableau_mail) ;
if (in_array($auth->getUsername(), $tableau_mail)) {
return 2; // Inscrit est le statut 2
}
return 0 ;
} // end of member function getStatutInscrit