Subversion Repositories Applications.projet

Rev

Rev 352 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 352 Rev 431
Line 1... Line 1...
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
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                                  |
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                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: projet.modification.inc.php,v 1.1 2008-10-27 16:56:08 aperonnet Exp $
22
// CVS : $Id: projet.modification.inc.php,v 1.4 2008-09-16 14:10:06 alexandre_tb Exp $
23
/**
23
/**
24
* Inscription
24
* Inscription
25
*
25
*
26
* Le fichier de modification de projet, appele par l'inscription
26
* Le fichier de modification de projet, appele par l'inscription
27
* en cas de modification d'un utilisateur
27
* en cas de modification d'un utilisateur
28
*
28
*
29
*@package projet
29
*@package projet
30
//Auteur original :
30
//Auteur original :
31
*@author        Aurelien Peronnet <aurelien@tela-botanica.org>
31
*@author        Aurelien Peronnet <aurelien@tela-botanica.org>
32
*@copyright     Tela-Botanica 2000-2006
32
*@copyright     Tela-Botanica 2000-2006
33
// +------------------------------------------------------------------------------------------------------+
33
// +------------------------------------------------------------------------------------------------------+
34
*/
34
*/
35
 
35
 
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
// |                                            ENTETE du PROGRAMME                                       |
37
// |                                            ENTETE du PROGRAMME                                       |
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
 
39
 
40
// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
40
// On recupere id_utilisateur, l'identifiant de la personne qui se desinscrit
41
// On se trouve dans la fonction afficherContenuCorps de inscription.php
41
// On se trouve dans la fonction afficherContenuCorps de inscription.php
42
 
42
 
43
 
43
 
44
 
44
 
45
include_once 'client/projet/configuration/projet.config.inc.php' ;
45
include_once 'client/projet/configuration/projet.config.inc.php' ;
46
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
46
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
47
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
47
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
48
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
48
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
49
$participant = new participe($GLOBALS['ins_db']) ;
49
$participant = new participe($GLOBALS['ins_db']) ;
50
 
50
 
51
 
51
 
52
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
52
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
53
    
53
    
54
// On boucle sur chaque projet et on desinscrit l'utilisateur
54
// On boucle sur chaque projet et on desinscrit l'utilisateur
55
foreach ($tableau_projet as $projet) {
55
foreach ($tableau_projet as $projet) {
56
	
56
	
57
	// si le projet possède une liste associée	
57
	// si le projet possède une liste associée	
58
	if ($projet->avoirListe()) {
58
	if ($projet->avoirListe()) {
59
		
59
		
60
		$est_abonne = '0' ;
60
		$est_abonne = '0' ;
61
		// on vérifie si l'utilisateur y est abonné 
61
		// on vérifie si l'utilisateur y est abonné 
62
		$projet->getListesAssociees() ;
62
		$projet->getListesAssociees() ;
63
 
63
 
64
		try {
64
		try {
65
			$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)) ;
65
			$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)) ;
66
			$est_abonne = $xml_abonne[0] ;
66
			$est_abonne = $xml_abonne[0] ;
67
				
67
				
68
			// si c'est le cas
68
			// si c'est le cas
69
			if($est_abonne == '1') { 
69
			if($est_abonne == '1') { 
70
			    // on supprime l'ancien mail et on rajoute le nouveau
70
			    // on supprime l'ancien mail et on rajoute le nouveau
71
				$suppression_abonne = file_get_contents(URL_LISTE_ACTU.'suppression_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$ancien_mail) ;
71
				$suppression_abonne = file_get_contents(URL_LISTE_ACTU.'suppression_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$ancien_mail) ;
72
				$suppression_abonne = file_get_contents(URL_LISTE_ACTU.'ajout_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$nouveau_mail) ;
72
				$suppression_abonne = file_get_contents(URL_LISTE_ACTU.'ajout_abonne.php?domaine=tela-botanica.org&liste='.$projet->_listes_associes[0]->getNom().'&mail='.$nouveau_mail) ;
73
			}
73
			}
74
		}
74
		}
75
		catch(Exception $e) {
75
		catch(Exception $e) {
76
			trigger_error($e->getMessage()) ;
76
			trigger_error($e->getMessage()) ;
77
		}
77
		}
78
	
78
	
79
	}
79
	}
80
}
80
}
81
 
81
 
82
 
82
 
83
?>
83
?>
84
84