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.24 2007-05-25 14:31:10 alexandre_tb Exp $
|
22 |
// CVS : $Id: inscription.php,v 1.25 2007-06-01 13:37:56 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 general ce code est specifique a
|
27 |
* un site web
|
27 |
* un site web
|
28 |
*
|
28 |
*
|
29 |
*@package inscription
|
29 |
*@package inscription
|
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.24 $ $Date: 2007-05-25 14:31:10 $
|
35 |
*@version $Revision: 1.25 $ $Date: 2007-06-01 13:37:56 $
|
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';
|
42 |
include_once 'configuration/bottin.config.inc.php';
|
43 |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php';
|
43 |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php';
|
44 |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php';
|
44 |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php';
|
45 |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.class.php';
|
45 |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.class.php';
|
46 |
// Inclusion d'une classe personnalisé si elle existe
|
46 |
// Inclusion d'une classe personnalise si elle existe
|
47 |
if (file_exists (INS_CHEMIN_APPLI.'bibliotheque/inscription.class.local.php')) {
|
47 |
if (file_exists (INS_CHEMIN_APPLI.'bibliotheque/inscription.class.local.php')) {
|
48 |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.local.php' ;
|
48 |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.local.php' ;
|
49 |
} else {
|
49 |
} else {
|
50 |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php';
|
50 |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php';
|
Line 69... |
Line 69... |
69 |
}
|
69 |
}
|
70 |
}
|
70 |
}
|
Line 71... |
Line 71... |
71 |
|
71 |
|
72 |
function afficherContenuCorps() {
|
72 |
function afficherContenuCorps() {
|
73 |
$res = '<h1>'.INS_TITRE_INSCRIPTION.'</h1>'."\n" ;
|
73 |
$res = '<h1>'.INS_TITRE_INSCRIPTION.'</h1>'."\n" ;
|
74 |
|
74 |
|
- |
|
75 |
// Recuperation de la configuration
|
- |
|
76 |
if (isset($_REQUEST['id_inscription'])) {
|
- |
|
77 |
$GLOBALS ['ins_config'] = inscription::getConfig($_REQUEST['id_inscription']);
|
75 |
// Recuperation de la configuration
|
78 |
} else {
|
- |
|
79 |
$GLOBALS ['ins_config'] = inscription::getConfig();
|
- |
|
80 |
}
|
Line 76... |
Line 81... |
76 |
$GLOBALS ['ins_config'] = inscription::getConfig();
|
81 |
//$GLOBALS ['ins_config'] = unserialize($GLOBALS['_GEN_commun']['info_application']->config);
|
77 |
|
82 |
|
78 |
//cas de la déconnexion----------------------------------------------------------------------------------
|
83 |
//cas de la deconnexion----------------------------------------------------------------------------------
|
79 |
if ($_REQUEST['action'] == 'deconnexion') {
|
84 |
if ($_REQUEST['action'] == 'deconnexion') {
|
80 |
$GLOBALS['AUTH']->logout() ;
|
85 |
$GLOBALS['AUTH']->logout() ;
|
81 |
$_POST['username'] = '' ;
|
86 |
$_POST['username'] = '' ;
|
82 |
$_POST['password'] = '' ;
|
87 |
$_POST['password'] = '' ;
|
Line 83... |
Line 88... |
83 |
return $res.inscription_AUTH_formulaire_login() ;
|
88 |
return $res.inscription_AUTH_formulaire_login() ;
|
84 |
}
|
89 |
}
|
85 |
|
90 |
|
86 |
//cas de la désinscription-------------------------------------------------------------------------------
|
91 |
//cas de la desinscription-------------------------------------------------------------------------------
|
87 |
if ($_REQUEST['action'] == 'supprimer') {
|
92 |
if ($_REQUEST['action'] == 'supprimer') {
|
88 |
$id_utilisateur = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ;
|
93 |
$id_utilisateur = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ;
|
Line 124... |
Line 129... |
124 |
}
|
129 |
}
|
Line 125... |
Line 130... |
125 |
|
130 |
|
126 |
//cas de la saisie ou la modification de l'inscription individuelle ou structure
|
131 |
//cas de la saisie ou la modification de l'inscription individuelle ou structure
|
127 |
if (($_REQUEST['action'] == 'modifier')or($_REQUEST['action'] == 'modifier_v')or($_REQUEST['action'] == 'inscription')or($_REQUEST['action'] == 'inscription_v')) {
|
132 |
if (($_REQUEST['action'] == 'modifier')or($_REQUEST['action'] == 'modifier_v')or($_REQUEST['action'] == 'inscription')or($_REQUEST['action'] == 'inscription_v')) {
|
- |
|
133 |
$formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post', preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()), '_self', '', 0) ;
|
128 |
$formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post', preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()), '_self', '', 0) ;
|
134 |
$formulaire->addElement('hidden', 'id_inscription', $_REQUEST['id_inscription']) ;
|
129 |
if ($_REQUEST['action'] == 'modifier') {
|
135 |
if ($_REQUEST['action'] == 'modifier') {
|
130 |
$formulaire->setDefaults(inscription_formulaire_defaults()) ;
|
136 |
$formulaire->setDefaults(inscription_formulaire_defaults()) ;
|
131 |
}
|
137 |
}
|
132 |
$formulaire->construitFormulaire(preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()));
|
138 |
$formulaire->construitFormulaire(preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()));
|
133 |
if (isset($_REQUEST['form_structure'])) {
|
139 |
if (isset($_REQUEST['id_inscription'])) {
|
134 |
if ($_REQUEST['form_structure']==1) {
|
140 |
if ($_REQUEST['id_inscription']==1) {
|
135 |
$formulaire->formulaireStructure() ;
|
141 |
$formulaire->formulaireStructure() ;
|
136 |
}
|
142 |
}
|
Line 137... |
Line 143... |
137 |
}
|
143 |
}
|
138 |
|
144 |
|
139 |
// On ajoute la règle de vérification mail uniquement lors de l inscription
|
145 |
// On ajoute la regle de verification mail uniquement lors de l inscription
|
140 |
if ($_REQUEST['action'] == 'inscription') {
|
146 |
if ($_REQUEST['action'] == 'inscription') {
|
141 |
$formulaire->registerRule('doublonmail', 'callback', 'verif_doublonMail');
|
147 |
$formulaire->registerRule('doublonmail', 'callback', 'verif_doublonMail');
|
142 |
$formulaire->addRule('email', INS_MAIL_DOUBLE, 'doublonmail', true);
|
148 |
$formulaire->addRule('email', INS_MAIL_DOUBLE, 'doublonmail', true);
|
Line 231... |
Line 237... |
231 |
$GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ;
|
237 |
$GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ;
|
Line 232... |
Line 238... |
232 |
|
238 |
|
233 |
// On loggue l'utilisateur
|
239 |
// On loggue l'utilisateur
|
Line 234... |
Line 240... |
234 |
$GLOBALS['AUTH']->login() ;
|
240 |
$GLOBALS['AUTH']->login() ;
|
235 |
|
241 |
|
236 |
// inscription à la lettre d'information
|
242 |
// inscription a la lettre d'information
|
237 |
if (isset ($donnees['lettre'])) {
|
243 |
if (isset ($donnees['lettre'])) {
|
238 |
inscription_lettre($GLOBALS['ins_config']['ic_mail_inscription_news']) ;
|
244 |
inscription_lettre($GLOBALS['ins_config']['ic_mail_inscription_news']) ;
|
239 |
}
|
245 |
}
|
Line 261... |
Line 267... |
261 |
} else {
|
267 |
} else {
|
262 |
$res .= inscription_AUTH_formulaire_login() ;
|
268 |
$res .= inscription_AUTH_formulaire_login() ;
|
263 |
}
|
269 |
}
|
264 |
}
|
270 |
}
|
Line 265... |
Line 271... |
265 |
|
271 |
|
266 |
//cas d'une authentification réussie---------------------------------------------------------------------
|
272 |
//cas d'une authentification reussie---------------------------------------------------------------------
|
267 |
if ($GLOBALS['AUTH']->getAuth() && ($_REQUEST['action']!='modifier')) {
|
273 |
if ($GLOBALS['AUTH']->getAuth() && ($_REQUEST['action']!='modifier')) {
|
268 |
return info() ;
|
274 |
return info() ;
|
Line 269... |
Line 275... |
269 |
}
|
275 |
}
|
270 |
|
276 |
|
Line 271... |
Line 277... |
271 |
return $res ;
|
277 |
return $res ;
|
272 |
}
|
278 |
}
|
273 |
|
279 |
|
- |
|
280 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
281 |
*
|
- |
|
282 |
* $Log: not supported by cvs2svn $
|
274 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
283 |
* Revision 1.24 2007-05-25 14:31:10 alexandre_tb
|
275 |
*
|
284 |
* en cours
|
276 |
* $Log: not supported by cvs2svn $
|
285 |
*
|
277 |
* Revision 1.23 2007/04/11 08:30:12 neiluj
|
286 |
* Revision 1.23 2007/04/11 08:30:12 neiluj
|
278 |
* remise en état du CVS...
|
287 |
* remise en état du CVS...
|
Line 303... |
Line 312... |
303 |
*
|
312 |
*
|
304 |
* Revision 1.13 2006/04/04 12:23:05 florian
|
313 |
* Revision 1.13 2006/04/04 12:23:05 florian
|
305 |
* modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire
|
314 |
* modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire
|
306 |
*
|
315 |
*
|
307 |
* Revision 1.12 2006/03/15 11:05:45 alexandre_tb
|
316 |
* Revision 1.12 2006/03/15 11:05:45 alexandre_tb
|
308 |
* ajout de l'action caché inscription_v lors du réaffichage du formulaire après erreur de saisie.
|
317 |
* ajout de l'action caché inscription_v lors du ré-affichage du formulaire après erreur de saisie.
|
309 |
*
|
318 |
*
|
310 |
* Revision 1.11 2006/03/02 14:10:35 alexandre_tb
|
319 |
* Revision 1.11 2006/03/02 14:10:35 alexandre_tb
|
311 |
* correction du bug desinscription wikini
|
320 |
* correction du bug desinscription wikini
|
312 |
*
|
321 |
*
|
313 |
* Revision 1.10 2006/03/02 13:03:45 alexandre_tb
|
322 |
* Revision 1.10 2006/03/02 13:03:45 alexandre_tb
|