Subversion Repositories Applications.papyrus

Rev

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

Rev 471 Rev 484
Line 17... Line 17...
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: inscription.php,v 1.2 2005-09-27 13:59:24 alexandre_tb Exp $
22
// CVS : $Id: inscription.php,v 1.3 2005-09-29 16:07:51 alexandre_tb Exp $
23
/**
23
/**
24
* Inscription
24
* Inscription
25
*
25
*
26
* Un module d'inscription, en général ce code est spécifique à
26
* Un module d'inscription, en général ce code est spécifique à
27
* un site web
27
* un site web
Line 30... Line 30...
30
//Auteur original :
30
//Auteur original :
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@author        Florian SCHMITT <florian@ecole-et-nature.org>
33
*@author        Florian SCHMITT <florian@ecole-et-nature.org>
34
*@copyright     Tela-Botanica 2000-2004
34
*@copyright     Tela-Botanica 2000-2004
35
*@version       $Revision: 1.2 $ $Date: 2005-09-27 13:59:24 $
35
*@version       $Revision: 1.3 $ $Date: 2005-09-29 16:07:51 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
*/
37
*/
Line 38... Line 38...
38
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
40
// |                                            ENTETE du PROGRAMME                                       |
40
// |                                            ENTETE du PROGRAMME                                       |
41
// +------------------------------------------------------------------------------------------------------+
41
// +------------------------------------------------------------------------------------------------------+
-
 
42
include_once 'configuration/bottin.config.inc.php';
-
 
43
if (!isset($GLOBALS['lang'])) {
-
 
44
    $GLOBALS['lang'] = INS_LANGUE_DEFAUT ;
-
 
45
}
42
include_once 'configuration/bottin.config.inc.php';
46
include_once INS_CHEMIN_APPLI."langues/bottin_langue_".$GLOBALS['lang'].".inc.php" ;
43
include_once INS_CHEMIN_APPLI.'configuration/inscription.config.inc.php';
47
include_once INS_CHEMIN_APPLI.'configuration/inscription.config.inc.php';
44
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php';
48
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php';
45
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php';
49
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php';
46
//test pour savoir si on est dans Papyrus
50
//test pour savoir si on est dans Papyrus
Line 68... Line 72...
68
        return AUTH_formulaire_login() ;
72
        return AUTH_formulaire_login() ;
69
    }
73
    }
Line 70... Line 74...
70
    
74
    
71
    // L'utilisateur a-t-il cliqué sur Supprimer inscription
75
    // L'utilisateur a-t-il cliqué sur Supprimer inscription
72
    if (isset ($_POST['supprimer'])) {
76
    if (isset ($_POST['supprimer'])) {
73
        $id_utilisateur = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ;
-
 
74
	
77
    	$id_utilisateur = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ;
Line 75... Line 78...
75
        $resultat = $GLOBALS['AUTH']->removeUser($id_utilisateur) ;
78
        $resultat = $GLOBALS['AUTH']->removeUser($GLOBALS['AUTH']->getUsername()) ;
76
	
79
	
77
        if (PEAR::isError($resultat)) {
80
        if (PEAR::isError($resultat)) {
78
        	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
81
        	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
79
        }
82
        }
80
        // Suppression dans SPIP
83
        // Suppression dans SPIP
81
        if (INS_UTILISE_SPIP) {
84
        if (INS_UTILISE_SPIP) {
82
            desinscription_spip($id_utilisateur) ;
85
            desinscription_spip($id_utilisateur) ;
83
        }
86
        }
84
	// Suppression dans Wikini
87
		// Suppression dans Wikini
85
        if (INS_UTILISE_WIKINI) {
88
        if (INS_UTILISE_WIKINI) {
86
		$nom_wiki = $GLOBALS['AUTH']->getAuthData(INS_NOM_WIKI) ;
89
			$nom_wiki = $GLOBALS['AUTH']->getAuthData(INS_NOM_WIKI) ;
-
 
90
			desinscription_interwikini_users($nom_wiki) ;
-
 
91
        }
-
 
92
        
-
 
93
        // Appel des actions desinscriptions des applications clientes
-
 
94
        $d = dir(GEN_CHEMIN_CLIENT);
-
 
95
		
-
 
96
		while (false !== ($repertoire = $d->read())) {
-
 
97
			if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php'))
-
 
98
			include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php' ;   
-
 
99
		}
87
		desinscription_interwikini_users($nom_wiki) ;
100
		$d->close();
88
        }
101
        
89
        $GLOBALS['AUTH']->logout() ;
102
        $GLOBALS['AUTH']->logout() ;
Line 90... Line 103...
90
        return $res.AUTH_formulaire_login() ;
103
        return $res.AUTH_formulaire_login() ;
Line 101... Line 114...
101
        $formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post', $action, '_self', '', 0) ;
114
        $formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post', $action, '_self', '', 0) ;
102
	$formulaire->construitFormulaire($action);
115
	$formulaire->construitFormulaire($action);
103
        if (isset($_POST['form_structure'])and($_POST['form_structure']==1)) {
116
        if (isset($_POST['form_structure'])and($_POST['form_structure']==1)) {
104
            $formulaire->formulaireStructure() ;
117
            $formulaire->formulaireStructure() ;
105
        }
118
        }
106
	
119
 
107
        if (isset($_POST['modifier'])) {
120
        if (isset($_POST['modifier'])) {
108
            $formulaire->addElement('hidden', 'action', 'modifier_v') ;
121
            $formulaire->addElement('hidden', 'action', 'modifier_v') ;
109
            $formulaire->setDefaults(formulaire_defaults()) ;
122
            $formulaire->setDefaults(formulaire_defaults()) ;
110
        }
123
        }
Line 111... Line 124...
111
	
124
	
112
        if ($_REQUEST['action'] == 'inscription') {
125
        if ($_REQUEST['action'] == 'inscription') {
113
            $formulaire->addElement('hidden', 'action', 'inscription_v') ;
126
            if ($GLOBALS['AUTH']->getAuth()) {
-
 
127
            	
-
 
128
            }else {
-
 
129
            	$formulaire->addElement('hidden', 'action', 'inscription_v') ;
114
            
130
            }
Line 115... Line 131...
115
        }
131
        }
116
	
132
	
117
        if ($_REQUEST['action'] == 'inscription_v') {
133
        if ($_REQUEST['action'] == 'inscription_v') {
Line 193... Line 209...
193
}
209
}
Line 194... Line 210...
194
 
210
 
195
/* +--Fin du code ----------------------------------------------------------------------------------------+
211
/* +--Fin du code ----------------------------------------------------------------------------------------+
196
*
212
*
-
 
213
* $Log: not supported by cvs2svn $
-
 
214
* Revision 1.2  2005/09/27 13:59:24  alexandre_tb
-
 
215
* correction de bogue, généralisation du code etc.
197
* $Log: not supported by cvs2svn $
216
*
198
* Revision 1.1  2005/09/22 14:02:49  ddelon
217
* Revision 1.1  2005/09/22 14:02:49  ddelon
199
* nettoyage annuaire et php5
218
* nettoyage annuaire et php5
200
*
219
*
201
* Revision 1.4  2005/09/22 13:30:49  florian
220
* Revision 1.4  2005/09/22 13:30:49  florian