diff --git a/session_verif.php b/session_verif.php index 4043e0d..00ccf48 100644 --- a/session_verif.php +++ b/session_verif.php @@ -41,6 +41,14 @@ function verifier_session(){ //return json_encode(["status"=>1,"msg"=>"Bonjour !"]); } +$ADMINS = array("mougnibas","rebillar"); + +function admin_seulement(){ + global $ADMINS; + if(!in_array(phpCAS::getUser(), $ADMINS)) { + header("Location: /index.php"); + } +} ?> \ No newline at end of file diff --git a/validation.php b/validation.php index 4e00d39..a46282c 100644 --- a/validation.php +++ b/validation.php @@ -14,6 +14,8 @@ include("test_creds.php"); $conn = new mysqli($servername, $username, $password,$dbname); +admin_seulement(); + // Function to fetch and display documents function generer_chronologie() {