Remove munzee.log debugging
This commit is contained in:
parent
80c35c93f0
commit
3f4756b4d5
@ -47,7 +47,7 @@ try {
|
|||||||
include 'capturemunzee.php';
|
include 'capturemunzee.php';
|
||||||
}
|
}
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
file_put_contents("munzee.log", "Error with Munzee code: $ex\n", FILE_APPEND);
|
//file_put_contents("munzee.log", "Error with Munzee code: $ex\n", FILE_APPEND);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($database->has('claimedcodes', ["AND" => ['code' => $origcode, 'playeruuid' => $_SESSION['uuid']]])) {
|
if ($database->has('claimedcodes', ["AND" => ['code' => $origcode, 'playeruuid' => $_SESSION['uuid']]])) {
|
||||||
|
@ -6,10 +6,9 @@ require 'onlyloggedin.php';
|
|||||||
header("Content-Type: text/html");
|
header("Content-Type: text/html");
|
||||||
|
|
||||||
if (!is_empty($_GET['code'])) {
|
if (!is_empty($_GET['code'])) {
|
||||||
file_put_contents("munzee.log", "User " . $_SESSION['uuid'] . " is attempting OAuth.\n", FILE_APPEND);
|
//file_put_contents("munzee.log", "User " . $_SESSION['uuid'] . " is attempting OAuth.\n", FILE_APPEND);
|
||||||
$code = $_GET['code'];
|
$code = $_GET['code'];
|
||||||
$url = 'https://api.munzee.com/oauth/login';
|
$url = 'https://api.munzee.com/oauth/login';
|
||||||
// "client_id=yourclientid&client_secret=yourclientsecret&grant_type=authorization_code&code=JkEQQmjgbPavmqtJtbYEyAD7lYAMYLKBEZhlfeTn&redirect_uri=https://myfancymunzeeapp.org/handle_oauth"
|
|
||||||
$fields = array(
|
$fields = array(
|
||||||
'client_id' => urlencode(MUNZEE_KEY),
|
'client_id' => urlencode(MUNZEE_KEY),
|
||||||
'client_secret' => urlencode(MUNZEE_SECRET),
|
'client_secret' => urlencode(MUNZEE_SECRET),
|
||||||
@ -47,8 +46,8 @@ if (!is_empty($_GET['code'])) {
|
|||||||
|
|
||||||
$jsonresult = json_decode($result, TRUE);
|
$jsonresult = json_decode($result, TRUE);
|
||||||
$data = $jsonresult['data'];
|
$data = $jsonresult['data'];
|
||||||
file_put_contents("munzee.log", "User " . $_SESSION['uuid'] . " OAuth result:\n", FILE_APPEND);
|
//file_put_contents("munzee.log", "User " . $_SESSION['uuid'] . " OAuth result:\n", FILE_APPEND);
|
||||||
file_put_contents("munzee.log", " Result: $result\n\n", FILE_APPEND);
|
//file_put_contents("munzee.log", " Result: $result\n\n", FILE_APPEND);
|
||||||
if ($jsonresult['status_code'] == 200) {
|
if ($jsonresult['status_code'] == 200) {
|
||||||
if ($database->has('munzee', ['player_uuid' => $_SESSION['uuid']])) {
|
if ($database->has('munzee', ['player_uuid' => $_SESSION['uuid']])) {
|
||||||
$database->update('munzee', ['bearertoken' => $data['token']['access_token'], 'refreshtoken' => $data['token']['refresh_token'], 'expires' => $data['token']['expires']], ['player_uuid' => $_SESSION['uuid']]);
|
$database->update('munzee', ['bearertoken' => $data['token']['access_token'], 'refreshtoken' => $data['token']['refresh_token'], 'expires' => $data['token']['expires']], ['player_uuid' => $_SESSION['uuid']]);
|
||||||
|
Reference in New Issue
Block a user