Update getauthtoken.php

This commit is contained in:
Mario 2023-03-02 22:47:17 +02:00 committed by GitHub
parent 73d61204b0
commit 5f57d77719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 7 deletions

View File

@ -34,13 +34,31 @@ $checkifuser->bindParam(':placeid', $placeid);
$checkifuser->execute();
$momentoftruth = $checkifuser->fetchColumn();
if ($momentoftruth == 1) {
$token = generateRandomString(500);
$fbi = $con->prepare('INSERT INTO tokens (token, placeid, userid) VALUES (:token, :placeid, :userid)');
$fbi->bindParam(':token', $token);
$fbi->bindParam(':placeid', $placeid);
$fbi->bindParam(':userid', $id);
$fbi->execute();
die($token);
$checktoken = $con->prepare('SELECT COUNT(*) FROM tokens WHERE placeid=:placeid AND passedplacelauncher=:passedplacelauncher AND passedjoinscript=:passedjoinscript');
$checktoken->bindParam(':placeid', $placeid);
$funnyint = '0';
$checktoken->bindParam(':passedplacelauncher', $funnyint);
$checktoken->bindParam(':passedjoinscript', $funnyint);
$checktoken->execute();
$getintforchecktoken = $checktoken->fetchColumn();
if ($getintforchecktoken == '1') {
$fbi2 = $con->prepare('SELECT token FROM tokens WHERE placeid=:placeid AND passedplacelauncher=:passedplacelauncher AND passedjoinscript=:passedjoinscript');
$fbi2->bindParam(':placeid', $placeid);
$fbi2->bindParam(':passedplacelauncher', $funnyint);
$fbi2->bindParam(':passedjoinscript', $funnyint);
$fbi2->execute();
$china3 = $fbi2->fetch(PDO::FETCH_BOTH);
$token = $china3['token'];
die($token);
} elseif ($getintforchecktoken == '0') {
$token = generateRandomString(500);
$fbi = $con->prepare('INSERT INTO tokens (token, placeid, userid) VALUES (:token, :placeid, :userid)');
$fbi->bindParam(':token', $token);
$fbi->bindParam(':placeid', $placeid);
$fbi->bindParam(':userid', $id);
$fbi->execute();
die($token);
}
} else {
echo 'No placeId found';
exit;