From f3eb274144573ca471260a2e61e5ce12be35c43d Mon Sep 17 00:00:00 2001 From: thaaoblues Date: Thu, 8 Feb 2024 19:50:48 +0100 Subject: [PATCH] =?UTF-8?q?=C3=A7a=20marche=20(+csp=20header=20)=20:D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _partials/_footer.php | 2 +- _partials/_head.php | 5 ++++- api.php | 2 +- index.php | 10 +++++----- js/index.js | 42 +++++++++++++++++++++++++++--------------- session_verif.php | 2 +- televerser.php | 4 +--- 7 files changed, 40 insertions(+), 27 deletions(-) diff --git a/_partials/_footer.php b/_partials/_footer.php index 751dfe3..58a4f5a 100644 --- a/_partials/_footer.php +++ b/_partials/_footer.php @@ -1,4 +1,4 @@ - diff --git a/_partials/_head.php b/_partials/_head.php index 21ab912..627a7bb 100644 --- a/_partials/_head.php +++ b/_partials/_head.php @@ -1,3 +1,6 @@ + @@ -6,5 +9,5 @@ ?> <?=$titre_page?> - + \ No newline at end of file diff --git a/api.php b/api.php index b33c18c..db9fe59 100644 --- a/api.php +++ b/api.php @@ -11,7 +11,7 @@ */ - include("session_verif.php"); + //include("session_verif.php"); include("bdd.php"); include('php-csrf.php'); diff --git a/index.php b/index.php index 3c75979..a34dd2b 100644 --- a/index.php +++ b/index.php @@ -2,8 +2,8 @@ - connection - déconnection + +
@@ -32,6 +32,6 @@ diff --git a/js/index.js b/js/index.js index fdc9d48..c97dc49 100644 --- a/js/index.js +++ b/js/index.js @@ -150,21 +150,33 @@ async function gen_chronologie(){ } -gen_chronologie(); +document.addEventListener("DOMContentLoaded", (event)=>{ + gen_chronologie(); -test_auth(); -document.getElementById("recherche_input").onkeydown =function(event) { - if (event.key === "Enter"){ - rechercher(); + test_auth(); + document.getElementById("recherche_input").onkeydown =function(event) { + if (event.key === "Enter"){ + rechercher(); + } + } + document.getElementById("themes_input").onkeydown =function(event) { + if (event.key === "Enter"){ + var theme = document.createElement("div"); + theme.setAttribute("class","theme"); + theme.innerText = document.getElementById("themes_input").value; + + document.getElementById("recherche_form").appendChild(theme); + document.getElementById("themes_input").value = ""; + } } -} -document.getElementById("themes_input").onkeydown =function(event) { - if (event.key === "Enter"){ - var theme = document.createElement("div"); - theme.setAttribute("class","theme"); - theme.innerText = document.getElementById("themes_input").value; - document.getElementById("recherche_form").appendChild(theme); - document.getElementById("themes_input").value = ""; - } -} + + document.getElementById("btn-connection").addEventListener("click", (event) => { + authenticate_user(); + }); + document.getElementById("btn-deconnection").addEventListener("click", (event) => { + unauthenticate_user(); + }); + +}); + diff --git a/session_verif.php b/session_verif.php index dd84f8b..ef3b670 100644 --- a/session_verif.php +++ b/session_verif.php @@ -10,7 +10,7 @@ phpCAS::setLogger(); phpCAS::setVerbose(true); // Initialize phpCAS -phpCAS::client(CAS_VERSION_2_0, "cas.insa-toulouse.fr", 443, 'cas',"https://cas.insa-toulouse.fr"); +phpCAS::client(CAS_VERSION_2_0, "cas.insa-toulouse.fr", 443, 'cas',"https://arch.etud.insa-toulouse.fr"); // For production use set the CA certificate that is the issuer of the cert // on the CAS server and uncomment the line below diff --git a/televerser.php b/televerser.php index a4cecc8..560e690 100644 --- a/televerser.php +++ b/televerser.php @@ -6,14 +6,12 @@ ?> -