| 433 | 
           aurelien | 
           1 | 
           <?php
  | 
        
        
            | 
            | 
           2 | 
           // declare(encoding='UTF-8');
  | 
        
        
            | 
            | 
           3 | 
           /**
  | 
        
        
            | 
            | 
           4 | 
            *
  | 
        
        
            | 
            | 
           5 | 
            * PHP version 5
  | 
        
        
            | 
            | 
           6 | 
            *
  | 
        
        
            | 
            | 
           7 | 
            * @category PHP
  | 
        
        
            | 
            | 
           8 | 
            * @package Framework
  | 
        
        
            | 
            | 
           9 | 
            * @author Aurelien PERONNET <aurelien@tela-botanica.org>
  | 
        
        
            | 
            | 
           10 | 
            * @copyright Tela-Botanica 2009
  | 
        
        
            | 
            | 
           11 | 
            * @license   http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
  | 
        
        
            | 
            | 
           12 | 
            * @license   http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
  | 
        
        
            | 
            | 
           13 | 
            * @version   SVN: $$Id$$
  | 
        
        
            | 
            | 
           14 | 
            * @link /doc/framework/
  | 
        
        
            | 
            | 
           15 | 
            */
  | 
        
        
            | 
            | 
           16 | 
              | 
        
        
            | 
            | 
           17 | 
           include_once('initialisation.php');
  | 
        
        
            | 
            | 
           18 | 
              | 
        
        
            | 
            | 
           19 | 
           // on récupère les variables d'identification
  | 
        
        
            | 
            | 
           20 | 
           $identification = Config::get('identification');
  | 
        
        
            | 
            | 
           21 | 
           $annuaire_controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           22 | 
           if($identification) {
  | 
        
        
            | 
            | 
           23 | 
           	$id = $annuaire_controleur->obtenirIdParMail('1', $identification);
  | 
        
        
            | 
            | 
           24 | 
           } else {
  | 
        
        
            | 
            | 
           25 | 
           	$id = false;
  | 
        
        
            | 
            | 
           26 | 
           }
  | 
        
        
            | 
            | 
           27 | 
              | 
        
        
            | 
            | 
           28 | 
           Registre::getInstance()->set('est_admin',false);
  | 
        
        
            | 
            | 
           29 | 
           Registre::getInstance()->set('identification_id',$id);
  | 
        
        
            | 
            | 
           30 | 
           Registre::getInstance()->set('identification_mail',$identification);
  | 
        
        
            | 
            | 
           31 | 
              | 
        
        
            | 
            | 
           32 | 
           // identification
  | 
        
        
            | 
            | 
           33 | 
           // TODO : faire mieux (un wrapper pour gérer différents types d'objets)
  | 
        
        
            | 
            | 
           34 | 
           if(isset($_GET['id_utilisateur'])) {
  | 
        
        
            | 
            | 
           35 | 
           	$GLOBALS['id_utilisateur'] = $_GET['id_utilisateur'];
  | 
        
        
            | 
            | 
           36 | 
           } else if (isset($_POST['id_utilisateur'])) {
  | 
        
        
            | 
            | 
           37 | 
           	$GLOBALS['id_utilisateur'] = $_POST['id_utilisateur'];
  | 
        
        
            | 
            | 
           38 | 
           } else {
  | 
        
        
            | 
            | 
           39 | 
           	$GLOBALS['id_utilisateur'] = $id;
  | 
        
        
            | 
            | 
           40 | 
           }
  | 
        
        
            | 
            | 
           41 | 
              | 
        
        
            | 
            | 
           42 | 
              | 
        
        
            | 
            | 
           43 | 
           /**
  | 
        
        
            | 
            | 
           44 | 
            * Fonction d'affichage de Papyrus, pour le corps de page
  | 
        
        
            | 
            | 
           45 | 
            */
  | 
        
        
            | 
            | 
           46 | 
           function afficherContenuCorps() {
  | 
        
        
            | 
            | 
           47 | 
              | 
        
        
            | 
            | 
           48 | 
           	// TODO : rendre cette partie modulable.
  | 
        
        
            | 
            | 
           49 | 
           	if(isset($_GET['id_annuaire'])) {
  | 
        
        
            | 
            | 
           50 | 
           		$id_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           51 | 
           	} else {
  | 
        
        
            | 
            | 
           52 | 
           		$_GET['id_annuaire'] = Config::get('annuaire_defaut');
  | 
        
        
            | 
            | 
           53 | 
           	}
  | 
        
        
            | 
            | 
           54 | 
              | 
        
        
            | 
            | 
           55 | 
           	$methode = '';
  | 
        
        
            | 
            | 
           56 | 
              | 
        
        
            | 
            | 
           57 | 
           	if (isset($_GET['m'])) {
  | 
        
        
            | 
            | 
           58 | 
           		$methode = $_GET['m'];
  | 
        
        
            | 
            | 
           59 | 
           		//unset($_GET['m']);
  | 
        
        
            | 
            | 
           60 | 
           	} else {
  | 
        
        
            | 
            | 
           61 | 
           		if (isset($_POST['m'])) {
  | 
        
        
            | 
            | 
           62 | 
           			$methode = $_POST['m'];
  | 
        
        
            | 
            | 
           63 | 
           			//unset($_POST['m']);
  | 
        
        
            | 
            | 
           64 | 
           		} else {
  | 
        
        
            | 
            | 
           65 | 
           				// Gestion des paramêtres définis dans Papyrus
  | 
        
        
            | 
            | 
           66 | 
           			if (isset($GLOBALS['_GEN_commun']['info_application']->m)) {
  | 
        
        
            | 
            | 
           67 | 
              | 
        
        
            | 
            | 
           68 | 
           				if($methode != 'annuaire_afficher_formulaire_oubli_mdp' && $methode != 'annuaire_oubli_mdp') {
  | 
        
        
            | 
            | 
           69 | 
           					       $methode = $GLOBALS['_GEN_commun']['info_application']->m;
  | 
        
        
            | 
            | 
           70 | 
           				}
  | 
        
        
            | 
            | 
           71 | 
           			}
  | 
        
        
            | 
            | 
           72 | 
              | 
        
        
            | 
            | 
           73 | 
           			// Gestion des paramêtres définis dans Papyrus
  | 
        
        
            | 
            | 
           74 | 
           			if (isset($GLOBALS['_GEN_commun']['info_application']->id_annuaire)) {
  | 
        
        
            | 
            | 
           75 | 
           					        $_GET['id_annuaire'] = $GLOBALS['_GEN_commun']['info_application']->id_annuaire;
  | 
        
        
            | 
            | 
           76 | 
           			}
  | 
        
        
            | 
            | 
           77 | 
           		}
  | 
        
        
            | 
            | 
           78 | 
           	}
  | 
        
        
            | 
            | 
           79 | 
              | 
        
        
            | 
            | 
           80 | 
           	$identification = Config::get('identification');
  | 
        
        
            | 
            | 
           81 | 
              | 
        
        
            | 
            | 
           82 | 
           	if(!$identification) {
  | 
        
        
            | 
            | 
           83 | 
              | 
        
        
            | 
            | 
           84 | 
           		switch ($methode) {
  | 
        
        
            | 
            | 
           85 | 
           			case 'annuaire_formulaire_inscription':
  | 
        
        
            | 
            | 
           86 | 
           				$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           87 | 
           				$id = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           88 | 
           				$retour = $controleur->afficherFormulaireInscription($id);
  | 
        
        
            | 
            | 
           89 | 
           				break;
  | 
        
        
            | 
            | 
           90 | 
              | 
        
        
            | 
            | 
           91 | 
           			case 'annuaire_ajout_inscription':
  | 
        
        
            | 
            | 
           92 | 
           				$valeurs = $_POST;
  | 
        
        
            | 
            | 
           93 | 
           				$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           94 | 
           				$retour = $controleur->ajouterInscriptionTemporaire($valeurs);
  | 
        
        
            | 
            | 
           95 | 
           				break;
  | 
        
        
            | 
            | 
           96 | 
              | 
        
        
            | 
            | 
           97 | 
           			case 'annuaire_inscription_confirmation':
  | 
        
        
            | 
            | 
           98 | 
           				$identifiant = $_GET['id'];
  | 
        
        
            | 
            | 
           99 | 
           				$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           100 | 
           				$retour = $controleur->ajouterNouvelleInscriptionEtIdentifier($identifiant);
  | 
        
        
            | 
            | 
           101 | 
           				break;
  | 
        
        
            | 
            | 
           102 | 
              | 
        
        
            | 
            | 
           103 | 
           			case 'f_oubli_mdp':
  | 
        
        
            | 
            | 
           104 | 
           				$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           105 | 
           				$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           106 | 
           				$retour = $controleur->afficherFormulaireOubliMotDePasse($identifiant_annuaire);
  | 
        
        
            | 
            | 
           107 | 
           			break;
  | 
        
        
            | 
            | 
           108 | 
              | 
        
        
            | 
            | 
           109 | 
           			case 'annuaire_oubli_mdp':
  | 
        
        
            | 
            | 
           110 | 
           				$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           111 | 
           				$mail = $_POST['mail'];
  | 
        
        
            | 
            | 
           112 | 
           				$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           113 | 
           				$retour = $controleur->reinitialiserMotDePasse($identifiant_annuaire, $mail);
  | 
        
        
            | 
            | 
           114 | 
           			break;
  | 
        
        
            | 
            | 
           115 | 
              | 
        
        
            | 
            | 
           116 | 
           			case 'annuaire_afficher_carte':
  | 
        
        
            | 
            | 
           117 | 
           				$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           118 | 
              | 
        
        
            | 
            | 
           119 | 
           				$continent = null;
  | 
        
        
            | 
            | 
           120 | 
           				$pays = null;
  | 
        
        
            | 
            | 
           121 | 
           				$departement = null;
  | 
        
        
            | 
            | 
           122 | 
              | 
        
        
            | 
            | 
           123 | 
           				if(isset($_GET['continent'])) {
  | 
        
        
            | 
            | 
           124 | 
           					$continent = $_GET['continent'];
  | 
        
        
            | 
            | 
           125 | 
           				}
  | 
        
        
            | 
            | 
           126 | 
              | 
        
        
            | 
            | 
           127 | 
           				if(isset($_GET['pays'])) {
  | 
        
        
            | 
            | 
           128 | 
           					$pays = $_GET['pays'];
  | 
        
        
            | 
            | 
           129 | 
           				}
  | 
        
        
            | 
            | 
           130 | 
              | 
        
        
            | 
            | 
           131 | 
           				if(isset($_GET['departement'])) {
  | 
        
        
            | 
            | 
           132 | 
           					$departement = $_GET['departement'];
  | 
        
        
            | 
            | 
           133 | 
           				}
  | 
        
        
            | 
            | 
           134 | 
              | 
        
        
            | 
            | 
           135 | 
           				$controleur = new CartoControleur();
  | 
        
        
            | 
            | 
           136 | 
           				$retour = $controleur->cartographier($identifiant_annuaire, $continent, $pays, $departement);
  | 
        
        
            | 
            | 
           137 | 
           			break;
  | 
        
        
            | 
            | 
           138 | 
              | 
        
        
           | 311 | 
           aurelien | 
           139 | 
           			case 'annuaire_inscrits_carto':
  | 
        
        
            | 
            | 
           140 | 
           				$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           141 | 
           				$criteres = $_GET;
  | 
        
        
            | 
            | 
           142 | 
           				$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           143 | 
           				$retour = $controleur->rechercherInscritParlocalisation($identifiant_annuaire,$criteres);
  | 
        
        
            | 
            | 
           144 | 
           			break;
  | 
        
        
           | 141 | 
           aurelien | 
           145 | 
              | 
        
        
           | 433 | 
           aurelien | 
           146 | 
           			default :
  | 
        
        
            | 
            | 
           147 | 
           				$id = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           148 | 
           				$controleur = new IdentificationControleur();
  | 
        
        
            | 
            | 
           149 | 
           				$retour = $controleur->afficherFormulaireIdentification($id);
  | 
        
        
            | 
            | 
           150 | 
           			break;
  | 
        
        
            | 
            | 
           151 | 
           		}
  | 
        
        
            | 
            | 
           152 | 
              | 
        
        
            | 
            | 
           153 | 
           		if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
  | 
        
        
            | 
            | 
           154 | 
           			$retour = mb_convert_encoding($retour, Config::get('sortie_encodage'),Config::get('appli_encodage'));
  | 
        
        
            | 
            | 
           155 | 
           		}
  | 
        
        
            | 
            | 
           156 | 
              | 
        
        
            | 
            | 
           157 | 
           		return $retour;
  | 
        
        
            | 
            | 
           158 | 
           	}
  | 
        
        
            | 
            | 
           159 | 
              | 
        
        
            | 
            | 
           160 | 
              | 
        
        
            | 
            | 
           161 | 
           	switch ($methode) {
  | 
        
        
            | 
            | 
           162 | 
              | 
        
        
            | 
            | 
           163 | 
           		case 'annuaire_inscrits':
  | 
        
        
            | 
            | 
           164 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           165 | 
           			$id = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           166 | 
              | 
        
        
            | 
            | 
           167 | 
           			if(isset($_GET['taille_page'])) {
  | 
        
        
            | 
            | 
           168 | 
           				$taille_page = $_GET['taille_page'];
  | 
        
        
            | 
            | 
           169 | 
           			} else  {
  | 
        
        
            | 
            | 
           170 | 
           				$taille_page = 50;
  | 
        
        
            | 
            | 
           171 | 
           			}
  | 
        
        
            | 
            | 
           172 | 
              | 
        
        
            | 
            | 
           173 | 
           			if(isset($_GET['numero_page'])) {
  | 
        
        
            | 
            | 
           174 | 
           				$numero_page = $_GET['numero_page'];
  | 
        
        
            | 
            | 
           175 | 
           			} else {
  | 
        
        
            | 
            | 
           176 | 
           				$numero_page = 1;
  | 
        
        
            | 
            | 
           177 | 
           			}
  | 
        
        
            | 
            | 
           178 | 
           			$retour = $controleur->afficherFormulaireRecherche($id);
  | 
        
        
            | 
            | 
           179 | 
           			$retour .= $controleur->chargerAnnuaireListeInscrits($id, $numero_page, $taille_page);
  | 
        
        
            | 
            | 
           180 | 
           			break;
  | 
        
        
            | 
            | 
           181 | 
              | 
        
        
            | 
            | 
           182 | 
           		case 'annuaire_afficher_page':
  | 
        
        
            | 
            | 
           183 | 
           			$id_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           184 | 
           			$page = $_GET['page'];
  | 
        
        
            | 
            | 
           185 | 
              | 
        
        
            | 
            | 
           186 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           187 | 
           			$retour = $controleur->afficherPage($id_annuaire, $GLOBALS['id_utilisateur'], $page);
  | 
        
        
            | 
            | 
           188 | 
           			break;
  | 
        
        
            | 
            | 
           189 | 
              | 
        
        
            | 
            | 
           190 | 
           		case 'annuaire_fiche_utilisateur_consultation':
  | 
        
        
            | 
            | 
           191 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           192 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           193 | 
           			$retour = $controleur->afficherFicheUtilisateur($identifiant_annuaire,$GLOBALS['id_utilisateur']);
  | 
        
        
            | 
            | 
           194 | 
           			break;
  | 
        
        
            | 
            | 
           195 | 
              | 
        
        
            | 
            | 
           196 | 
           		case 'annuaire_fiche_resume_consultation':
  | 
        
        
            | 
            | 
           197 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           198 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           199 | 
           			$retour = $controleur->afficherFicheResumeUtilisateur($identifiant_annuaire,$GLOBALS['id_utilisateur']);
  | 
        
        
            | 
            | 
           200 | 
           			break;
  | 
        
        
            | 
            | 
           201 | 
              | 
        
        
            | 
            | 
           202 | 
           		case 'annuaire_fiche_gestion_consultation':
  | 
        
        
            | 
            | 
           203 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           204 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           205 | 
           			$retour = $controleur->gererInscriptionExterne($identifiant_annuaire,Registre::getInstance()->get('identification_id'));
  | 
        
        
            | 
            | 
           206 | 
           			break;
  | 
        
        
            | 
            | 
           207 | 
              | 
        
        
            | 
            | 
           208 | 
              | 
        
        
            | 
            | 
           209 | 
           		case 'annuaire_formulaire_modification_inscription':
  | 
        
        
            | 
            | 
           210 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           211 | 
           			$id_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           212 | 
           			$retour = $controleur->afficherFormulaireModificationInscription($id_annuaire, Registre::getInstance()->get('identification_id'));
  | 
        
        
            | 
            | 
           213 | 
           			break;
  | 
        
        
            | 
            | 
           214 | 
              | 
        
        
            | 
            | 
           215 | 
           		case 'annuaire_modification_inscription':
  | 
        
        
            | 
            | 
           216 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           217 | 
           			$valeurs = $_POST;
  | 
        
        
            | 
            | 
           218 | 
           			$retour = $controleur->modifierInscription($_POST);
  | 
        
        
            | 
            | 
           219 | 
              | 
        
        
            | 
            | 
           220 | 
           			break;
  | 
        
        
            | 
            | 
           221 | 
              | 
        
        
            | 
            | 
           222 | 
           		case 'annuaire_afficher_formulaire_ajout_image':
  | 
        
        
            | 
            | 
           223 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           224 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           225 | 
           			$retour = $controleur->afficherFormulaireUploadImage($identifiant_annuaire,Registre::getInstance()->get('identification_id'), $_GET);
  | 
        
        
            | 
            | 
           226 | 
           			break;
  | 
        
        
            | 
            | 
           227 | 
              | 
        
        
            | 
            | 
           228 | 
           		case 'annuaire_ajouter_image':
  | 
        
        
            | 
            | 
           229 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           230 | 
           			$GLOBALS['id_utilisateur'] = $_GET['id_utilisateur'];
  | 
        
        
            | 
            | 
           231 | 
           			$infos_images = $_FILES;
  | 
        
        
            | 
            | 
           232 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           233 | 
           			$retour = $controleur->ajouterImageUtilisateur($identifiant_annuaire,Registre::getInstance()->get('identification_id'),$infos_images);
  | 
        
        
            | 
            | 
           234 | 
           			break;
  | 
        
        
            | 
            | 
           235 | 
              | 
        
        
            | 
            | 
           236 | 
              | 
        
        
            | 
            | 
           237 | 
           		case 'annuaire_suppression_inscription':
  | 
        
        
            | 
            | 
           238 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           239 | 
           			$id_utilisateur = $_GET['id_utilisateur'];
  | 
        
        
            | 
            | 
           240 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           241 | 
           			$retour = $controleur->supprimerInscription($identifiant_annuaire,Registre::getInstance()->get('identification_id'));
  | 
        
        
            | 
            | 
           242 | 
           			break;
  | 
        
        
            | 
            | 
           243 | 
              | 
        
        
            | 
            | 
           244 | 
           		case 'annuaire_formulaire_suppression_inscription':
  | 
        
        
            | 
            | 
           245 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           246 | 
           			$id_utilisateur = $_GET['id_utilisateur'];
  | 
        
        
            | 
            | 
           247 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           248 | 
           			$retour = $controleur->afficherFormulaireSuppressionInscription($identifiant_annuaire,Registre::getInstance()->get('identification_id'));
  | 
        
        
            | 
            | 
           249 | 
           			break;
  | 
        
        
            | 
            | 
           250 | 
              | 
        
        
            | 
            | 
           251 | 
           		case 'annuaire_afficher_formulaire_recherche':
  | 
        
        
            | 
            | 
           252 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           253 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           254 | 
           			$retour = $controleur->afficherFormulaireRecherche($identifiant_annuaire);
  | 
        
        
            | 
            | 
           255 | 
           			break;
  | 
        
        
            | 
            | 
           256 | 
              | 
        
        
            | 
            | 
           257 | 
           		case 'annuaire_recherche_inscrit':
  | 
        
        
            | 
            | 
           258 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           259 | 
           			unset($_GET['id_annuaire']);
  | 
        
        
            | 
            | 
           260 | 
              | 
        
        
            | 
            | 
           261 | 
           			if(isset($_GET['inclusive'])) {
  | 
        
        
            | 
            | 
           262 | 
           				$exclusive = false;
  | 
        
        
            | 
            | 
           263 | 
           				unset($_GET['inclusive']);
  | 
        
        
            | 
            | 
           264 | 
           			} else {
  | 
        
        
            | 
            | 
           265 | 
           				$exclusive = true;
  | 
        
        
            | 
            | 
           266 | 
           			}
  | 
        
        
            | 
            | 
           267 | 
              | 
        
        
            | 
            | 
           268 | 
           			$criteres = $_GET;
  | 
        
        
            | 
            | 
           269 | 
              | 
        
        
            | 
            | 
           270 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           271 | 
           			$retour = $controleur->rechercherInscrit($identifiant_annuaire,$criteres, $exclusive);
  | 
        
        
            | 
            | 
           272 | 
           			break;
  | 
        
        
            | 
            | 
           273 | 
              | 
        
        
            | 
            | 
           274 | 
           		case 'annuaire_afficher_carte':
  | 
        
        
            | 
            | 
           275 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           276 | 
              | 
        
        
            | 
            | 
           277 | 
           			$continent = null;
  | 
        
        
            | 
            | 
           278 | 
           			$pays = null;
  | 
        
        
            | 
            | 
           279 | 
           			$departement = null;
  | 
        
        
            | 
            | 
           280 | 
              | 
        
        
            | 
            | 
           281 | 
           			if(isset($_GET['continent'])) {
  | 
        
        
            | 
            | 
           282 | 
           				$continent = $_GET['continent'];
  | 
        
        
            | 
            | 
           283 | 
           			}
  | 
        
        
            | 
            | 
           284 | 
              | 
        
        
            | 
            | 
           285 | 
           			if(isset($_GET['pays'])) {
  | 
        
        
            | 
            | 
           286 | 
           				$pays = $_GET['pays'];
  | 
        
        
            | 
            | 
           287 | 
           			}
  | 
        
        
            | 
            | 
           288 | 
              | 
        
        
            | 
            | 
           289 | 
           			if(isset($_GET['departement'])) {
  | 
        
        
            | 
            | 
           290 | 
           				$departement = $_GET['departement'];
  | 
        
        
            | 
            | 
           291 | 
           			}
  | 
        
        
            | 
            | 
           292 | 
              | 
        
        
            | 
            | 
           293 | 
           			$controleur = new CartoControleur();
  | 
        
        
            | 
            | 
           294 | 
           			$retour = $controleur->cartographier($identifiant_annuaire, $continent, $pays, $departement);
  | 
        
        
            | 
            | 
           295 | 
           		break;
  | 
        
        
            | 
            | 
           296 | 
              | 
        
        
            | 
            | 
           297 | 
           		case 'annuaire_inscrits_carto':
  | 
        
        
            | 
            | 
           298 | 
           			$identifiant_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           299 | 
           			$criteres = $_GET;
  | 
        
        
            | 
            | 
           300 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           301 | 
           			$retour = $controleur->rechercherInscritParlocalisation($identifiant_annuaire,$criteres);
  | 
        
        
            | 
            | 
           302 | 
           		break;
  | 
        
        
            | 
            | 
           303 | 
              | 
        
        
            | 
            | 
           304 | 
           		case 'annuaire_envoyer_message':
  | 
        
        
            | 
            | 
           305 | 
              | 
        
        
            | 
            | 
           306 | 
           			$controleur = new MessageControleur();
  | 
        
        
            | 
            | 
           307 | 
              | 
        
        
            | 
            | 
           308 | 
           			$id_annuaire = $_POST['id_annuaire'];
  | 
        
        
            | 
            | 
           309 | 
           			$contenu_message = $_POST['contenu_message'];
  | 
        
        
            | 
            | 
           310 | 
           			$sujet_message = $_POST['sujet_message'];
  | 
        
        
            | 
            | 
           311 | 
           			$destinataires = array_keys($_POST['destinataires']);
  | 
        
        
            | 
            | 
           312 | 
           			$criteres = unserialize(urldecode($_POST['criteres']));
  | 
        
        
            | 
            | 
           313 | 
              | 
        
        
            | 
            | 
           314 | 
           			unset($_POST['id_annuaire']);
  | 
        
        
            | 
            | 
           315 | 
           			if(isset($_POST['envoyer_tous'])) {
  | 
        
        
            | 
            | 
           316 | 
           				$retour = $controleur->envoyerMailParRequete($id_annuaire,Config::get('identification'), $criteres, $sujet_message, $contenu_message);
  | 
        
        
            | 
            | 
           317 | 
           			} else {
  | 
        
        
            | 
            | 
           318 | 
           				$retour = $controleur->envoyerMailDirectOuModere($id_annuaire ,Config::get('identification'), $destinataires, $sujet_message, $contenu_message);
  | 
        
        
            | 
            | 
           319 | 
           			}
  | 
        
        
            | 
            | 
           320 | 
           		break;
  | 
        
        
            | 
            | 
           321 | 
              | 
        
        
            | 
            | 
           322 | 
           		// Fonctions de modération des messages
  | 
        
        
            | 
            | 
           323 | 
           		case 'message_moderation_confirmation':
  | 
        
        
            | 
            | 
           324 | 
           			if(isset($_GET['id'])) {
  | 
        
        
            | 
            | 
           325 | 
           				$id_message = $_GET['id'];
  | 
        
        
            | 
            | 
           326 | 
           			}
  | 
        
        
            | 
            | 
           327 | 
           			$controleur = new MessageControleur();
  | 
        
        
            | 
            | 
           328 | 
           			$retour = $controleur->envoyerMailModere($id_message);
  | 
        
        
            | 
            | 
           329 | 
           		break;
  | 
        
        
            | 
            | 
           330 | 
              | 
        
        
            | 
            | 
           331 | 
           		case 'message_moderation_suppression':
  | 
        
        
            | 
            | 
           332 | 
           			if(isset($_GET['id'])) {
  | 
        
        
            | 
            | 
           333 | 
           				$id_message = $_GET['id'];
  | 
        
        
            | 
            | 
           334 | 
           			}
  | 
        
        
            | 
            | 
           335 | 
           			$controleur = new MessageControleur();
  | 
        
        
            | 
            | 
           336 | 
           			$retour = $controleur->supprimerMailModere($id_message);
  | 
        
        
            | 
            | 
           337 | 
           		break;
  | 
        
        
            | 
            | 
           338 | 
              | 
        
        
            | 
            | 
           339 | 
           		case 'inscription_lettre_actualite':
  | 
        
        
            | 
            | 
           340 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           341 | 
           			$id_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           342 | 
           			$retour = $controleur->inscriptionLettreActualite($id_annuaire, $GLOBALS['id_utilisateur']);
  | 
        
        
            | 
            | 
           343 | 
              | 
        
        
            | 
            | 
           344 | 
           			if(isset($_GET['retour'])) {
  | 
        
        
            | 
            | 
           345 | 
           				$retour = $controleur->gererInscriptionExterne($id_annuaire,$GLOBALS['id_utilisateur']);
  | 
        
        
            | 
            | 
           346 | 
           			}
  | 
        
        
            | 
            | 
           347 | 
           		break;
  | 
        
        
            | 
            | 
           348 | 
              | 
        
        
            | 
            | 
           349 | 
           		case 'desinscription_lettre_actualite':
  | 
        
        
            | 
            | 
           350 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           351 | 
           			$id_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           352 | 
           			$retour = $controleur->desinscriptionLettreActualite($id_annuaire, $GLOBALS['id_utilisateur']);
  | 
        
        
            | 
            | 
           353 | 
              | 
        
        
            | 
            | 
           354 | 
           			if(isset($_GET['retour'])) {
  | 
        
        
            | 
            | 
           355 | 
           				$retour = $controleur->gererInscriptionExterne($id_annuaire,$GLOBALS['id_utilisateur']);
  | 
        
        
            | 
            | 
           356 | 
           			}
  | 
        
        
            | 
            | 
           357 | 
           		break;
  | 
        
        
            | 
            | 
           358 | 
              | 
        
        
            | 
            | 
           359 | 
           		default:
  | 
        
        
            | 
            | 
           360 | 
           			$controleur = new AnnuaireControleur();
  | 
        
        
            | 
            | 
           361 | 
           			$retour = $controleur->afficherFicheUtilisateur(Config::get('annuaire_defaut'),$GLOBALS['id_utilisateur']);
  | 
        
        
            | 
            | 
           362 | 
           		break;
  | 
        
        
            | 
            | 
           363 | 
           	}
  | 
        
        
            | 
            | 
           364 | 
              | 
        
        
            | 
            | 
           365 | 
           	if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
  | 
        
        
            | 
            | 
           366 | 
           		$retour = mb_convert_encoding($retour, Config::get('sortie_encodage'),Config::get('appli_encodage'));
  | 
        
        
            | 
            | 
           367 | 
           	}
  | 
        
        
            | 
            | 
           368 | 
              | 
        
        
            | 
            | 
           369 | 
           	return $retour;
  | 
        
        
            | 
            | 
           370 | 
           }
  | 
        
        
            | 
            | 
           371 | 
              | 
        
        
            | 
            | 
           372 | 
           function afficherContenuTete() {
  | 
        
        
            | 
            | 
           373 | 
              | 
        
        
            | 
            | 
           374 | 
           	// c'est très moche, il ne faudrait pas faire comme ceci
  | 
        
        
            | 
            | 
           375 | 
           	if(function_exists('GEN_stockerStyleExterne')) {
  | 
        
        
            | 
            | 
           376 | 
           		//GEN_stockerStyleExterne('annuaire_papyrus',Config::get('base_url_styles').'squelettes/css/annuaire_complexe.css');
  | 
        
        
            | 
            | 
           377 | 
           		GEN_stockerStyleExterne('annuaire_papyrus_simple',Config::get('base_url_styles').'squelettes/css/annuaire.css');
  | 
        
        
            | 
            | 
           378 | 
           	}
  | 
        
        
            | 
            | 
           379 | 
           	return "";
  | 
        
        
            | 
            | 
           380 | 
           }
  | 
        
        
            | 
            | 
           381 | 
              | 
        
        
            | 
            | 
           382 | 
           function afficherContenuPied() {
  | 
        
        
            | 
            | 
           383 | 
           	return '';
  | 
        
        
            | 
            | 
           384 | 
           }
  | 
        
        
            | 
            | 
           385 | 
              | 
        
        
            | 
            | 
           386 | 
           function afficherContenuNavigation() {
  | 
        
        
            | 
            | 
           387 | 
           	return '';
  | 
        
        
            | 
            | 
           388 | 
           }
  | 
        
        
            | 
            | 
           389 | 
              | 
        
        
            | 
            | 
           390 | 
           function afficherContenuMenu() {
  | 
        
        
            | 
            | 
           391 | 
              | 
        
        
            | 
            | 
           392 | 
           	// TODO : rendre cette partie modulable.
  | 
        
        
            | 
            | 
           393 | 
           	if(isset($_GET['id_annuaire'])) {
  | 
        
        
            | 
            | 
           394 | 
           		$id_annuaire = $_GET['id_annuaire'];
  | 
        
        
            | 
            | 
           395 | 
           	} else {
  | 
        
        
            | 
            | 
           396 | 
           		$id_annuaire = Config::get('annuaire_defaut');
  | 
        
        
            | 
            | 
           397 | 
           	}
  | 
        
        
            | 
            | 
           398 | 
              | 
        
        
            | 
            | 
           399 | 
           	$identification = Config::get('identification');
  | 
        
        
            | 
            | 
           400 | 
              | 
        
        
            | 
            | 
           401 | 
           	if($identification) {
  | 
        
        
            | 
            | 
           402 | 
           		$controleur = new NavigationControleur();
  | 
        
        
            | 
            | 
           403 | 
           		$menu = $controleur->afficherContenuMenu($id_annuaire,false);
  | 
        
        
            | 
            | 
           404 | 
           	} else {
  | 
        
        
            | 
            | 
           405 | 
           		$menu = '';
  | 
        
        
            | 
            | 
           406 | 
           	}
  | 
        
        
            | 
            | 
           407 | 
              | 
        
        
            | 
            | 
           408 | 
           	return '';
  | 
        
        
            | 
            | 
           409 | 
              | 
        
        
            | 
            | 
           410 | 
           	return $menu;
  | 
        
        
            | 
            | 
           411 | 
           }
  | 
        
        
            | 
            | 
           412 | 
              | 
        
        
           | 4 | 
           aurelien | 
           413 | 
           ?>
  |