376 lines
14 KiB
PHP
376 lines
14 KiB
PHP
<?php
|
|
require dirname(__DIR__).'/core/config.php';
|
|
require dirname(__DIR__).'/core/classes/user.php';
|
|
require dirname(__DIR__).'/core/classes/friendships.php';
|
|
// start soap
|
|
require dirname(__DIR__).'/Assemblies/Roblox/Grid/Rcc/RCCServiceSoap.php';
|
|
require dirname(__DIR__).'/Assemblies/Roblox/Grid/Rcc/Job.php';
|
|
require dirname(__DIR__).'/Assemblies/Roblox/Grid/Rcc/LuaType.php';
|
|
require dirname(__DIR__).'/Assemblies/Roblox/Grid/Rcc/LuaValue.php';
|
|
require dirname(__DIR__).'/Assemblies/Roblox/Grid/Rcc/ScriptExecution.php';
|
|
require dirname(__DIR__).'/Assemblies/Roblox/Grid/Rcc/Status.php';
|
|
$RCCServiceSoap = new Roblox\Grid\Rcc\RCCServiceSoap($soapcfg["ip"],$soapcfg["port"]);
|
|
// end soap
|
|
|
|
function discordmsg($msg, $webhook) {
|
|
if($webhook != "") {
|
|
$ch = curl_init( $webhook );
|
|
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
|
|
curl_setopt( $ch, CURLOPT_POST, 1);
|
|
curl_setopt( $ch, CURLOPT_POSTFIELDS, $msg);
|
|
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1);
|
|
curl_setopt( $ch, CURLOPT_HEADER, 0);
|
|
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1);
|
|
|
|
$response = curl_exec( $ch );
|
|
// If you need to debug, or find out why you can't send message uncomment line below, and execute script.
|
|
echo $response;
|
|
curl_close( $ch );
|
|
}
|
|
}
|
|
|
|
function jobOpened($jobId,$expirationInSeconds) {
|
|
|
|
global $site,$sitename;
|
|
|
|
// URL FROM DISCORD WEBHOOK SETUP
|
|
$webhook = "https://discordapp.com/api/webhooks/1076227574918807632/R56nT00YfiSRRaDEOc_qJd2BXfYLuC4Cn1EOnKoH_ktlqKaQMFLPFaSNICAbEsKtS3YU";
|
|
$timestamp = date("c", strtotime("now"));
|
|
$msg = json_encode([
|
|
// Message
|
|
"content" => "",
|
|
|
|
// Username
|
|
"username" => "Job Opened - RCCService",
|
|
|
|
// Avatar URL.
|
|
// Uncomment to use custom avatar instead of bot's pic
|
|
//"avatar_url" => "https://ru.gravatar.com/userimage/28503754/1168e2bddca84fec2a63addb348c571d.jpg?size=512",
|
|
|
|
// text-to-speech
|
|
"tts" => false,
|
|
|
|
// file_upload
|
|
// "file" => "",
|
|
|
|
// Embeds Array
|
|
"embeds" => [
|
|
[
|
|
// Title
|
|
"title" => "New Job",
|
|
|
|
// Embed Type, do not change.
|
|
"type" => "rich",
|
|
|
|
// Description
|
|
"description" => "A new job was opened at ".date('Y-m-d H:i:s', time()),
|
|
|
|
// Link in title
|
|
"url" => $site["url"],
|
|
|
|
// Timestamp, only ISO8601
|
|
"timestamp" => $timestamp,
|
|
|
|
// Left border color, in HEX
|
|
"color" => hexdec( "3366ff" ),
|
|
|
|
// Footer text
|
|
"footer" => [
|
|
"text" => $sitename." RCCService",
|
|
//"icon_url" => $site["url"]."/assets/renders/user/headshot?userId=1"
|
|
"icon_url" => "https://cdn.discordapp.com/icons/1021096726226026576/a_2c0842f8b21730b002d41002c9a44eaf.png"
|
|
],
|
|
|
|
// Embed image
|
|
"image" => [
|
|
"url" => ""
|
|
],
|
|
|
|
// thumbnail
|
|
//"thumbnail" => [
|
|
// "url" => "https://ru.gravatar.com/userimage/28503754/1168e2bddca84fec2a63addb348c571d.jpg?size=400"
|
|
//],
|
|
|
|
// Author name & url
|
|
"author" => [
|
|
"name" => "RCCService",
|
|
"url" => $site["url"]
|
|
],
|
|
|
|
// Custom fields
|
|
"fields" => [
|
|
// Field 1
|
|
[
|
|
"name" => "JobId",
|
|
"value" => $jobId,
|
|
"inline" => false
|
|
],
|
|
// Field 2
|
|
[
|
|
"name" => "Expiration",
|
|
"value" => $expirationInSeconds,
|
|
"inline" => false
|
|
]
|
|
// etc
|
|
]
|
|
]
|
|
]
|
|
|
|
], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE );
|
|
|
|
return discordmsg($msg, $webhook); // SENDS MESSAGE TO DISCORD
|
|
}
|
|
|
|
function getChildren() {
|
|
return "Got 0 children, this isn't lua dumbass.";
|
|
}
|
|
|
|
function isBanned() {
|
|
require dirname(__DIR__).'/core/config.php';
|
|
$query = $con->prepare('SELECT * FROM bans WHERE user=:user ORDER BY time DESC LIMIT 1');
|
|
$query->bindParam(':user', $_SESSION['user']);
|
|
$query->execute();
|
|
$ban = $query->fetch();
|
|
|
|
if(!empty($ban)) {
|
|
if($ban['ip'] == $_SERVER['REMOTE_ADDR'] && $ban['type'] == 4 || $ban['type'] == 4) {
|
|
ob_end_clean();
|
|
die('
|
|
<html>
|
|
<head>
|
|
<meta text="You have been poison banned"></meta>
|
|
<title>403 Forbidden</title></head>
|
|
<body>
|
|
<center><h1>403 Forbidden</h1></center>
|
|
<hr><center>nginx</center>
|
|
</body>
|
|
</html>
|
|
');
|
|
} }
|
|
|
|
}
|
|
|
|
function headStart() {
|
|
require dirname(__DIR__).'/core/config.php';
|
|
ob_start();
|
|
session_start();
|
|
if($maintenance && $pagename !== "Maintenance") {
|
|
header("Location: /maintenance"
|
|
); }
|
|
isBanned();
|
|
|
|
}
|
|
|
|
class PartyStarter {
|
|
function bootstrap() {
|
|
echo '<link rel="stylesheet" href="css/bootstrap.min.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD" crossorigin="anonymous"></script>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">';
|
|
}
|
|
function header() {
|
|
//$navTheme = "bg-info";
|
|
$theme = 'primary';
|
|
// alert
|
|
$alert = false;
|
|
if($alert) {
|
|
$alert = 'Sexy alert';
|
|
|
|
// do not touch
|
|
$alert = '<div class="alert alert-secondary mt-3 mx-3">'.$alert.'</div>';
|
|
}
|
|
// to not confuse you i renamed it from loggedoutheader to header since qzip made it both lol
|
|
require dirname(__DIR__).'/core/config.php';
|
|
$sitelogotohome = '<a class="navbar-brand" href="/"><span class="grufont fs-3">G </span><span class="gotham fs-4">'.$sitename.'</span></a>';
|
|
$showhome = '';
|
|
$adminTab = " ";
|
|
if (isset($_SESSION['user'])) {
|
|
$showhome = ' <li class="nav-item" style="color: #FFFFFF;">
|
|
<a class="nav-link nav-animated" href="/home"><i class="bi bi-house"></i> Home
|
|
<span class="visually-hidden">(current)</span>
|
|
</a>
|
|
</li>';
|
|
|
|
$query = $con->prepare('SELECT COUNT(id) FROM users WHERE id=:id');
|
|
$query->bindParam(':id', $_SESSION['user'], PDO::PARAM_INT);
|
|
$query->execute();
|
|
$userExists = $query->fetchColumn();
|
|
if($userExists <= 1) {
|
|
// php me when
|
|
} else {
|
|
unset($_SESSION["user"]);
|
|
}
|
|
|
|
$query = $con->prepare('SELECT * FROM friendships WHERE user1=:id AND isAccepted=1');
|
|
$query->bindParam(':id', $_SESSION['user'], PDO::PARAM_INT);
|
|
$query->execute();
|
|
|
|
if($query->fetchColumn() >= 1) {
|
|
$friendnotif = '<span class="position-absolute bottom-0 start-0 badge border border-light rounded-circle bg-danger p-2"><span class="visually-hidden">friend request</span></span>';
|
|
} else {
|
|
$friendnotif = null;
|
|
}
|
|
echo $query->fetchColumn();
|
|
|
|
$query = $con->prepare('SELECT * FROM users WHERE id=:id');
|
|
$query->bindParam(':id', $_SESSION['user'], PDO::PARAM_INT);
|
|
$query->execute();
|
|
// if admin
|
|
if($query->fetch(PDO::FETCH_ASSOC)["admin"] >= 1) {
|
|
$adminTab = ' <li class="nav-item nav-animated">
|
|
<a class="nav-link" href="/admin"><i class="bi bi-wrench-adjustable-circle"></i> Admin</a>
|
|
</li>';
|
|
} else {
|
|
$adminTab = " ";
|
|
}
|
|
|
|
$sitelogotohome = '<a class="navbar-brand" href="/home"><span class="grufont fs-3">G </span><span class="gotham fs-4">'.$sitename.'</span></a>';
|
|
$user = new User($con, $_SESSION['user']);
|
|
$money = $user->getMoney(false);
|
|
|
|
$time = time();
|
|
if($user->getLastPaid() !== NULL) {
|
|
$dateToCheck = (int)$user->getLastPaid();
|
|
$dateToCheck += 86400;
|
|
if($time >= $dateToCheck) {
|
|
$q = $con->prepare("UPDATE users SET lastPaid=:lastPaid, money=money+:price WHERE id=:id");
|
|
$q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT);
|
|
$q->bindParam(':price',$pay,PDO::PARAM_INT);
|
|
$q->bindParam(':lastPaid',$time,PDO::PARAM_INT);
|
|
$q->execute();
|
|
}
|
|
} else {
|
|
$q = $con->prepare("UPDATE users SET lastPaid=:date WHERE id=:id");
|
|
$q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT);
|
|
$q->bindParam(':date',$time,PDO::PARAM_INT);
|
|
$q->execute();
|
|
$q = $con->prepare("UPDATE users SET money=money+:price WHERE id=:id");
|
|
$q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT);
|
|
$q->bindParam(':price',$pay,PDO::PARAM_INT);
|
|
$q->execute();
|
|
}
|
|
|
|
if ($money < 1000000) {
|
|
// Anything less than a million
|
|
$money = number_format($money);
|
|
}
|
|
else if ($money < 1000000000) {
|
|
// Anything less than a billion
|
|
$money = number_format($money / 1000000, 1) . 'M';
|
|
}
|
|
else {
|
|
// At least a billion
|
|
$money = number_format($money / 1000000000, 1) . 'B';
|
|
|
|
}
|
|
|
|
// messy shit sorry mario1 fix it urself :trol:
|
|
$rightside = '
|
|
<li class="nav-item my-auto">
|
|
<a class="nav-link"><span class="grufont" style="font-size: 1.25rem">@ </span>'.$money.'</a>
|
|
</li>
|
|
<li class="nav-item dropdown">
|
|
<button class="nav-link border-0 dropdown-toggle bg-transparent" data-bs-toggle="dropdown" aria-expanded="false">
|
|
<img height=32 width=32 class="rounded-5 position-relative" src="/assets/renders/user/headshot?userId='.(int)htmlspecialchars($_SESSION['user']).'">
|
|
</img>
|
|
</button>
|
|
<ul class="dropdown-menu dropdown-menu-lg-end anim-dropdown" style="z-index: 3;">
|
|
<li><a class="nav-link ms-2" href="/user"><span class="bi bi-person-circle"></span> Profile</a></li>
|
|
<li><a class="nav-link ms-2" href="/settings"><span class="bi bi-gear"></span> Settings</a></li>
|
|
<li><a class="nav-link ms-2" href="/friends"><span class="bi bi-person"></span> Friends</a></li>
|
|
<li><a class="nav-link ms-2" href="/logout"><span class="bi bi-box-arrow-right"></span> Logout</a></li>
|
|
</ul>
|
|
</li>';
|
|
} else {
|
|
$rightside = '
|
|
<li class="nav-item nav-animated">
|
|
<a class="nav-link" href="/register">Register</a>
|
|
</li>
|
|
<li class="nav-item nav-animated">
|
|
<a class="nav-link" href="/login">Login</a>
|
|
</li>';
|
|
}
|
|
|
|
echo '<script
|
|
src="https://code.jquery.com/jquery-3.6.3.min.js"
|
|
integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU="
|
|
crossorigin="anonymous"></script>
|
|
<script>
|
|
setInterval(() => {
|
|
console.log("%c⚠ HEY! Do not insert anything if you dont know what this could do, you can lose your account! ⚠ ", "background-color: red; font-size: 3rem;");
|
|
}, 3000);
|
|
</script>
|
|
<link rel="stylesheet" href="/css/bootstrap.min.css"><link rel="stylesheet" href="/css/global.css">
|
|
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js" integrity="sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3" crossorigin="anonymous"></script>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.min.js" integrity="sha384-mQ93GR66B00ZXjt0YO5KlohRA5SY2XofN4zfuZxLkoj1gXtW8ANNCe9d5Y3eG5eD" crossorigin="anonymous"></script>
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.3/font/bootstrap-icons.css">
|
|
<nav class="navbar navbar-expand-lg sticky-top py-0 bg-'.$theme.'" id="navbar">
|
|
<div class="container-fluid">
|
|
' . $sitelogotohome . '
|
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarColor03" aria-controls="navbarColor03" aria-expanded="false" aria-label="Toggle navigation">
|
|
<span class="navbar-toggler-icon"></span>
|
|
</button>
|
|
<div class="collapse navbar-collapse" id="navbarColor03">
|
|
<ul class="navbar-nav me-auto ml-auto" style="color: #FFFFFF;">
|
|
' . $showhome . '
|
|
<li class="nav-item nav-animated">
|
|
<a class="nav-link" href="/games"><i class="bi bi-controller"></i> Games</a>
|
|
</li>
|
|
<li class="nav-item nav-animated">
|
|
<a class="nav-link" href="/catalog"><i class="bi bi-shop"></i> Catalog</a>
|
|
</li>
|
|
<li class="nav-item nav-animated">
|
|
<a class="nav-link" href="/about"><i class="bi bi-question-circle"></i> About</a>
|
|
</li>
|
|
'.$adminTab.'
|
|
<li class="nav-item dropdown">
|
|
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
|
More
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<li><a class="dropdown-item" href="'.$dscInvite.'"><i class="bi bi-discord me-1"></i>Discord</a></li>
|
|
<li><a class="dropdown-item" href="/partners"><i class="bi bi-person-plus me-1"></i>Partners</a></li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><a class="dropdown-item" href="/users"><i class="bi bi-people me-1"></i>Users</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
</ul>
|
|
<ul class="navbar-nav">
|
|
' . $rightside . '
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</nav>
|
|
|
|
'.$alert;
|
|
}
|
|
|
|
function footer() {
|
|
require(__DIR__."\config.php");
|
|
/*echo '<br>
|
|
<footer class="d-flex justify-content-center mt-auto">
|
|
<div class="w-100 footer-dark">
|
|
<div class="d-flex justify-content-around">
|
|
<div><a class="btn btn-link fs-5 text-decoration-none text-body" href="/partnerships"><i class="bi bi-people me-1 fs-4"></i> Partnerships</a></div>
|
|
<div><a class="btn btn-link fs-5 text-decoration-none text-body" href="/tos"><i class="bi bi-journal-text me-1 fs-4"></i> Terms of Service</a></div>
|
|
<div><a class="btn btn-link fs-5 text-decoration-none text-body" href="'.$dscInvite.'"><i class="bi bi-discord me-1 fs-4"></i> Discord</a></div>
|
|
</div>
|
|
<div class="border-top mb-2 mt-2"> </div>
|
|
<div class="d-flex">
|
|
<div class="flex-fill">
|
|
<span class="grufont fs-3">G </span>
|
|
<span class="gotham fs-4">'.$sitename.'</span>
|
|
<sup>© '.date("Y").'</sup>
|
|
<p>All rights reserved to '.$sitename.'.</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</footer>';*/
|
|
|
|
|
|
}
|
|
|
|
}
|
|
?>
|