Subversion Repositories Applications.projet

Rev

Rev 431 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?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: projet.modification.inc.php,v 1.4 2008-09-16 14:10:06 alexandre_tb Exp $
/**
* Inscription
*
* Le fichier de modification de projet, appele par l'inscription
* en cas de modification d'un utilisateur
*
*@package projet
//Auteur original :
*@author        Aurelien Peronnet <aurelien@tela-botanica.org>
*@copyright     Tela-Botanica 2000-2006
// +------------------------------------------------------------------------------------------------------+
*/

// +------------------------------------------------------------------------------------------------------+
// |                                            ENTETE du PROGRAMME                                       |
// +------------------------------------------------------------------------------------------------------+

// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
// On se trouve dans la fonction afficherContenuCorps de inscription.php



include_once 'client/projet/configuration/projet.config.inc.php' ;
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
$participant = new participe($GLOBALS['ins_db']) ;


$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
    
// On boucle sur chaque projet et on desinscrit l'utilisateur
foreach ($tableau_projet as $projet) {
        
        // si le projet possède une liste associée    
        if ($projet->avoirListe()) {
                
                $est_abonne = '0' ;
                // on vérifie si l'utilisateur y est abonné 
                $projet->getListesAssociees() ;

                try {
                        $xml_abonne = new SimpleXMLElement(file_get_contents(URL_LISTE_ACTU.'est_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$ancien_mail)) ;
                        $est_abonne = $xml_abonne[0] ;
                                
                        // si c'est le cas
                        if($est_abonne == '1') { 
                            // on supprime l'ancien mail et on rajoute le nouveau
                                $suppression_abonne = file_get_contents(URL_LISTE_ACTU.'suppression_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$ancien_mail) ;
                                $suppression_abonne = file_get_contents(URL_LISTE_ACTU.'ajout_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$nouveau_mail) ;
                        }
                }
                catch(Exception $e) {
                        trigger_error($e->getMessage()) ;
                }
        
        }
}


?>