788 |
alexandre_ |
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 |
// +------------------------------------------------------------------------------------------------------+
|
825 |
alexandre_ |
22 |
// CVS : $Id: projet.desinscription.inc.php,v 1.2 2006-04-19 13:52:54 alexandre_tb Exp $
|
788 |
alexandre_ |
23 |
/**
|
|
|
24 |
* Inscription
|
|
|
25 |
*
|
|
|
26 |
* Le fichier de désinscription de projet, appelé par l'inscription
|
|
|
27 |
* en cas de désinscription d'un utilisateur
|
|
|
28 |
*
|
|
|
29 |
*@package projet
|
|
|
30 |
//Auteur original :
|
|
|
31 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
|
|
32 |
*@copyright Tela-Botanica 2000-2006
|
825 |
alexandre_ |
33 |
*@version $Revision: 1.2 $
|
788 |
alexandre_ |
34 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
35 |
*/
|
|
|
36 |
|
|
|
37 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
38 |
// | ENTETE du PROGRAMME |
|
|
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
|
|
40 |
|
|
|
41 |
// On récupère id_utilisateur, l'identifiant de la personne qui se désinscrit
|
|
|
42 |
// On se trouve dans la fonction afficherContenuCorps de inscription.php
|
|
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
|
46 |
include_once 'client/projet/configuration/projet.config.inc.php' ;
|
825 |
alexandre_ |
47 |
include_once PROJET_CHEMIN_CLASSES.'projet.class.php' ;
|
788 |
alexandre_ |
48 |
include_once PROJET_CHEMIN_CLASSES.'participe.class.php' ;
|
|
|
49 |
$participant = new participe($GLOBALS['ins_db']) ;
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
$tableau_projet = projet::getTousLesProjets($GLOBALS['ins_db']) ;
|
|
|
53 |
|
|
|
54 |
// On boucle sur chaque projet et on désinscrit l'utilisateur
|
|
|
55 |
foreach ($tableau_projet as $projet) {
|
|
|
56 |
// Le statut 4 désinscrit l'utilisateur, dans la méthode setStatut
|
|
|
57 |
$participant->setStatut(4, $id_utilisateur, $projet->getId()) ;
|
|
|
58 |
$projet->getListesAssociees() ;
|
|
|
59 |
if ($projet->avoirListe()) {
|
|
|
60 |
include_once PROJET_CHEMIN_CLASSES.'annuaire.class.php' ;
|
|
|
61 |
$annuaire = new annuaire($this->_db, array('identifiant' => PROJET_CHAMPS_ID, 'mail' => PROJET_CHAMPS_MAIL, 'table' => PROJET_ANNUAIRE)) ;
|
|
|
62 |
$annuaire->setId($id_utilisateur) ;
|
|
|
63 |
include_once PROJET_CHEMIN_CLASSES.'inscription_liste.class.php' ;
|
|
|
64 |
$desinscription= new inscription_liste($GLOBALS['ins_db']) ;
|
|
|
65 |
$desinscription->desinscrireUtilisateur($annuaire, $projet->_listes_associes[0]) ;
|
|
|
66 |
}
|
|
|
67 |
}
|
|
|
68 |
|
|
|
69 |
|
|
|
70 |
?>
|