From 4839b7152181722c732c10a9dbeddecb87b19448 Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Thu, 16 Mar 2023 14:50:35 +0100 Subject: [PATCH] debug --- identification.php | 47 +++++++++++++++++++++++++++++++++++++++ include/fonctions.inc.php | 2 +- index2.php | 3 ++- 3 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 identification.php diff --git a/identification.php b/identification.php new file mode 100644 index 0000000..52d4795 --- /dev/null +++ b/identification.php @@ -0,0 +1,47 @@ +enableDebug(); + if(!isset($_GET['oauth_token']) && !$_SESSION['state']) { + $request_token_info = $oauth->getRequestToken($req_url); + $_SESSION['secret'] = $request_token_info['oauth_token_secret']; + $_SESSION['state'] = 1; + header('Location: '.$authurl.'?oauth_token='.$request_token_info['oauth_token']); + exit; + } else if($_SESSION['state']==1) { + $oauth->setToken($_GET['oauth_token'],$_SESSION['secret']); + $access_token_info = $oauth->getAccessToken($acc_url); + $_SESSION['state'] = 2; + $_SESSION['token'] = $access_token_info['oauth_token']; + $_SESSION['secret'] = $access_token_info['oauth_token_secret']; + } + $oauth->setToken($_SESSION['token'],$_SESSION['secret']); + $oauth->fetch("$api_url/user.json"); + $json = json_decode($oauth->getLastResponse()); + print_r($json); + } catch(OAuthException $E) + { + print_r($E); + } + } +} +?> diff --git a/include/fonctions.inc.php b/include/fonctions.inc.php index 144ca1c..f48d96c 100644 --- a/include/fonctions.inc.php +++ b/include/fonctions.inc.php @@ -83,7 +83,7 @@ function choixVotation($path, $methode = 2, $confirm = true) //2 = toutes les v print "
";
 	foreach($votations as $key => $value )
 	{
-		print ' ' . $value["titre"] . ' :' . $value["libelle"] . '
'; + print ' ' . $value["titre"] . ' :' . $value["libelle"] . '
'; } // TODO confirmation du choix par javascript si $confirm = true diff --git a/index2.php b/index2.php index 1e9c95e..80c2afa 100644 --- a/index2.php +++ b/index2.php @@ -22,12 +22,13 @@ print (""); foreach($votationsList as $votation) { print("');
"); - print('' . $votation["libelle"] . ''); + print('' . $votation["libelle"] . ''); if ($votation["status"] == 1) { print(_("Cloturé")); }else { + print('' . $votation["libelle"] . ''); print(_("En cours")); } print('