test auth_mode
This commit is contained in:
parent
dcf36bf384
commit
ff9183990a
@ -1,14 +1,33 @@
|
|||||||
<?php
|
<?php
|
||||||
// Menu principal de Winlog
|
// Menu principal de Winlog
|
||||||
header ('Content-Type: text/html; charset=utf-8');
|
|
||||||
include_once('libhome.php');
|
|
||||||
include_once('winlog_admin_conf.php');
|
include_once('winlog_admin_conf.php');
|
||||||
include_once('connexions.php');
|
include_once('connexions.php');
|
||||||
include_once('session.php');
|
include_once('session.php');
|
||||||
|
|
||||||
// récupération du username CAS et stockage en session PHP.
|
// test mode authentification
|
||||||
// note : la session PHP est déjà démarrée par la lib phpCAS.
|
switch ($auth_mode) {
|
||||||
$username = phpCAS::getUser();
|
|
||||||
|
case "simple":
|
||||||
|
session_start();
|
||||||
|
if (!isset($_SESSION['username'])) {
|
||||||
|
header('Location: authentification.php');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
$username = $_SESSION['username'];
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "CAS":
|
||||||
|
// la session PHP est déjà démarrée par la lib phpCAS.
|
||||||
|
include('libhome.php');
|
||||||
|
$username = phpCAS::getUser();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
header('Location: interdit.php');
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Stockage du username en session PHP.
|
||||||
$_SESSION['username'] = $username;
|
$_SESSION['username'] = $username;
|
||||||
|
|
||||||
$profil = Profil($username);
|
$profil = Profil($username);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user