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.25 2007-06-01 13:37:56 alexandre_tb Exp $
|
22 |
// CVS : $Id: inscription.php,v 1.26 2007-06-01 15:11:00 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.25 $ $Date: 2007-06-01 13:37:56 $
|
35 |
*@version $Revision: 1.26 $ $Date: 2007-06-01 15:11:00 $
|
36 |
// +------------------------------------------------------------------------------------------------------+
|
36 |
// +------------------------------------------------------------------------------------------------------+
|
37 |
*/
|
37 |
*/
|
Line 38... |
Line 38... |
38 |
|
38 |
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
39 |
// +------------------------------------------------------------------------------------------------------+
|
Line 76... |
Line 76... |
76 |
if (isset($_REQUEST['id_inscription'])) {
|
76 |
if (isset($_REQUEST['id_inscription'])) {
|
77 |
$GLOBALS ['ins_config'] = inscription::getConfig($_REQUEST['id_inscription']);
|
77 |
$GLOBALS ['ins_config'] = inscription::getConfig($_REQUEST['id_inscription']);
|
78 |
} else {
|
78 |
} else {
|
79 |
$GLOBALS ['ins_config'] = inscription::getConfig();
|
79 |
$GLOBALS ['ins_config'] = inscription::getConfig();
|
80 |
}
|
80 |
}
|
81 |
//$GLOBALS ['ins_config'] = unserialize($GLOBALS['_GEN_commun']['info_application']->config);
|
- |
|
82 |
|
81 |
//
|
83 |
//cas de la deconnexion----------------------------------------------------------------------------------
|
82 |
//cas de la deconnexion----------------------------------------------------------------------------------
|
84 |
if ($_REQUEST['action'] == 'deconnexion') {
|
83 |
if ($_REQUEST['action'] == 'deconnexion') {
|
85 |
$GLOBALS['AUTH']->logout() ;
|
84 |
$GLOBALS['AUTH']->logout() ;
|
86 |
$_POST['username'] = '' ;
|
85 |
$_POST['username'] = '' ;
|
87 |
$_POST['password'] = '' ;
|
86 |
$_POST['password'] = '' ;
|
Line 142... |
Line 141... |
142 |
}
|
141 |
}
|
143 |
}
|
142 |
}
|
Line 144... |
Line 143... |
144 |
|
143 |
|
145 |
// On ajoute la regle de verification mail uniquement lors de l inscription
|
144 |
// On ajoute la regle de verification mail uniquement lors de l inscription
|
146 |
if ($_REQUEST['action'] == 'inscription') {
|
145 |
if ($_REQUEST['action'] == 'inscription') {
|
147 |
$formulaire->registerRule('doublonmail', 'callback', 'verif_doublonMail');
|
146 |
$formulaire->registerRule('doublonmail', 'callback', 'inscription_verif_doublonMail');
|
148 |
$formulaire->addRule('email', INS_MAIL_DOUBLE, 'doublonmail', true);
|
147 |
$formulaire->addRule('email', INS_MAIL_DOUBLE, 'doublonmail');
|
149 |
}
|
148 |
}
|
150 |
//pour la modification d'une inscription, on charge les valeurs par défauts
|
149 |
//pour la modification d'une inscription, on charge les valeurs par defauts
|
151 |
if ($_REQUEST['action'] == 'modifier') {
|
150 |
if ($_REQUEST['action'] == 'modifier') {
|
152 |
$formulaire->addElement('hidden', 'action', 'modifier_v') ;
|
151 |
$formulaire->addElement('hidden', 'action', 'modifier_v') ;
|
153 |
$formulaire->setDefaults(inscription_formulaire_defaults()) ;
|
152 |
$formulaire->setDefaults(inscription_formulaire_defaults()) ;
|
Line 161... |
Line 160... |
161 |
$formulaire->setDefaults(array('pays' => 'fr', 'visible' => 1,'lettre'=>1));
|
160 |
$formulaire->setDefaults(array('pays' => 'fr', 'visible' => 1,'lettre'=>1));
|
162 |
}
|
161 |
}
|
163 |
}
|
162 |
}
|
Line 164... |
Line 163... |
164 |
|
163 |
|
- |
|
164 |
if ($_REQUEST['action'] == 'inscription_v') {
|
- |
|
165 |
$formulaire->registerRule('doublonmail', 'callback', 'inscription_verif_doublonMail');
|
165 |
if ($_REQUEST['action'] == 'inscription_v') {
|
166 |
$formulaire->addRule('email', INS_MAIL_DOUBLE, 'doublonmail');
|
166 |
if ($formulaire->validate()) {
|
167 |
if ($formulaire->validate()) {
|
167 |
if ($GLOBALS['ins_config']['ic_mail_valide_inscription']) {
|
168 |
if ($GLOBALS['ins_config']['ic_mail_valide_inscription']) {
|
168 |
$formulaire->process('inscription_demande', false) ;
|
169 |
$formulaire->process('inscription_demande', false) ;
|
169 |
return $res.INS_MESSAGE_INSCRIPTION;
|
170 |
return $res.INS_MESSAGE_INSCRIPTION;
|
Line 183... |
Line 184... |
183 |
}
|
184 |
}
|
184 |
$d->close();
|
185 |
$d->close();
|
185 |
return $res.info();
|
186 |
return $res.info();
|
186 |
}
|
187 |
}
|
187 |
} else {
|
188 |
} else {
|
188 |
// Si le formulaire n'est pas bon on remet l'action à inscription_v
|
189 |
// Si le formulaire n'est pas bon on remet l'action inscription_v
|
189 |
$formulaire->addElement('hidden', 'action', 'inscription_v') ;
|
190 |
$formulaire->addElement('hidden', 'action', 'inscription_v') ;
|
190 |
}
|
191 |
}
|
191 |
}
|
192 |
}
|
192 |
if ($_REQUEST['action'] == 'modifier_v') {
|
193 |
if ($_REQUEST['action'] == 'modifier_v') {
|
193 |
if ($formulaire->validate()) {
|
194 |
if ($formulaire->validate()) {
|
Line 269... |
Line 270... |
269 |
}
|
270 |
}
|
270 |
}
|
271 |
}
|
Line 271... |
Line 272... |
271 |
|
272 |
|
272 |
//cas d'une authentification reussie---------------------------------------------------------------------
|
273 |
//cas d'une authentification reussie---------------------------------------------------------------------
|
- |
|
274 |
if ($GLOBALS['AUTH']->getAuth() && ($_REQUEST['action']!='modifier')) {
|
- |
|
275 |
// Il faut charger ins_config
|
273 |
if ($GLOBALS['AUTH']->getAuth() && ($_REQUEST['action']!='modifier')) {
|
276 |
$GLOBALS['ins_config'] = inscription::getConfig($GLOBALS['AUTH']->getAuthData('a_ce_id_inscription'));
|
274 |
return info() ;
|
277 |
return info() ;
|
Line 275... |
Line 278... |
275 |
}
|
278 |
}
|
276 |
|
279 |
|
Line 277... |
Line 280... |
277 |
return $res ;
|
280 |
return $res ;
|
278 |
}
|
281 |
}
|
279 |
|
282 |
|
- |
|
283 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
- |
|
284 |
*
|
- |
|
285 |
* $Log: not supported by cvs2svn $
|
280 |
/* +--Fin du code ----------------------------------------------------------------------------------------+
|
286 |
* Revision 1.25 2007-06-01 13:37:56 alexandre_tb
|
281 |
*
|
287 |
* mise en place de la table inscription_configuration et de la moderation
|
282 |
* $Log: not supported by cvs2svn $
|
288 |
*
|
283 |
* Revision 1.24 2007-05-25 14:31:10 alexandre_tb
|
289 |
* Revision 1.24 2007-05-25 14:31:10 alexandre_tb
|
284 |
* en cours
|
290 |
* en cours
|