Update Join.php

This commit is contained in:
Mario 2023-02-13 11:11:37 +02:00 committed by GitHub
parent 9ead5c3543
commit b7cd9ac98a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 25 additions and 4 deletions

View File

@ -23,17 +23,35 @@ $checkjob = $con->prepare('SELECT COUNT(*) FROM jobs WHERE jobid=:jobid'); // br
$checkjob->bindParam(':jobid', $jobid);
$checkjob->execute();
$anothermomentoftruth = $checkjob->fetchColumn();
$checkuser = $con->prepare('SELECT COUNT(*) FROM users WHERE token=:token'); // another temp workaround im gonna do token system and stuff whenever i feel like it
$checkuser = $con->prepare('SELECT COUNT(*) FROM tokens WHERE token=:token'); // another temp workaround im gonna do token system and stuff whenever i feel like it
$checkuser->bindParam(':token', $token);
$checkuser->execute();
$anotheranothermomentoftruth = $checkuser->fetchColumn();
if ($anothermomentoftruth == 1 && $anotheranothermomentoftruth == 1) {
$getstuff = $con->prepare('SELECT id,username FROM users WHERE token=:token');
$okbruh = "1";
$haha = $con->prepare('SELECT COUNT(*) FROM tokens WHERE token=:token AND passedjoinscript=:passed');
$haha->bindParam(':token', $token);
$haha->bindParam(':passed', $okbruh);
$haha->execute();
$moretrolling = $haha->fetchColumn();
if ($moretrolling == 1) {
header("Location: /");
} else if ($moretrolling == 0) {
$hahatroll = $con->prepare('UPDATE tokens SET passedjoinscript = 1 WHERE token=:token');
$hahatroll->bindParam(':token', $token);
$hahatroll->execute();
$getstuff = $con->prepare('SELECT placeid,userid FROM tokens WHERE token=:token');
$getstuff->bindParam(':token', $token);
$getstuff->execute();
$china = $getstuff->fetch(PDO::FETCH_BOTH);
$id = $china['id'];
$username = $china['username'];
$placeid = $china['placeid'];
$id = $china['userid'];
$getusername = $con->prepare('SELECT username FROM users WHERE id=:id');
$getusername->bindParam(':id', $id);
$getusername->execute();
$ok = $getusername->fetch(PDO::FETCH_BOTH);
$username = $ok['username'];
$china = $getstuff->fetch(PDO::FETCH_BOTH);
$jobstuff = $con->prepare('SELECT jobid,placeid,port FROM jobs WHERE jobid=:jobid');
$jobstuff->bindParam(':jobid', $jobid);
$jobstuff->execute();
@ -82,6 +100,9 @@ if ($anothermomentoftruth == 1 && $anotheranothermomentoftruth == 1) {
"FollowUserId" => 0,
"characterAppearanceId" => $id
];
} else {
header("Location: /");
}
} else {
header("Location: /");
}