| 448 | 
           ddelon | 
           1 | 
           <?php
  | 
        
        
            | 
            | 
           2 | 
           /*vim: set expandtab tabstop=4 shiftwidth=4: */
  | 
        
        
            | 
            | 
           3 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           4 | 
           // | PHP version 4.1                                                                                      |
  | 
        
        
            | 
            | 
           5 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           6 | 
           // | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
  | 
        
        
            | 
            | 
           7 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           8 | 
           // | This library is free software; you can redistribute it and/or                                        |
  | 
        
        
            | 
            | 
           9 | 
           // | modify it under the terms of the GNU Lesser General Public                                           |
  | 
        
        
            | 
            | 
           10 | 
           // | License as published by the Free Software Foundation; either                                         |
  | 
        
        
            | 
            | 
           11 | 
           // | version 2.1 of the License, or (at your option) any later version.                                   |
  | 
        
        
            | 
            | 
           12 | 
           // |                                                                                                      |
  | 
        
        
            | 
            | 
           13 | 
           // | This library is distributed in the hope that it will be useful,                                      |
  | 
        
        
            | 
            | 
           14 | 
           // | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
  | 
        
        
            | 
            | 
           15 | 
           // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
  | 
        
        
            | 
            | 
           16 | 
           // | Lesser General Public License for more details.                                                      |
  | 
        
        
            | 
            | 
           17 | 
           // |                                                                                                      |
  | 
        
        
            | 
            | 
           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                                  |
  | 
        
        
            | 
            | 
           20 | 
           // | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
  | 
        
        
            | 
            | 
           21 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
           | 1425 | 
           alexandre_ | 
           22 | 
           // CVS : $Id: inscription.php,v 1.25 2007-06-01 13:37:56 alexandre_tb Exp $
  | 
        
        
           | 448 | 
           ddelon | 
           23 | 
           /**
  | 
        
        
            | 
            | 
           24 | 
           * Inscription
  | 
        
        
            | 
            | 
           25 | 
           *
  | 
        
        
           | 1425 | 
           alexandre_ | 
           26 | 
           * Un module d'inscription, en general ce code est specifique a
  | 
        
        
           | 448 | 
           ddelon | 
           27 | 
           * un site web
  | 
        
        
            | 
            | 
           28 | 
           *
  | 
        
        
            | 
            | 
           29 | 
           *@package inscription
  | 
        
        
            | 
            | 
           30 | 
           //Auteur original :
  | 
        
        
            | 
            | 
           31 | 
           *@author        Alexandre GRANIER <alexandre@tela-botanica.org>
  | 
        
        
            | 
            | 
           32 | 
           //Autres auteurs :
  | 
        
        
            | 
            | 
           33 | 
           *@author        Florian SCHMITT <florian@ecole-et-nature.org>
  | 
        
        
           | 1421 | 
           alexandre_ | 
           34 | 
           *@copyright     Tela-Botanica 2000-2007
  | 
        
        
           | 1425 | 
           alexandre_ | 
           35 | 
           *@version       $Revision: 1.25 $ $Date: 2007-06-01 13:37:56 $
  | 
        
        
           | 448 | 
           ddelon | 
           36 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           37 | 
           */
  | 
        
        
            | 
            | 
           38 | 
              | 
        
        
            | 
            | 
           39 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           40 | 
           // |                                            ENTETE du PROGRAMME                                       |
  | 
        
        
            | 
            | 
           41 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
           | 471 | 
           alexandre_ | 
           42 | 
           include_once 'configuration/bottin.config.inc.php';
  | 
        
        
           | 1298 | 
           neiluj | 
           43 | 
           include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php';
  | 
        
        
           | 1421 | 
           alexandre_ | 
           44 | 
           include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php';
  | 
        
        
            | 
            | 
           45 | 
           include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.class.php';
  | 
        
        
           | 1425 | 
           alexandre_ | 
           46 | 
           // Inclusion d'une classe personnalise si elle existe
  | 
        
        
           | 1298 | 
           neiluj | 
           47 | 
           if (file_exists (INS_CHEMIN_APPLI.'bibliotheque/inscription.class.local.php')) {
  | 
        
        
            | 
            | 
           48 | 
           	include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.local.php' ;
  | 
        
        
            | 
            | 
           49 | 
           } else {
  | 
        
        
            | 
            | 
           50 | 
           	include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php';
  | 
        
        
            | 
            | 
           51 | 
           }
  | 
        
        
            | 
            | 
           52 | 
              | 
        
        
           | 448 | 
           ddelon | 
           53 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           54 | 
           // |                                           LISTE de FONCTIONS                                         |
  | 
        
        
            | 
            | 
           55 | 
           // +------------------------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           56 | 
              | 
        
        
           | 1298 | 
           neiluj | 
           57 | 
           if (!isset($_REQUEST['action'])) {
  | 
        
        
            | 
            | 
           58 | 
           	$_REQUEST['action']='';
  | 
        
        
            | 
            | 
           59 | 
           }
  | 
        
        
           | 1292 | 
           neiluj | 
           60 | 
              | 
        
        
           | 1298 | 
           neiluj | 
           61 | 
              | 
        
        
            | 
            | 
           62 | 
           if ( isset($_GET['voir_fiche']) or isset($_GET['voir_abonnement']) or isset($_GET['voir_actus']) or isset($_GET['voir_ressources']) or isset($_GET['voir_competences'])
  | 
        
        
            | 
            | 
           63 | 
           or (isset($_REQUEST['action'])&&($_REQUEST['action']=='modifier_v'||$_REQUEST['action']=='modifier_v'))
  | 
        
        
            | 
            | 
           64 | 
           or ($GLOBALS['AUTH']->getAuth() && ($_REQUEST['action']!='modifier')) ) {
  | 
        
        
            | 
            | 
           65 | 
           	//---------------le menu de l'appli-----------
  | 
        
        
            | 
            | 
           66 | 
           	function afficherContenuNavigation () {
  | 
        
        
            | 
            | 
           67 | 
           		$res =inscription_onglets();
  | 
        
        
            | 
            | 
           68 | 
           		return $res ;
  | 
        
        
            | 
            | 
           69 | 
           	}
  | 
        
        
            | 
            | 
           70 | 
           }
  | 
        
        
            | 
            | 
           71 | 
              | 
        
        
           | 448 | 
           ddelon | 
           72 | 
           function afficherContenuCorps() {
  | 
        
        
            | 
            | 
           73 | 
               $res = '<h1>'.INS_TITRE_INSCRIPTION.'</h1>'."\n" ;
  | 
        
        
           | 1425 | 
           alexandre_ | 
           74 | 
              | 
        
        
           | 1421 | 
           alexandre_ | 
           75 | 
               // Recuperation de la configuration
  | 
        
        
           | 1425 | 
           alexandre_ | 
           76 | 
               if (isset($_REQUEST['id_inscription'])) {
  | 
        
        
            | 
            | 
           77 | 
                	$GLOBALS ['ins_config'] = inscription::getConfig($_REQUEST['id_inscription']);
  | 
        
        
            | 
            | 
           78 | 
               } else {
  | 
        
        
            | 
            | 
           79 | 
               	$GLOBALS ['ins_config'] = inscription::getConfig();
  | 
        
        
            | 
            | 
           80 | 
               }
  | 
        
        
            | 
            | 
           81 | 
                //$GLOBALS ['ins_config'] = unserialize($GLOBALS['_GEN_commun']['info_application']->config);
  | 
        
        
           | 1421 | 
           alexandre_ | 
           82 | 
              | 
        
        
           | 1425 | 
           alexandre_ | 
           83 | 
           //cas de la deconnexion----------------------------------------------------------------------------------
  | 
        
        
           | 603 | 
           florian | 
           84 | 
               if ($_REQUEST['action'] == 'deconnexion') {
  | 
        
        
           | 448 | 
           ddelon | 
           85 | 
                   $GLOBALS['AUTH']->logout() ;
  | 
        
        
            | 
            | 
           86 | 
                   $_POST['username'] = '' ;
  | 
        
        
            | 
            | 
           87 | 
                   $_POST['password'] = '' ;
  | 
        
        
           | 1298 | 
           neiluj | 
           88 | 
                   return $res.inscription_AUTH_formulaire_login() ;
  | 
        
        
           | 448 | 
           ddelon | 
           89 | 
               }
  | 
        
        
            | 
            | 
           90 | 
              | 
        
        
           | 1425 | 
           alexandre_ | 
           91 | 
           //cas de la desinscription-------------------------------------------------------------------------------
  | 
        
        
           | 603 | 
           florian | 
           92 | 
               if ($_REQUEST['action'] == 'supprimer') {
  | 
        
        
           | 670 | 
           alexandre_ | 
           93 | 
               	$id_utilisateur = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID) ;
  | 
        
        
           | 1298 | 
           neiluj | 
           94 | 
               	// Suppression dans SPIP
  | 
        
        
           | 448 | 
           ddelon | 
           95 | 
                   if (INS_UTILISE_SPIP) {
  | 
        
        
           | 603 | 
           florian | 
           96 | 
                       desinscription_spip($GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID)) ;
  | 
        
        
           | 448 | 
           ddelon | 
           97 | 
                   }
  | 
        
        
           | 484 | 
           alexandre_ | 
           98 | 
           		// Suppression dans Wikini
  | 
        
        
           | 448 | 
           ddelon | 
           99 | 
                   if (INS_UTILISE_WIKINI) {
  | 
        
        
           | 1298 | 
           neiluj | 
           100 | 
           			$nom_wiki = $GLOBALS['AUTH']->getAuthData(INS_CHAMPS_NOM_WIKINI) ;
  | 
        
        
           | 484 | 
           alexandre_ | 
           101 | 
           			desinscription_interwikini_users($nom_wiki) ;
  | 
        
        
           | 448 | 
           ddelon | 
           102 | 
                   }
  | 
        
        
           | 1421 | 
           alexandre_ | 
           103 | 
                   $msg = '';
  | 
        
        
           | 484 | 
           alexandre_ | 
           104 | 
                   // Appel des actions desinscriptions des applications clientes
  | 
        
        
            | 
            | 
           105 | 
                   $d = dir(GEN_CHEMIN_CLIENT);
  | 
        
        
            | 
            | 
           106 | 
           		while (false !== ($repertoire = $d->read())) {
  | 
        
        
           | 1421 | 
           alexandre_ | 
           107 | 
           			if ($repertoire != '.' || $repertoire != '..') {
  | 
        
        
            | 
            | 
           108 | 
           				if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php'))
  | 
        
        
            | 
            | 
           109 | 
           				include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.desinscription.inc.php' ;
  | 
        
        
            | 
            | 
           110 | 
           			}
  | 
        
        
            | 
            | 
           111 | 
           			if ($msg != '') $res .= $msg;
  | 
        
        
           | 484 | 
           alexandre_ | 
           112 | 
           		}
  | 
        
        
            | 
            | 
           113 | 
           		$d->close();
  | 
        
        
           | 1298 | 
           neiluj | 
           114 | 
              | 
        
        
            | 
            | 
           115 | 
               	$resultat = $GLOBALS['AUTH']->removeUser($GLOBALS['AUTH']->getUsername()) ;
  | 
        
        
            | 
            | 
           116 | 
                   if (PEAR::isError($resultat)) {
  | 
        
        
            | 
            | 
           117 | 
                   	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
  | 
        
        
            | 
            | 
           118 | 
                   }
  | 
        
        
            | 
            | 
           119 | 
              | 
        
        
            | 
            | 
           120 | 
              | 
        
        
           | 603 | 
           florian | 
           121 | 
           		// Deconnection
  | 
        
        
           | 448 | 
           ddelon | 
           122 | 
                   $GLOBALS['AUTH']->logout() ;
  | 
        
        
           | 1298 | 
           neiluj | 
           123 | 
                   return $res.inscription_AUTH_formulaire_login() ;
  | 
        
        
           | 448 | 
           ddelon | 
           124 | 
               }
  | 
        
        
            | 
            | 
           125 | 
              | 
        
        
           | 603 | 
           florian | 
           126 | 
           //cas de l'envoi de mot de passe par mail----------------------------------------------------------------
  | 
        
        
           | 448 | 
           ddelon | 
           127 | 
               if ($_REQUEST['action'] == 'sendpasswd') {
  | 
        
        
           | 1298 | 
           neiluj | 
           128 | 
                   return inscription_envoie_passe()."\n".inscription_formulaire_envoi_passe() ;
  | 
        
        
           | 448 | 
           ddelon | 
           129 | 
               }
  | 
        
        
            | 
            | 
           130 | 
              | 
        
        
           | 603 | 
           florian | 
           131 | 
           //cas de la saisie ou la modification de l'inscription individuelle ou structure
  | 
        
        
           | 606 | 
           florian | 
           132 | 
               if (($_REQUEST['action'] == 'modifier')or($_REQUEST['action'] == 'modifier_v')or($_REQUEST['action'] == 'inscription')or($_REQUEST['action'] == 'inscription_v')) {
  | 
        
        
           | 603 | 
           florian | 
           133 | 
                   $formulaire = new HTML_formulaireInscription('formulaire_inscription', 'post', preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()), '_self', '', 0) ;
  | 
        
        
           | 1425 | 
           alexandre_ | 
           134 | 
                   $formulaire->addElement('hidden', 'id_inscription', $_REQUEST['id_inscription']) ;
  | 
        
        
           | 1421 | 
           alexandre_ | 
           135 | 
                   if ($_REQUEST['action'] == 'modifier') {
  | 
        
        
            | 
            | 
           136 | 
                       $formulaire->setDefaults(inscription_formulaire_defaults()) ;
  | 
        
        
            | 
            | 
           137 | 
                   }
  | 
        
        
           | 603 | 
           florian | 
           138 | 
                   $formulaire->construitFormulaire(preg_replace('/&/', '&', $GLOBALS['ins_url']->getURL()));
  | 
        
        
           | 1425 | 
           alexandre_ | 
           139 | 
                   if (isset($_REQUEST['id_inscription'])) {
  | 
        
        
            | 
            | 
           140 | 
                   	if ($_REQUEST['id_inscription']==1) {
  | 
        
        
           | 606 | 
           florian | 
           141 | 
                   		$formulaire->formulaireStructure() ;
  | 
        
        
            | 
            | 
           142 | 
                   	}
  | 
        
        
           | 448 | 
           ddelon | 
           143 | 
                   }
  | 
        
        
           | 603 | 
           florian | 
           144 | 
              | 
        
        
           | 1425 | 
           alexandre_ | 
           145 | 
                   // On ajoute la regle de verification mail uniquement lors de l inscription
  | 
        
        
           | 1298 | 
           neiluj | 
           146 | 
                   if ($_REQUEST['action'] == 'inscription') {
  | 
        
        
            | 
            | 
           147 | 
           	        $formulaire->registerRule('doublonmail', 'callback', 'verif_doublonMail');
  | 
        
        
            | 
            | 
           148 | 
           	        $formulaire->addRule('email', INS_MAIL_DOUBLE, 'doublonmail', true);
  | 
        
        
            | 
            | 
           149 | 
                   }
  | 
        
        
           | 603 | 
           florian | 
           150 | 
                   //pour la modification d'une inscription, on charge les valeurs par défauts
  | 
        
        
            | 
            | 
           151 | 
                   if ($_REQUEST['action'] == 'modifier') {
  | 
        
        
           | 448 | 
           ddelon | 
           152 | 
                       $formulaire->addElement('hidden', 'action', 'modifier_v') ;
  | 
        
        
           | 1298 | 
           neiluj | 
           153 | 
                       $formulaire->setDefaults(inscription_formulaire_defaults()) ;
  | 
        
        
           | 448 | 
           ddelon | 
           154 | 
                   }
  | 
        
        
            | 
            | 
           155 | 
              | 
        
        
            | 
            | 
           156 | 
                   if ($_REQUEST['action'] == 'inscription') {
  | 
        
        
           | 484 | 
           alexandre_ | 
           157 | 
                       if ($GLOBALS['AUTH']->getAuth()) {
  | 
        
        
            | 
            | 
           158 | 
              | 
        
        
           | 603 | 
           florian | 
           159 | 
                       } else {
  | 
        
        
           | 484 | 
           alexandre_ | 
           160 | 
                       	$formulaire->addElement('hidden', 'action', 'inscription_v') ;
  | 
        
        
           | 1298 | 
           neiluj | 
           161 | 
                       	$formulaire->setDefaults(array('pays' => 'fr', 'visible' => 1,'lettre'=>1));
  | 
        
        
           | 484 | 
           alexandre_ | 
           162 | 
                       }
  | 
        
        
           | 448 | 
           ddelon | 
           163 | 
                   }
  | 
        
        
            | 
            | 
           164 | 
              | 
        
        
            | 
            | 
           165 | 
                   if ($_REQUEST['action'] == 'inscription_v') {
  | 
        
        
            | 
            | 
           166 | 
                       if ($formulaire->validate()) {
  | 
        
        
           | 1421 | 
           alexandre_ | 
           167 | 
           			    if ($GLOBALS['ins_config']['ic_mail_valide_inscription']) {
  | 
        
        
           | 1298 | 
           neiluj | 
           168 | 
           				    $formulaire->process('inscription_demande', false) ;
  | 
        
        
            | 
            | 
           169 | 
           				    return $res.INS_MESSAGE_INSCRIPTION;
  | 
        
        
            | 
            | 
           170 | 
           			    } else {
  | 
        
        
           | 1421 | 
           alexandre_ | 
           171 | 
           				    if ($GLOBALS['ins_config']['ic_inscription_modere']) {
  | 
        
        
            | 
            | 
           172 | 
           				    	return inscription::demandeInscriptionModere($formulaire->getSubmitValues());
  | 
        
        
            | 
            | 
           173 | 
           				    }
  | 
        
        
           | 1298 | 
           neiluj | 
           174 | 
           				    $formulaire->process('inscription_validee', false) ;
  | 
        
        
            | 
            | 
           175 | 
           				    $id_utilisateur = $GLOBALS['ins_db']->getOne('SELECT MAX('.INS_CHAMPS_ID.') FROM '.INS_ANNUAIRE) ;
  | 
        
        
            | 
            | 
           176 | 
           				    // Appel des actions des inscriptions des applications clientes
  | 
        
        
            | 
            | 
           177 | 
           			        $d = dir(GEN_CHEMIN_CLIENT);
  | 
        
        
            | 
            | 
           178 | 
           					while (false !== ($repertoire = $d->read())) {
  | 
        
        
           | 1421 | 
           alexandre_ | 
           179 | 
           						if ($repertoire != '.' && $repertoire != '..') {
  | 
        
        
            | 
            | 
           180 | 
           							if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php'))
  | 
        
        
            | 
            | 
           181 | 
           							include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ;
  | 
        
        
            | 
            | 
           182 | 
           						}
  | 
        
        
           | 1298 | 
           neiluj | 
           183 | 
           					}
  | 
        
        
            | 
            | 
           184 | 
           					$d->close();
  | 
        
        
            | 
            | 
           185 | 
           				    return $res.info();
  | 
        
        
            | 
            | 
           186 | 
           			    }
  | 
        
        
            | 
            | 
           187 | 
                       } else {
  | 
        
        
            | 
            | 
           188 | 
                       	// Si le formulaire n'est pas bon on remet l'action à inscription_v
  | 
        
        
            | 
            | 
           189 | 
                       	$formulaire->addElement('hidden', 'action', 'inscription_v') ;
  | 
        
        
           | 448 | 
           ddelon | 
           190 | 
                       }
  | 
        
        
            | 
            | 
           191 | 
                   }
  | 
        
        
            | 
            | 
           192 | 
                   if ($_REQUEST['action'] == 'modifier_v') {
  | 
        
        
            | 
            | 
           193 | 
                       if ($formulaire->validate()) {
  | 
        
        
           | 1298 | 
           neiluj | 
           194 | 
                           $formulaire->process('inscription_mise_a_jour', false) ;
  | 
        
        
            | 
            | 
           195 | 
                       } else {
  | 
        
        
            | 
            | 
           196 | 
                       	return $formulaire->toHTML();
  | 
        
        
           | 448 | 
           ddelon | 
           197 | 
                       }
  | 
        
        
           | 1298 | 
           neiluj | 
           198 | 
                       return $res.info();
  | 
        
        
           | 448 | 
           ddelon | 
           199 | 
                   }
  | 
        
        
            | 
            | 
           200 | 
              | 
        
        
            | 
            | 
           201 | 
                   return $res.$formulaire->toHTML() ;
  | 
        
        
            | 
            | 
           202 | 
               }
  | 
        
        
            | 
            | 
           203 | 
              | 
        
        
           | 603 | 
           florian | 
           204 | 
           //cas de la validation par mail d'une inscription--------------------------------------------------------
  | 
        
        
           | 1421 | 
           alexandre_ | 
           205 | 
               if ($GLOBALS['ins_config']['ic_mail_valide_inscription'] && isset($_GET['id'])) {
  | 
        
        
           | 448 | 
           ddelon | 
           206 | 
              | 
        
        
           | 1421 | 
           alexandre_ | 
           207 | 
           	    // si l inscription est modere on place la demande en attente
  | 
        
        
            | 
            | 
           208 | 
           	    // et on envoie un mail au moderateur
  | 
        
        
           | 448 | 
           ddelon | 
           209 | 
              | 
        
        
           | 1421 | 
           alexandre_ | 
           210 | 
           	    if ($GLOBALS['ins_config']['ic_inscription_modere']) {
  | 
        
        
            | 
            | 
           211 | 
              | 
        
        
            | 
            | 
           212 | 
           			$requete_attente = 'insert into inscription_attente select * from inscription_demande where id_identifiant_session="'.
  | 
        
        
            | 
            | 
           213 | 
           	    					$_GET['id'].'"';
  | 
        
        
            | 
            | 
           214 | 
           			$resultat = $GLOBALS['ins_db']->query($requete_attente);
  | 
        
        
            | 
            | 
           215 | 
           			if (DB::isError ($resultat)) {
  | 
        
        
            | 
            | 
           216 | 
           		    	return ("Echec de la requete : $requete<br />".$resultat->getMessage());
  | 
        
        
            | 
            | 
           217 | 
           	    	}
  | 
        
        
            | 
            | 
           218 | 
           	    	$mails_moderateur = split ('/\n/', $GLOBALS['ins_config']['ic_mail_moderateur']);
  | 
        
        
            | 
            | 
           219 | 
           	    	foreach ($mails_moderateur as $mail) {
  | 
        
        
            | 
            | 
           220 | 
           	    		mail ($mail, INS_MODERATION_SUJET, INS_NOUVELLE_INSCRIPTION_A_MODERE) ;
  | 
        
        
            | 
            | 
           221 | 
           	    	}
  | 
        
        
            | 
            | 
           222 | 
              | 
        
        
            | 
            | 
           223 | 
           	    } else {
  | 
        
        
            | 
            | 
           224 | 
              | 
        
        
            | 
            | 
           225 | 
           		    $requete = 'SELECT id_donnees FROM inscription_demande WHERE id_identifiant_session="'.$_GET['id'].'"' ;
  | 
        
        
            | 
            | 
           226 | 
           		    $resultat = $GLOBALS['ins_db']->query($requete) ;
  | 
        
        
            | 
            | 
           227 | 
           		    if (DB::isError ($resultat)) {
  | 
        
        
            | 
            | 
           228 | 
           			    return ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
  | 
        
        
            | 
            | 
           229 | 
           		    }
  | 
        
        
            | 
            | 
           230 | 
           		    if ($resultat->numRows() == 0) {
  | 
        
        
            | 
            | 
           231 | 
           			    return $res.INS_MESSAGE_EXPIRATION;
  | 
        
        
            | 
            | 
           232 | 
           		    }
  | 
        
        
            | 
            | 
           233 | 
           		    $ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT) ;
  | 
        
        
            | 
            | 
           234 | 
           		    $donnees = unserialize (stripslashes($ligne->id_donnees)) ;
  | 
        
        
            | 
            | 
           235 | 
           		    $id_utilisateur = inscription_insertion($donnees) ;
  | 
        
        
            | 
            | 
           236 | 
           		    $GLOBALS['AUTH']->username = $donnees['email'] ;
  | 
        
        
            | 
            | 
           237 | 
           		    $GLOBALS['AUTH']->password = $donnees['mot_de_passe'] ;
  | 
        
        
            | 
            | 
           238 | 
              | 
        
        
            | 
            | 
           239 | 
           		    // On loggue l'utilisateur
  | 
        
        
            | 
            | 
           240 | 
           		    $GLOBALS['AUTH']->login() ;
  | 
        
        
            | 
            | 
           241 | 
              | 
        
        
           | 1425 | 
           alexandre_ | 
           242 | 
           		    // inscription a la lettre d'information
  | 
        
        
           | 1421 | 
           alexandre_ | 
           243 | 
           		    if (isset ($donnees['lettre'])) {
  | 
        
        
            | 
            | 
           244 | 
           			    inscription_lettre($GLOBALS['ins_config']['ic_mail_inscription_news']) ;
  | 
        
        
            | 
            | 
           245 | 
           		    }
  | 
        
        
            | 
            | 
           246 | 
           		    // Appel des actions des inscriptions des applications clientes
  | 
        
        
            | 
            | 
           247 | 
           	        $d = dir(GEN_CHEMIN_CLIENT);
  | 
        
        
            | 
            | 
           248 | 
           			while (false !== ($repertoire = $d->read())) {
  | 
        
        
            | 
            | 
           249 | 
           				if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php'))
  | 
        
        
            | 
            | 
           250 | 
           				include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ;
  | 
        
        
            | 
            | 
           251 | 
           			}
  | 
        
        
            | 
            | 
           252 | 
           			$d->close();
  | 
        
        
            | 
            | 
           253 | 
           		    envoie_mail() ;
  | 
        
        
           | 448 | 
           ddelon | 
           254 | 
           	    }
  | 
        
        
            | 
            | 
           255 | 
           	    // On supprime la demande d'inscription
  | 
        
        
            | 
            | 
           256 | 
           	    $requete = 'delete from inscription_demande where id_identifiant_session="'.$_GET['id'].'"' ;
  | 
        
        
            | 
            | 
           257 | 
           	    $resultat = $GLOBALS['ins_db']->query($requete) ;
  | 
        
        
            | 
            | 
           258 | 
           	    if (DB::isError($resultat)) {
  | 
        
        
           | 1421 | 
           alexandre_ | 
           259 | 
           		    return ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
  | 
        
        
           | 448 | 
           ddelon | 
           260 | 
           	    }
  | 
        
        
           | 1421 | 
           alexandre_ | 
           261 | 
              | 
        
        
           | 448 | 
           ddelon | 
           262 | 
               }
  | 
        
        
            | 
            | 
           263 | 
              | 
        
        
           | 603 | 
           florian | 
           264 | 
               if ((!$GLOBALS['AUTH']->getAuth())&&($_REQUEST['action']!='inscription')&&($_REQUEST['action']!='inscription_v')) {
  | 
        
        
           | 448 | 
           ddelon | 
           265 | 
                   if (isset($_POST['username']) && $_POST['username'] != '') {
  | 
        
        
           | 1298 | 
           neiluj | 
           266 | 
                       $res .= '<p class="erreur">'.INS_ERREUR_LOGIN.'</p><br />'."\n".inscription_formulaire_envoi_passe();
  | 
        
        
           | 448 | 
           ddelon | 
           267 | 
                   } else {
  | 
        
        
           | 1298 | 
           neiluj | 
           268 | 
                       $res .= inscription_AUTH_formulaire_login() ;
  | 
        
        
           | 448 | 
           ddelon | 
           269 | 
                   }
  | 
        
        
            | 
            | 
           270 | 
               }
  | 
        
        
            | 
            | 
           271 | 
              | 
        
        
           | 1425 | 
           alexandre_ | 
           272 | 
           //cas d'une authentification reussie---------------------------------------------------------------------
  | 
        
        
           | 603 | 
           florian | 
           273 | 
               if ($GLOBALS['AUTH']->getAuth() && ($_REQUEST['action']!='modifier')) {
  | 
        
        
            | 
            | 
           274 | 
                       return info() ;
  | 
        
        
           | 448 | 
           ddelon | 
           275 | 
               }
  | 
        
        
           | 603 | 
           florian | 
           276 | 
              | 
        
        
           | 448 | 
           ddelon | 
           277 | 
               return $res ;
  | 
        
        
            | 
            | 
           278 | 
           }
  | 
        
        
            | 
            | 
           279 | 
              | 
        
        
            | 
            | 
           280 | 
           /* +--Fin du code ----------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           281 | 
           *
  | 
        
        
            | 
            | 
           282 | 
           * $Log: not supported by cvs2svn $
  | 
        
        
           | 1425 | 
           alexandre_ | 
           283 | 
           * Revision 1.24  2007-05-25 14:31:10  alexandre_tb
  | 
        
        
            | 
            | 
           284 | 
           * en cours
  | 
        
        
            | 
            | 
           285 | 
           *
  | 
        
        
           | 1421 | 
           alexandre_ | 
           286 | 
           * Revision 1.23  2007/04/11 08:30:12  neiluj
  | 
        
        
            | 
            | 
           287 | 
           * remise en état du CVS...
  | 
        
        
            | 
            | 
           288 | 
           *
  | 
        
        
           | 1298 | 
           neiluj | 
           289 | 
           * Revision 1.20.2.1  2007/01/26 10:32:59  alexandre_tb
  | 
        
        
            | 
            | 
           290 | 
           * suppression d un notice
  | 
        
        
            | 
            | 
           291 | 
           *
  | 
        
        
            | 
            | 
           292 | 
           * Revision 1.20  2006/12/01 13:23:17  florian
  | 
        
        
            | 
            | 
           293 | 
           * integration annuaire backoffice
  | 
        
        
            | 
            | 
           294 | 
           *
  | 
        
        
            | 
            | 
           295 | 
           * Revision 1.19  2006/10/05 13:53:54  florian
  | 
        
        
            | 
            | 
           296 | 
           * amélioration des fichiers sql
  | 
        
        
            | 
            | 
           297 | 
           *
  | 
        
        
            | 
            | 
           298 | 
           * Revision 1.18  2006/07/20 09:48:07  alexandre_tb
  | 
        
        
            | 
            | 
           299 | 
           * réglages
  | 
        
        
            | 
            | 
           300 | 
           *
  | 
        
        
            | 
            | 
           301 | 
           * Revision 1.17  2006/07/06 10:33:30  alexandre_tb
  | 
        
        
            | 
            | 
           302 | 
           * correction bug du à dernière mise à jour
  | 
        
        
            | 
            | 
           303 | 
           *
  | 
        
        
            | 
            | 
           304 | 
           * Revision 1.16  2006/07/04 09:38:31  alexandre_tb
  | 
        
        
            | 
            | 
           305 | 
           * Ajout de la règle doublon email uniquement lors de création d'une entrée
  | 
        
        
            | 
            | 
           306 | 
           *
  | 
        
        
            | 
            | 
           307 | 
           * Revision 1.15  2006/06/01 10:00:35  alexandre_tb
  | 
        
        
            | 
            | 
           308 | 
           * correction bug désinscription des appli cliente
  | 
        
        
            | 
            | 
           309 | 
           *
  | 
        
        
            | 
            | 
           310 | 
           * Revision 1.14  2006/04/10 09:48:16  alexandre_tb
  | 
        
        
            | 
            | 
           311 | 
           * Correction de bug pour les inscriptions aux autres applications
  | 
        
        
            | 
            | 
           312 | 
           *
  | 
        
        
            | 
            | 
           313 | 
           * Revision 1.13  2006/04/04 12:23:05  florian
  | 
        
        
            | 
            | 
           314 | 
           * modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire
  | 
        
        
            | 
            | 
           315 | 
           *
  | 
        
        
            | 
            | 
           316 | 
           * Revision 1.12  2006/03/15 11:05:45  alexandre_tb
  | 
        
        
           | 1425 | 
           alexandre_ | 
           317 | 
           * ajout de l'action caché inscription_v lors du ré-affichage du formulaire après erreur de saisie.
  | 
        
        
           | 1298 | 
           neiluj | 
           318 | 
           *
  | 
        
        
            | 
            | 
           319 | 
           * Revision 1.11  2006/03/02 14:10:35  alexandre_tb
  | 
        
        
            | 
            | 
           320 | 
           * correction du bug desinscription wikini
  | 
        
        
            | 
            | 
           321 | 
           *
  | 
        
        
            | 
            | 
           322 | 
           * Revision 1.10  2006/03/02 13:03:45  alexandre_tb
  | 
        
        
            | 
            | 
           323 | 
           * bug de désinscription interwikini_users
  | 
        
        
            | 
            | 
           324 | 
           *
  | 
        
        
            | 
            | 
           325 | 
           * Revision 1.9  2006/02/28 14:08:27  alexandre_tb
  | 
        
        
            | 
            | 
           326 | 
           * appel des inscriptions des autres appli, sous le format:
  | 
        
        
            | 
            | 
           327 | 
           * client/appli/appli.inscription.php
  | 
        
        
            | 
            | 
           328 | 
           *
  | 
        
        
            | 
            | 
           329 | 
           * Revision 1.8  2006/02/14 10:21:08  alexandre_tb
  | 
        
        
            | 
            | 
           330 | 
           * ajout d'un appel à un fichier de classe personnalisé
  | 
        
        
            | 
            | 
           331 | 
           *
  | 
        
        
           | 739 | 
           alexandre_ | 
           332 | 
           * Revision 1.7  2005/12/19 13:16:14  alexandre_tb
  | 
        
        
            | 
            | 
           333 | 
           * correction d'un bug
  | 
        
        
            | 
            | 
           334 | 
           *
  | 
        
        
           | 670 | 
           alexandre_ | 
           335 | 
           * Revision 1.6  2005/11/18 16:04:15  florian
  | 
        
        
            | 
            | 
           336 | 
           * corrections de bugs, optimisations, tests pour rendre inscription stable.
  | 
        
        
            | 
            | 
           337 | 
           *
  | 
        
        
           | 606 | 
           florian | 
           338 | 
           * Revision 1.5  2005/11/17 18:48:02  florian
  | 
        
        
            | 
            | 
           339 | 
           * corrections bugs + amélioration de l'application d'inscription
  | 
        
        
            | 
            | 
           340 | 
           *
  | 
        
        
           | 603 | 
           florian | 
           341 | 
           * Revision 1.4  2005/10/25 14:02:21  alexandre_tb
  | 
        
        
            | 
            | 
           342 | 
           * le formulaire affiche la france par défaut
  | 
        
        
            | 
            | 
           343 | 
           *
  | 
        
        
           | 575 | 
           alexandre_ | 
           344 | 
           * Revision 1.3  2005/09/29 16:07:51  alexandre_tb
  | 
        
        
            | 
            | 
           345 | 
           * En cours de production.
  | 
        
        
            | 
            | 
           346 | 
           *
  | 
        
        
           | 484 | 
           alexandre_ | 
           347 | 
           * Revision 1.2  2005/09/27 13:59:24  alexandre_tb
  | 
        
        
            | 
            | 
           348 | 
           * correction de bogue, généralisation du code etc.
  | 
        
        
            | 
            | 
           349 | 
           *
  | 
        
        
           | 471 | 
           alexandre_ | 
           350 | 
           * Revision 1.1  2005/09/22 14:02:49  ddelon
  | 
        
        
            | 
            | 
           351 | 
           * nettoyage annuaire et php5
  | 
        
        
            | 
            | 
           352 | 
           *
  | 
        
        
           | 448 | 
           ddelon | 
           353 | 
           * Revision 1.4  2005/09/22 13:30:49  florian
  | 
        
        
            | 
            | 
           354 | 
           * modifs pour compatibilité XHTML Strict + corrections de bugs (mais ya encore du boulot!!)
  | 
        
        
            | 
            | 
           355 | 
           *
  | 
        
        
            | 
            | 
           356 | 
           * Revision 1.4  2005/03/21 16:57:30  florian
  | 
        
        
            | 
            | 
           357 | 
           * correction de bug, mise à jour interface
  | 
        
        
            | 
            | 
           358 | 
           *
  | 
        
        
            | 
            | 
           359 | 
           * Revision 1.3  2005/03/08 17:44:02  alex
  | 
        
        
            | 
            | 
           360 | 
           * suppression en utilisant removeUser de Auth plutôt qu'en requete directe
  | 
        
        
            | 
            | 
           361 | 
           *
  | 
        
        
            | 
            | 
           362 | 
           * Revision 1.2  2005/03/02 12:44:41  alex
  | 
        
        
            | 
            | 
           363 | 
           * Correction du bug message d'erreur alors qu'on tente de s'inscrire simplement
  | 
        
        
            | 
            | 
           364 | 
           *
  | 
        
        
            | 
            | 
           365 | 
           * Revision 1.1  2004/12/15 13:32:15  alex
  | 
        
        
            | 
            | 
           366 | 
           * version initiale
  | 
        
        
            | 
            | 
           367 | 
           *
  | 
        
        
            | 
            | 
           368 | 
           * Revision 1.2  2004/09/01 16:36:37  alex
  | 
        
        
            | 
            | 
           369 | 
           * changement du chemin pour les include
  | 
        
        
            | 
            | 
           370 | 
           *
  | 
        
        
            | 
            | 
           371 | 
           * Revision 1.1  2004/07/06 15:42:28  alex
  | 
        
        
            | 
            | 
           372 | 
           * en cours
  | 
        
        
            | 
            | 
           373 | 
           *
  | 
        
        
            | 
            | 
           374 | 
           * Revision 1.5  2004/07/06 15:28:56  alex
  | 
        
        
            | 
            | 
           375 | 
           * en cours
  | 
        
        
            | 
            | 
           376 | 
           *
  | 
        
        
            | 
            | 
           377 | 
           * Revision 1.4  2004/06/25 14:26:03  alex
  | 
        
        
            | 
            | 
           378 | 
           * modification de la suppression
  | 
        
        
            | 
            | 
           379 | 
           *
  | 
        
        
            | 
            | 
           380 | 
           * Revision 1.3  2004/06/23 12:41:44  alex
  | 
        
        
            | 
            | 
           381 | 
           * amélioration de la gestion de la perte de mot de passe
  | 
        
        
            | 
            | 
           382 | 
           *
  | 
        
        
            | 
            | 
           383 | 
           * Revision 1.2  2004/06/18 09:18:23  alex
  | 
        
        
            | 
            | 
           384 | 
           * version initiale
  | 
        
        
            | 
            | 
           385 | 
           *
  | 
        
        
            | 
            | 
           386 | 
           *
  | 
        
        
            | 
            | 
           387 | 
           * +-- Fin du code ----------------------------------------------------------------------------------------+
  | 
        
        
            | 
            | 
           388 | 
           */
  | 
        
        
            | 
            | 
           389 | 
           ?>
  |