Subversion Repositories Applications.papyrus

Rev

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

Rev 739 Rev 743
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.8 2006-02-14 10:21:08 alexandre_tb Exp $
22
// CVS : $Id: inscription.php,v 1.9 2006-02-28 14:08:27 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.8 $ $Date: 2006-02-14 10:21:08 $
35
*@version       $Revision: 1.9 $ $Date: 2006-02-28 14:08:27 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
*/
37
*/
Line 38... Line 38...
38
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
Line 126... Line 126...
126
            }
126
            }
127
        }
127
        }
Line 128... Line 128...
128
	
128
	
129
        if ($_REQUEST['action'] == 'inscription_v') {
129
        if ($_REQUEST['action'] == 'inscription_v') {
130
            if ($formulaire->validate()) {
130
            if ($formulaire->validate()) {
131
		    if (INS_MAIL_VALIDATION_INSCRIPTION) {
131
			    if (INS_MAIL_VALIDATION_INSCRIPTION) {
132
			    $formulaire->process('demande_inscription', false) ;
132
				    $formulaire->process('demande_inscription', false) ;
133
			    return $res.INS_MESSAGE_INSCRIPTION;
133
				    return $res.INS_MESSAGE_INSCRIPTION;
134
		    } else {
134
			    } else {
-
 
135
				    $formulaire->process('inscription_validee', false) ;
-
 
136
				    // Appel des actions desinscriptions des applications clientes
-
 
137
			        $d = dir(GEN_CHEMIN_CLIENT);
-
 
138
					while (false !== ($repertoire = $d->read())) {
-
 
139
						if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php'))
-
 
140
						include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ;   
-
 
141
					}
135
			    $formulaire->process('inscription_validee', false) ;
142
					$d->close();
136
			    return $res.info();
143
				    return $res.info();
137
		    }
144
			    }
138
            }
145
            }
139
        }
146
        }
140
        if ($_REQUEST['action'] == 'modifier_v') {
147
        if ($_REQUEST['action'] == 'modifier_v') {
141
            if ($formulaire->validate()) {
148
            if ($formulaire->validate()) {
Line 157... Line 164...
157
	    if ($resultat->numRows() == 0) {
164
	    if ($resultat->numRows() == 0) {
158
		    return $res.INS_MESSAGE_EXPIRATION;
165
		    return $res.INS_MESSAGE_EXPIRATION;
159
	    }
166
	    }
160
	    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
167
	    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
161
	    $donnees = unserialize (stripslashes($ligne->id_donnees)) ;
168
	    $donnees = unserialize (stripslashes($ligne->id_donnees)) ;
162
	    insertion($donnees) ;
169
	    $id_utilisateur = insertion($donnees) ;
163
	    $GLOBALS['AUTH']->username = $donnees['email'] ;
170
	    $GLOBALS['AUTH']->username = $donnees['email'] ;
164
	    $GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ;
171
	    $GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ;
Line 165... Line 172...
165
	    
172
	    
166
	    // On loggue l'utilisateur
173
	    // On loggue l'utilisateur
Line 174... Line 181...
174
	    $requete = 'delete from inscription_demande where id_identifiant_session="'.$_GET['id'].'"' ;
181
	    $requete = 'delete from inscription_demande where id_identifiant_session="'.$_GET['id'].'"' ;
175
	    $resultat = $GLOBALS['ins_db']->query($requete) ;
182
	    $resultat = $GLOBALS['ins_db']->query($requete) ;
176
	    if (DB::isError($resultat)) {
183
	    if (DB::isError($resultat)) {
177
		    die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
184
		    die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
178
	    }
185
	    }
-
 
186
	    // Appel des actions desinscriptions des applications clientes
-
 
187
        $d = dir(GEN_CHEMIN_CLIENT);
-
 
188
		while (false !== ($repertoire = $d->read())) {
-
 
189
			if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php'))
-
 
190
			include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ;   
-
 
191
		}
-
 
192
		$d->close();
179
	    envoie_mail() ;
193
	    envoie_mail() ;
180
    }
194
    }
Line 181... Line 195...
181
    
195
    
182
    if ((!$GLOBALS['AUTH']->getAuth())&&($_REQUEST['action']!='inscription')&&($_REQUEST['action']!='inscription_v')) {    
196
    if ((!$GLOBALS['AUTH']->getAuth())&&($_REQUEST['action']!='inscription')&&($_REQUEST['action']!='inscription_v')) {    
Line 196... Line 210...
196
}
210
}
Line 197... Line 211...
197
 
211
 
198
/* +--Fin du code ----------------------------------------------------------------------------------------+
212
/* +--Fin du code ----------------------------------------------------------------------------------------+
199
*
213
*
-
 
214
* $Log: not supported by cvs2svn $
-
 
215
* Revision 1.8  2006/02/14 10:21:08  alexandre_tb
-
 
216
* ajout d'un appel à un fichier de classe personnalisé
200
* $Log: not supported by cvs2svn $
217
*
201
* Revision 1.7  2005/12/19 13:16:14  alexandre_tb
218
* Revision 1.7  2005/12/19 13:16:14  alexandre_tb
202
* correction d'un bug
219
* correction d'un bug
203
*
220
*
204
* Revision 1.6  2005/11/18 16:04:15  florian
221
* Revision 1.6  2005/11/18 16:04:15  florian