hellofacteurV1/www/index.php

136 lines
6.1 KiB
PHP
Raw Normal View History

2021-11-02 11:23:49 +01:00
<?php
//le point d'entrée de l'application
// !! ordre d'inclusion ci-dessous très important !
require("../config/config.php");
require("../config/config.perso.php");
require("../config/url.page.php");
require("../config/".SITE_LANG.".php");
require("../divers/utilitaires.php");
$page=(!empty($_GET["p"])) ? explode("/",trim($_GET["p"])) : null;
if(empty($page))
include("../ctrl/accueil.php");
//image dans email pour compter affichages
elseif(($page[0]=="img")&&(!empty($page[1])))
include("../ctrl/abo_mail_affichage.php");
elseif(($page[0]=="cgu.html")&&(empty($page[1])))
include("../vues/cgu.php");
elseif(($page[0]=="infos-legales.html")&&(empty($page[1])))
include("../vues/infos-legales.php");
// clics & partages des liens
elseif(($page[0]=="go")&&($page[1]=="a")&&(!empty($page[2]))&&(!empty($page[3]))&&(!empty($page[4])))
include("../ctrl/liens_clic_annonce.php");
elseif(($page[0]=="go")&&(!empty($page[1]))&&(!empty($page[2]))&&(!empty($page[3])))
include("../ctrl/liens_clic.php");
//tâches cron
elseif(($page[0]=="cron")&&(!empty($page[1]))&&(file_exists("../cron/".$page[1].".php")))
include("../cron/".$page[1].".php");
//tout le reste est bloqué durant les opérations de maintenance
elseif(!empty($MSG_MAINTENANCE))
include("../vues/404.php");
elseif(($page[0]=="contact.html")&&(empty($page[1])))
include("../ctrl/contact.php");
elseif(($page[0]=="plan.html")&&(empty($page[1])))
include("../vues/plan.php");
// l'utilisateur, son compte, ses infos persos
elseif(($page[0]=="accueil.html")&&(empty($page[1])))
include("../ctrl/accueil_compte.php");
elseif(($page[0]=="compte")&&($page[1]=="inscription.html"))
include("../ctrl/inscription.php");
elseif(($page[0]=="compte")&&($page[1]=="v")&&(!empty($page[2])))
include("../ctrl/compte_validation.php");
elseif(($page[0]=="compte")&&($page[1]=="connexion.html"))
include("../ctrl/connexion.php");
elseif(($page[0]=="compte")&&($page[1]=="l")&&(!empty($page[2])))
include("../ctrl/compte_lien_connexion.php");
elseif(($page[0]=="compte")&&($page[1]=="s")&&(!empty($page[2])))
include("../ctrl/compte_lien_suppression.php");
elseif(($page[0]=="compte")&&($page[1]=="nouveau_passe.html"))
include("../ctrl/nouveau_passe.php");
elseif(($page[0]=="compte")&&($page[1]=="deconnexion.html"))
include("../ctrl/deconnexion.php");
elseif(($page[0]=="compte")&&($page[1]=="identifiant_maj.html"))
include("../ctrl/compte_identifiant_maj.php");
elseif(($page[0]=="compte")&&($page[1]=="ve")&&(!empty($page[2])))
include("../ctrl/compte_email_maj_validation.php");
elseif(($page[0]=="compte")&&($page[1]=="infos_maj.html"))
include("../ctrl/compte_infos_maj.php");
elseif(($page[0]=="compte")&&($page[1]=="illustration_maj.html"))
include("../ctrl/compte_illustration_maj.php");
// les abonnements
elseif(($page[0]=="rubriques")&&($page[1]=="abo")&&(!empty($page[2])))
include("../ctrl/compte_crea_abo_rubrique.php");
elseif(($page[0]=="rubriques")&&($page[1]=="local")&&($page[2]=="abo"))
include("../ctrl/compte_crea_abo_ville.php");
elseif(($page[0]=="flux")&&($page[1]=="abo")&&($page[2]=="n")&&(!empty($page[3])))
include("../ctrl/compte_crea_abo_nouveau_flux.php");
elseif(($page[0]=="BP")&&($page[1]=="abo")&&(!empty($page[2])))
include("../ctrl/compte_crea_abo_hub.php");
elseif(($page[0]=="abo")&&($page[1]=="voir")&&(!empty($page[2])))
include("../ctrl/compte_abo_voir.php");
elseif(($page[0]=="abo")&&($page[1]=="maj")&&(!empty($page[2])))
include("../ctrl/compte_abo_maj.php");
elseif(($page[0]=="abo"))
include("../ctrl/compte_abo_liste.php");
// périodes d'absence
elseif(($page[0]=="absences")&&($page[1]=="maj"))
include("../ctrl/compte_absences_maj.php");
elseif(($page[0]=="absences"))
include("../ctrl/compte_absences_liste.php");
// les pages administrateurs
elseif(($page[0]=="sources")&&($page[1]=="maj.html"))
include("../ctrl/admin_sources_maj.php");
elseif(($page[0]=="rubriques")&&($page[1]=="maj.html"))
include("../ctrl/admin_rubriques_maj.php");
elseif(($page[0]=="flux")&&($page[1]=="maj.html"))
include("../ctrl/admin_flux_maj.php");
elseif(($page[0]=="hub")&&($page[1]=="maj.html"))
include("../ctrl/admin_hub_maj.php");
elseif(($page[0]=="hub")&&($page[1]=="admin_illustration_maj.html"))
include("../ctrl/admin_hub_illustration_maj.php");
elseif(($page[0]=="posts")&&($page[1]=="maj.html"))
include("../ctrl/admin_posts_maj.php");
elseif(($page[0]=="posts")&&($page[1]=="illustration_maj.html"))
include("../ctrl/post_illustration_maj.php");
elseif(($page[0]=="annonces")&&($page[1]=="maj.html"))
include("../ctrl/admin_annonces_maj.php");
elseif(($page[0]=="comptes")&&($page[1]=="maj.html"))
include("../ctrl/admin_comptes_maj.php");
elseif(($page[0]=="stats")&&($page[1]=="email"))
include("../ctrl/admin_stats_email.php");
elseif($page[0]=="stats")
include("../ctrl/admin_stats.php");
// le répertoire de hubs
elseif(($page[0]=="rubriques")&&($page[1]=="index.html"))
include("../ctrl/repertoire_index.php");
elseif(($page[0]=="rubrique")&&(!empty($page[1])))
include("../ctrl/repertoire_rubrique_info.php");
elseif(($page[0]=="BP")&&(!empty($page[1])))
include("../ctrl/repertoire_hub_info.php");
elseif(($page[0]=="annonce")&&($page[1]=="v")&&(!empty($page[2])))
include("../ctrl/post_validation.php");
elseif(($page[0]=="annonce")&&($page[1]=="a")&&($page[2]=="illustration")&&(!empty($page[3])))
include("../ctrl/post_ajout_illustration.php");
elseif(($page[0]=="annonce")&&($page[1]=="a"))
include("../ctrl/post_ajout.php");
elseif(($page[0]=="annonce")&&($page[1]=="consignes"))
include("../vues/post_ajout_infos.php");
elseif(($page[0]=="annonce")&&(!empty($page[1])))
include("../ctrl/repertoire_annonce_info.php");
elseif(($page[0]=="flux")&&(!empty($page[1])))
include("../ctrl/repertoire_flux_info.php");
elseif(($page[0]=="auteur")&&(!empty($page[1])))
include("../ctrl/utilisateur_info.php");
elseif(($page[0]=="ecrire")&&(!empty($page[1])))
include("../ctrl/utilisateur_contact.php");
// appels ajax
elseif(($page[0]=="JS")&&(!empty($page[1]))&&(file_exists("../ctrl/".$page[1].".php")))
include("../ctrl/".$page[1].".php");
else
{
session_save_path(SESSIONS_REP);
session_start();
header("HTTP/1.0 404 Not Found");
$erreur_404=true;
include("../vues/404.php");
}
exit();