Subversion Repositories Applications.papyrus

Rev

Rev 1574 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1574 Rev 1588
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.31 2007-09-06 08:39:08 alexandre_tb Exp $
22
// CVS : $Id: inscription.php,v 1.32 2007-09-07 09:18:23 alexandre_tb Exp $
23
/**
23
/**
24
* Inscription
24
* Inscription
25
*
25
*
26
* Un module d'inscription, en general ce code est specifique a
26
* Un module d'inscription, en general ce code est specifique a
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-2007
34
*@copyright     Tela-Botanica 2000-2007
35
*@version       $Revision: 1.31 $ $Date: 2007-09-06 08:39:08 $
35
*@version       $Revision: 1.32 $ $Date: 2007-09-07 09:18:23 $
36
// +------------------------------------------------------------------------------------------------------+
36
// +------------------------------------------------------------------------------------------------------+
37
*/
37
*/
Line 38... Line 38...
38
 
38
 
39
// +------------------------------------------------------------------------------------------------------+
39
// +------------------------------------------------------------------------------------------------------+
Line 170... Line 170...
170
        }
170
        }
Line 171... Line 171...
171
	
171
	
172
        if ($_REQUEST['action'] == 'inscription_v') {
172
        if ($_REQUEST['action'] == 'inscription_v') {
173
            $formulaire->registerRule('doublonmail', 'callback', 'inscription_verif_doublonMail');
173
            $formulaire->registerRule('doublonmail', 'callback', 'inscription_verif_doublonMail');
-
 
174
	        $formulaire->addRule('email', INS_MAIL_DOUBLE, 'doublonmail');
174
	        $formulaire->addRule('email', INS_MAIL_DOUBLE, 'doublonmail');
175
	        if (isset($_SESSION['inscription_termine'])) return $res . info();
175
            if ($formulaire->validate()) {
176
            if ($formulaire->validate()) {
176
			    if ($GLOBALS['ins_config']['ic_mail_valide_inscription']) {
177
			    if ($GLOBALS['ins_config']['ic_mail_valide_inscription']) {
177
				    $formulaire->process('inscription_demande', false) ;
178
				    $formulaire->process('inscription_demande', false) ;
178
				    return $res.INS_MESSAGE_INSCRIPTION;
179
				    return $res.INS_MESSAGE_INSCRIPTION;
179
			    } else {
180
			    } else {
180
				    if ($GLOBALS['ins_config']['ic_inscription_modere']) {
181
				    if ($GLOBALS['ins_config']['ic_inscription_modere']) {
181
				    	inscription::demandeInscriptionModere($formulaire->getSubmitValues());
182
				    	inscription::demandeInscriptionModere($formulaire->getSubmitValues());
182
				    	return inscription::getTemplate(INS_TEMPLATE_MESSAGE_INSCRIPTION_MODEREE, $GLOBALS['ins_config']['ic_id_inscription']);	
183
				    	return inscription::getTemplate(INS_TEMPLATE_MESSAGE_INSCRIPTION_MODEREE, $GLOBALS['ins_config']['ic_id_inscription']);	
-
 
184
				    }
183
				    }				    
185
				    if (!isset($_SESSION['inscription_termine'])) {
184
				    $formulaire->process('inscription_validee', false) ;				    
186
					    $formulaire->process('inscription_validee', false) ;				    
185
				    $id_utilisateur = $GLOBALS['ins_db']->getOne('SELECT MAX('.INS_CHAMPS_ID.') FROM '.INS_ANNUAIRE) ;				    
187
					    $id_utilisateur = $GLOBALS['ins_db']->getOne('SELECT MAX('.INS_CHAMPS_ID.') FROM '.INS_ANNUAIRE) ;				    
186
				    // Appel des actions des inscriptions des applications clientes
188
					    // Appel des actions des inscriptions des applications clientes
187
			        $d = dir(GEN_CHEMIN_CLIENT);
189
				        $d = dir(GEN_CHEMIN_CLIENT);
188
					while (false !== ($repertoire = $d->read())) {
190
						while (false !== ($repertoire = $d->read())) {
189
						if ($repertoire != '.' && $repertoire != '..') {
191
							if ($repertoire != '.' && $repertoire != '..') {
190
							if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php'))
192
								if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php'))
191
							include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ;
193
								include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ;
192
						}   
194
							}   
193
					}
195
						}
-
 
196
						$d->close();
-
 
197
				    }
194
					$d->close();
198
					$_SESSION['incsription_termine'] = 1;
195
				    return $res.info($id_utilisateur);
199
				    return $res.info($id_utilisateur);
196
			    }
200
			    }
197
            } else {
201
            } else {
198
            	// Si le formulaire n'est pas bon on remet l'action inscription_v
202
            	// Si le formulaire n'est pas bon on remet l'action inscription_v
Line 205... Line 209...
205
            } else {
209
            } else {
206
            	return $formulaire->toHTML();
210
            	return $formulaire->toHTML();
207
            }
211
            }
208
            return $res.info();
212
            return $res.info();
209
        }
213
        }
210
	
-
 
211
        return $res.$formulaire->toHTML() ;
214
        return $res.$formulaire->toHTML() ;
212
    }
215
    }
Line 213... Line 216...
213
    
216
    
214
//cas de la validation par mail d'une inscription--------------------------------------------------------
217
//cas de la validation par mail d'une inscription--------------------------------------------------------
Line 307... Line 310...
307
}
310
}
Line 308... Line 311...
308
 
311
 
309
/* +--Fin du code ----------------------------------------------------------------------------------------+
312
/* +--Fin du code ----------------------------------------------------------------------------------------+
310
*
313
*
-
 
314
* $Log: not supported by cvs2svn $
-
 
315
* Revision 1.31  2007-09-06 08:39:08  alexandre_tb
-
 
316
* envoie de cookie pour desinscription different selon que l on est dans papyrus
-
 
317
* ou en stand-alone
311
* $Log: not supported by cvs2svn $
318
*
312
* Revision 1.30  2007-08-28 15:13:25  alexandre_tb
319
* Revision 1.30  2007-08-28 15:13:25  alexandre_tb
313
* gestion du lien "mot de passe oublie"
320
* gestion du lien "mot de passe oublie"
314
*
321
*
315
* Revision 1.29  2007-08-27 12:34:32  alexandre_tb
322
* Revision 1.29  2007-08-27 12:34:32  alexandre_tb