Update getauthtoken.php
This commit is contained in:
parent
73d61204b0
commit
5f57d77719
|
|
@ -34,13 +34,31 @@ $checkifuser->bindParam(':placeid', $placeid);
|
||||||
$checkifuser->execute();
|
$checkifuser->execute();
|
||||||
$momentoftruth = $checkifuser->fetchColumn();
|
$momentoftruth = $checkifuser->fetchColumn();
|
||||||
if ($momentoftruth == 1) {
|
if ($momentoftruth == 1) {
|
||||||
$token = generateRandomString(500);
|
$checktoken = $con->prepare('SELECT COUNT(*) FROM tokens WHERE placeid=:placeid AND passedplacelauncher=:passedplacelauncher AND passedjoinscript=:passedjoinscript');
|
||||||
$fbi = $con->prepare('INSERT INTO tokens (token, placeid, userid) VALUES (:token, :placeid, :userid)');
|
$checktoken->bindParam(':placeid', $placeid);
|
||||||
$fbi->bindParam(':token', $token);
|
$funnyint = '0';
|
||||||
$fbi->bindParam(':placeid', $placeid);
|
$checktoken->bindParam(':passedplacelauncher', $funnyint);
|
||||||
$fbi->bindParam(':userid', $id);
|
$checktoken->bindParam(':passedjoinscript', $funnyint);
|
||||||
$fbi->execute();
|
$checktoken->execute();
|
||||||
die($token);
|
$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 {
|
} else {
|
||||||
echo 'No placeId found';
|
echo 'No placeId found';
|
||||||
exit;
|
exit;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue