<?php require_once 'class/utilisateur.class.php'; //Varibale commune $user = null; if (!Utilisateur::isConnected()) { include "authCas.inc.php"; } try { $user = Utilisateur::createFromSession(); } catch (Exception $e) { echo $e->getMessage(); exit; } if (isset($_REQUEST['logout'])) { if (isset($_SESSION['phpCAS'])) { require_once "CAS-1.3.4/CAS.php"; require_once "config.php"; // Enable debugging phpCAS::setDebug(); // Initialize phpCAS phpCAS::client(CAS_VERSION_2_0, $cas_host, $cas_port, $cas_context, false); // no SSL validation for the CAS server phpCAS::setNoCasServerValidation(); phpCAS::logoutWithRedirectService("http://localhost/www/GestionnaireStage/index.php"); } else { Utilisateur::logoutIfRequested(); header("Location: index.php"); exit; } }
public function toHTML() { $html = <<<HTML <!DOCTYPE html> <html lang="fr"> <head> <meta charset="utf-8"> \t<title>{$this->title}</title> \t{$this->head} </head> <header> <div id ="divHaut" class="jumbotron"> <div class="row"> <div class="col-xs-5"> \t <h1 id="nomSite">Tournoi de tennis</h1> \t </div> \t <div class="col-xs-2"> {$this->header} </div> <div class="col-xs-5"> HTML; if (Utilisateur::isConnected()) { $html .= Utilisateur::disconnectForm($_SERVER['PHP_SELF']); } else { $html .= Utilisateur::loginForm('../front/Authentification.php'); } $html .= <<<HTML \t <a href="../front/formulaireInscription.php">Inscription</a> \t </div> </div> </div> <ul class="nav nav-tabs nav-justified" id="navbar"> <li role="presentation" class="active"><a class="onglet" href="http://infs3_prj13/index.php">Accueil</a></li> <li role="presentation"><a class="onglet" href="#">Horaires</a></li> <li role="presentation"><a class="onglet" href="#">Terrains</a></li> <li role="presentation"><a class="onglet" href="../front/billetterie.php">Billetterie</a></li> <li role="presentation"><a class="onglet" href="#">Resultats</a></li> {$this->menu} </ul> </header> <body> \t\t \t\t<div id="global"> \t\t\t{$this->body} \t\t</div> </body> </html> HTML; return $html; }