19,7 → 19,7 |
// | License along with this library; if not, write to the Free Software | |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
// +------------------------------------------------------------------------------------------------------+ |
// CVS : $Id: inscription.php,v 1.23 2007-04-11 08:30:12 neiluj Exp $ |
// CVS : $Id: inscription.php,v 1.24 2007-05-25 14:31:10 alexandre_tb Exp $ |
/** |
* Inscription |
* |
31,8 → 31,8 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org> |
//Autres auteurs : |
*@author Florian SCHMITT <florian@ecole-et-nature.org> |
*@copyright Tela-Botanica 2000-2004 |
*@version $Revision: 1.23 $ $Date: 2007-04-11 08:30:12 $ |
*@copyright Tela-Botanica 2000-2007 |
*@version $Revision: 1.24 $ $Date: 2007-05-25 14:31:10 $ |
// +------------------------------------------------------------------------------------------------------+ |
*/ |
|
41,7 → 41,8 |
// +------------------------------------------------------------------------------------------------------+ |
include_once 'configuration/bottin.config.inc.php'; |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php'; |
|
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php'; |
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.class.php'; |
// Inclusion d'une classe personnalisé si elle existe |
if (file_exists (INS_CHEMIN_APPLI.'bibliotheque/inscription.class.local.php')) { |
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.local.php' ; |
71,7 → 72,9 |
function afficherContenuCorps() { |
$res = '<h1>'.INS_TITRE_INSCRIPTION.'</h1>'."\n" ; |
|
|
// Recuperation de la configuration |
$GLOBALS ['ins_config'] = inscription::getConfig(); |
|
//cas de la déconnexion---------------------------------------------------------------------------------- |
if ($_REQUEST['action'] == 'deconnexion') { |
$GLOBALS['AUTH']->logout() ; |
92,11 → 95,15 |
$nom_wiki = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_NOM_WIKINI) ; |
desinscription_interwikini_users($nom_wiki) ; |
} |
$msg = ''; |
// Appel des actions desinscriptions des applications clientes |
$d = dir(GEN_CHEMIN_CLIENT); |
while (false !== ($repertoire = $d->read())) { |
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php')) |
include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php' ; |
if ($repertoire != '.' || $repertoire != '..') { |
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php')) |
include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php' ; |
} |
if ($msg != '') $res .= $msg; |
} |
$d->close(); |
|
119,6 → 126,9 |
//cas de la saisie ou la modification de l'inscription individuelle ou structure |
if (($_REQUEST['action'] == 'modifier')or($_REQUEST['action'] == 'modifier_v')or($_REQUEST['action'] == 'inscription')or($_REQUEST['action'] == 'inscription_v')) { |
$formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post', preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()), '_self', '', 0) ; |
if ($_REQUEST['action'] == 'modifier') { |
$formulaire->setDefaults(inscription_formulaire_defaults()) ; |
} |
$formulaire->construitFormulaire(preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL())); |
if (isset($_REQUEST['form_structure'])) { |
if ($_REQUEST['form_structure']==1) { |
148,17 → 158,22 |
|
if ($_REQUEST['action'] == 'inscription_v') { |
if ($formulaire->validate()) { |
if (INS_MAIL_VALIDATION_INSCRIPTION) { |
if ($GLOBALS['ins_config']['ic_mail_valide_inscription']) { |
$formulaire->process('inscription_demande', false) ; |
return $res.INS_MESSAGE_INSCRIPTION; |
} else { |
if ($GLOBALS['ins_config']['ic_inscription_modere']) { |
return inscription::demandeInscriptionModere($formulaire->getSubmitValues()); |
} |
$formulaire->process('inscription_validee', false) ; |
$id_utilisateur = $GLOBALS['ins_db']->getOne('SELECT MAX('.INS_CHAMPS_ID.') FROM '.INS_ANNUAIRE) ; |
// Appel des actions des inscriptions des applications clientes |
$d = dir(GEN_CHEMIN_CLIENT); |
while (false !== ($repertoire = $d->read())) { |
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php')) |
include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ; |
if ($repertoire != '.' && $repertoire != '..') { |
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php')) |
include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ; |
} |
} |
$d->close(); |
return $res.info(); |
181,42 → 196,63 |
} |
|
//cas de la validation par mail d'une inscription-------------------------------------------------------- |
if ((INS_MAIL_VALIDATION_INSCRIPTION)and(isset($_GET['id']))) { |
$requete = 'SELECT id_donnees FROM inscription_demande WHERE id_identifiant_session="'.$_GET['id'].'"' ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError ($resultat)) { |
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
} |
if ($resultat->numRows() == 0) { |
return $res.INS_MESSAGE_EXPIRATION; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
$donnees = unserialize (stripslashes($ligne->id_donnees)) ; |
$id_utilisateur = inscription_insertion($donnees) ; |
$GLOBALS['AUTH']->username = $donnees['email'] ; |
$GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ; |
if ($GLOBALS['ins_config']['ic_mail_valide_inscription'] && isset($_GET['id'])) { |
|
// On loggue l'utilisateur |
$GLOBALS['AUTH']->login() ; |
// si l inscription est modere on place la demande en attente |
// et on envoie un mail au moderateur |
|
// inscription à la lettre d'information |
if (isset ($donnees['lettre'])) { |
inscription_lettre(INS_MAIL_INSCRIPTION_LISTE) ; |
if ($GLOBALS['ins_config']['ic_inscription_modere']) { |
|
$requete_attente = 'insert into inscription_attente select * from inscription_demande where id_identifiant_session="'. |
$_GET['id'].'"'; |
$resultat = $GLOBALS['ins_db']->query($requete_attente); |
if (DB::isError ($resultat)) { |
return ("Echec de la requete : $requete<br />".$resultat->getMessage()); |
} |
$mails_moderateur = split ('/\n/', $GLOBALS['ins_config']['ic_mail_moderateur']); |
foreach ($mails_moderateur as $mail) { |
mail ($mail, INS_MODERATION_SUJET, INS_NOUVELLE_INSCRIPTION_A_MODERE) ; |
} |
|
} else { |
|
$requete = 'SELECT id_donnees FROM inscription_demande WHERE id_identifiant_session="'.$_GET['id'].'"' ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError ($resultat)) { |
return ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
} |
if ($resultat->numRows() == 0) { |
return $res.INS_MESSAGE_EXPIRATION; |
} |
$ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ; |
$donnees = unserialize (stripslashes($ligne->id_donnees)) ; |
$id_utilisateur = inscription_insertion($donnees) ; |
$GLOBALS['AUTH']->username = $donnees['email'] ; |
$GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ; |
|
// On loggue l'utilisateur |
$GLOBALS['AUTH']->login() ; |
|
// inscription à la lettre d'information |
if (isset ($donnees['lettre'])) { |
inscription_lettre($GLOBALS['ins_config']['ic_mail_inscription_news']) ; |
} |
// Appel des actions des inscriptions des applications clientes |
$d = dir(GEN_CHEMIN_CLIENT); |
while (false !== ($repertoire = $d->read())) { |
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php')) |
include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ; |
} |
$d->close(); |
envoie_mail() ; |
} |
// On supprime la demande d'inscription |
$requete = 'delete from inscription_demande where id_identifiant_session="'.$_GET['id'].'"' ; |
$resultat = $GLOBALS['ins_db']->query($requete) ; |
if (DB::isError($resultat)) { |
die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
return ("Echec de la requete : $requete<br />".$resultat->getMessage()) ; |
} |
// Appel des actions desinscriptions des applications clientes |
$d = dir(GEN_CHEMIN_CLIENT); |
while (false !== ($repertoire = $d->read())) { |
if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php')) |
include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ; |
} |
$d->close(); |
envoie_mail() ; |
|
} |
|
if ((!$GLOBALS['AUTH']->getAuth())&&($_REQUEST['action']!='inscription')&&($_REQUEST['action']!='inscription_v')) { |
238,6 → 274,9 |
/* +--Fin du code ----------------------------------------------------------------------------------------+ |
* |
* $Log: not supported by cvs2svn $ |
* Revision 1.23 2007/04/11 08:30:12 neiluj |
* remise en état du CVS... |
* |
* Revision 1.20.2.1 2007/01/26 10:32:59 alexandre_tb |
* suppression d un notice |
* |