Subversion Repositories Applications.projet

Rev

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

Rev Author Line No. Line
431 mathias 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 Lesser 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
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser 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: projet.modification.inc.php,v 1.4 2008-09-16 14:10:06 alexandre_tb Exp $
23
/**
24
* Inscription
25
*
26
* Le fichier de modification de projet, appele par l'inscription
27
* en cas de modification d'un utilisateur
28
*
29
*@package projet
30
//Auteur original :
31
*@author        Aurelien Peronnet <aurelien@tela-botanica.org>
32
*@copyright     Tela-Botanica 2000-2006
33
// +------------------------------------------------------------------------------------------------------+
34
*/
35
 
36
// +------------------------------------------------------------------------------------------------------+
37
// |                                            ENTETE du PROGRAMME                                       |
38
// +------------------------------------------------------------------------------------------------------+
39
 
40
// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
41
// On se trouve dans la fonction afficherContenuCorps de inscription.php
42
 
43
 
44
 
437 mathias 45
include_once 'configuration/projet.config.inc.php' ;
46
//include_once 'reseau/projet/configuration/projet.config.inc.php' ;
431 mathias 47
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
48
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
49
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
50
$participant = new participe($GLOBALS['ins_db']) ;
51
 
52
 
53
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
54
 
55
// On boucle sur chaque projet et on desinscrit l'utilisateur
56
foreach ($tableau_projet as $projet) {
57
 
437 mathias 58
	// si le projet poss�de une liste associ�e
431 mathias 59
	if ($projet->avoirListe()) {
60
 
61
		$est_abonne = '0' ;
437 mathias 62
		// on v�rifie si l'utilisateur y est abonn�
431 mathias 63
		$projet->getListesAssociees() ;
64
 
65
		try {
66
			$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)) ;
67
			$est_abonne = $xml_abonne[0] ;
68
 
69
			// si c'est le cas
70
			if($est_abonne == '1') {
71
			    // on supprime l'ancien mail et on rajoute le nouveau
72
				$suppression_abonne = file_get_contents(URL_LISTE_ACTU.'suppression_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$ancien_mail) ;
73
				$suppression_abonne = file_get_contents(URL_LISTE_ACTU.'ajout_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$nouveau_mail) ;
74
			}
75
		}
76
		catch(Exception $e) {
77
			trigger_error($e->getMessage()) ;
78
		}
79
 
80
	}
81
}
82
 
83
 
352 aperonnet 84
?>