yes
This commit is contained in:
parent
61fba547ea
commit
11c061ec88
32
admin.php
32
admin.php
|
|
@ -1,27 +1,27 @@
|
||||||
<?php
|
<?php
|
||||||
ob_start();
|
require_once 'core/classes.php';
|
||||||
session_start();
|
require_once 'core/classes/user.php';
|
||||||
|
headStart();
|
||||||
require_once('core/config.php');
|
require_once('core/config.php');
|
||||||
if($maintenance && $pagename !== "Maintenance") {
|
if($maintenance && $pagename !== "Maintenance") {
|
||||||
header("Location: /maintenance"
|
header("Location: /maintenance"
|
||||||
); }
|
); }
|
||||||
|
$user = new User($con, $_SESSION['user'] ?? 0);
|
||||||
|
if(!$user->isLoggedIn()) {
|
||||||
|
header('location: /login');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html data-bs-theme="dark">
|
<html data-bs-theme="dark">
|
||||||
<head>
|
<head>
|
||||||
<?php
|
<?php
|
||||||
|
if(isAdmin() == '0') {
|
||||||
require_once('core/classes.php');
|
header('Location: /home');
|
||||||
require_once('core/classes/user.php');
|
exit;
|
||||||
if(isset($_SESSION['user'])) {
|
|
||||||
$user = new User($con, $_SESSION['user']);
|
|
||||||
$loggedIn = true;
|
|
||||||
} else {
|
|
||||||
$loggedIn = false;
|
|
||||||
}
|
}
|
||||||
$getitstarted = new PartyStarter;
|
$getitstarted = new PartyStarter;
|
||||||
$getitstarted->header();
|
$getitstarted->header();
|
||||||
|
|
||||||
if(isset($_GET['p'])) {
|
if(isset($_GET['p'])) {
|
||||||
$page = $_GET['p'];
|
$page = $_GET['p'];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -56,11 +56,15 @@ $offset = $page * $limit;
|
||||||
<th scope="col" class="border">Date registered</th>
|
<th scope="col" class="border">Date registered</th>
|
||||||
<th scope="col" class="border">Money</th>
|
<th scope="col" class="border">Money</th>
|
||||||
<th scope="col" class="border">Admin</th>
|
<th scope="col" class="border">Admin</th>
|
||||||
|
<th scope="col" class="border">Banned</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
$q = $con->prepare("SELECT * FROM users");
|
$b = $con->prepare('SELECT * FROM bans');
|
||||||
|
$b->execute();
|
||||||
|
$banned = $b->fetchAll();
|
||||||
|
$q = $con->prepare('SELECT * FROM users');
|
||||||
//$q->bindParam(':name',$_POST['name']);
|
//$q->bindParam(':name',$_POST['name']);
|
||||||
$q->execute();
|
$q->execute();
|
||||||
$users = $q->fetchAll();
|
$users = $q->fetchAll();
|
||||||
|
|
@ -73,8 +77,10 @@ $offset = $page * $limit;
|
||||||
<td><?php echo $user['date']; ?></td>
|
<td><?php echo $user['date']; ?></td>
|
||||||
<td><?php echo $sUser->getMoney(true)." (".$sUser->getMoney(false).")"; ?></td>
|
<td><?php echo $sUser->getMoney(true)." (".$sUser->getMoney(false).")"; ?></td>
|
||||||
<?php if($user['admin'] == 1) { echo "<td>True</td>"; } else { echo "<td>False</td>"; } ?></td>
|
<?php if($user['admin'] == 1) { echo "<td>True</td>"; } else { echo "<td>False</td>"; } ?></td>
|
||||||
|
<?php foreach ($banned as $ban) {
|
||||||
|
echo '<td>False</td>'; } ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
<?php }?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
|
|
|
||||||
|
|
@ -151,9 +151,9 @@ function jobOpened($jobId,$expirationInSeconds) {
|
||||||
return discordmsg($msg, $webhook); // SENDS MESSAGE TO DISCORD
|
return discordmsg($msg, $webhook); // SENDS MESSAGE TO DISCORD
|
||||||
}
|
}
|
||||||
|
|
||||||
function getChildren() {
|
/* function getChildren() {
|
||||||
return "Got 0 children, this isn't lua dumbass.";
|
return "Got 0 children, this isn't lua dumbass."; // bro who the fuck made this function?
|
||||||
}
|
} */
|
||||||
|
|
||||||
function isBanned() {
|
function isBanned() {
|
||||||
require dirname(__DIR__).'/core/config.php';
|
require dirname(__DIR__).'/core/config.php';
|
||||||
|
|
@ -161,7 +161,6 @@ $query = $con->prepare('SELECT * FROM bans WHERE user=:user ORDER BY time DESC L
|
||||||
$query->bindParam(':user', $_SESSION['user']);
|
$query->bindParam(':user', $_SESSION['user']);
|
||||||
$query->execute();
|
$query->execute();
|
||||||
$ban = $query->fetch();
|
$ban = $query->fetch();
|
||||||
|
|
||||||
if(!empty($ban)) {
|
if(!empty($ban)) {
|
||||||
if($ban['ip'] == $_SERVER['REMOTE_ADDR'] && $ban['type'] == 4 || $ban['type'] == 4) {
|
if($ban['ip'] == $_SERVER['REMOTE_ADDR'] && $ban['type'] == 4 || $ban['type'] == 4) {
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
@ -176,8 +175,21 @@ die('
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
');
|
');
|
||||||
} }
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function isAdmin() {
|
||||||
|
require dirname(__DIR__).'/core/config.php';
|
||||||
|
if($_SESSION['user'] == '0') {
|
||||||
|
header('Location: /login');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
$israel = $con->prepare('SELECT * FROM users WHERE id=:id');
|
||||||
|
$israel->bindParam(':id', $_SESSION['user']);
|
||||||
|
$israel->execute();
|
||||||
|
$getadmin = $israel->fetch(PDO::FETCH_BOTH);
|
||||||
|
return $getadmin['admin'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function headStart() {
|
function headStart() {
|
||||||
|
|
@ -188,7 +200,6 @@ if($maintenance && $pagename !== "Maintenance") {
|
||||||
header("Location: /maintenance"
|
header("Location: /maintenance"
|
||||||
); }
|
); }
|
||||||
isBanned();
|
isBanned();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class PartyStarter {
|
class PartyStarter {
|
||||||
|
|
|
||||||
10
grublox.sql
10
grublox.sql
|
|
@ -1,11 +1,11 @@
|
||||||
-- phpMyAdmin SQL Dump
|
-- phpMyAdmin SQL Dump
|
||||||
-- version 5.2.1
|
-- version 5.2.0
|
||||||
-- https://www.phpmyadmin.net/
|
-- https://www.phpmyadmin.net/
|
||||||
--
|
--
|
||||||
-- Host: 127.0.0.1
|
-- Host: 127.0.0.1
|
||||||
-- Generation Time: May 06, 2023 at 09:42 AM
|
-- Generation Time: Jun 04, 2023 at 02:45 PM
|
||||||
-- Server version: 10.4.28-MariaDB
|
-- Server version: 10.4.27-MariaDB
|
||||||
-- PHP Version: 8.2.4
|
-- PHP Version: 8.2.0
|
||||||
|
|
||||||
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||||
START TRANSACTION;
|
START TRANSACTION;
|
||||||
|
|
@ -140,7 +140,7 @@ CREATE TABLE `games` (
|
||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO `games` (`id`, `name`, `description`, `creator`, `players`, `state`, `date`, `updateddate`, `thumbnail`, `playercount`) VALUES
|
INSERT INTO `games` (`id`, `name`, `description`, `creator`, `players`, `state`, `date`, `updateddate`, `thumbnail`, `playercount`) VALUES
|
||||||
(1818, 'Crossroads', 'The classic ROBLOX level is back!', 1, 8, '', '2023-02-27 21:44:29', '2023-03-02 10:38:11', '/assets/placeholder2.png', 250);
|
(1818, 'Crossroads', 'The classic ROBLOX level is back!', 1, 0, '', '2023-02-27 21:44:29', '2023-06-04 15:39:25', '/assets/placeholder2.png', 250);
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
||||||
5
home.php
5
home.php
|
|
@ -1,8 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
require_once 'core/classes.php';
|
require_once 'core/classes.php';
|
||||||
headStart();
|
|
||||||
require_once 'core/classes.php';
|
|
||||||
require_once 'core/classes/user.php';
|
require_once 'core/classes/user.php';
|
||||||
|
headStart();
|
||||||
$user = new User($con, $_SESSION['user'] ?? 0);
|
$user = new User($con, $_SESSION['user'] ?? 0);
|
||||||
if(!$user->isLoggedIn()) {
|
if(!$user->isLoggedIn()) {
|
||||||
header('location: /login');
|
header('location: /login');
|
||||||
|
|
@ -91,7 +90,7 @@ $getitstarted->header();
|
||||||
$q->execute();
|
$q->execute();
|
||||||
if ($numberOfGames >= 1) {
|
if ($numberOfGames >= 1) {
|
||||||
while ($game = $q->fetch()) {
|
while ($game = $q->fetch()) {
|
||||||
$playingCount = 69;
|
$playingCount = $game['players'];
|
||||||
?>
|
?>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<div class="card bg-dark border-start rounded shadow-sm" style="min-width: 140px; max-width: 220px; ">
|
<div class="card bg-dark border-start rounded shadow-sm" style="min-width: 140px; max-width: 220px; ">
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,8 @@ $query->execute();
|
||||||
$ban = $query->fetch();
|
$ban = $query->fetch();
|
||||||
|
|
||||||
if(empty($ban)) {
|
if(empty($ban)) {
|
||||||
die("no bans");
|
header('Location: /home');
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($ban['type'] == 1) {
|
if($ban['type'] == 1) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
require_once 'core/classes.php';
|
||||||
|
require_once 'core/classes/user.php';
|
||||||
|
headStart();
|
||||||
|
require_once('core/config.php');
|
||||||
|
$user = new User($con, $_SESSION['user'] ?? 0);
|
||||||
|
if(!$user->isLoggedIn()) {
|
||||||
|
header('location: /login');
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html data-bs-theme="dark">
|
||||||
|
<?php
|
||||||
|
$getitstarted = new PartyStarter;
|
||||||
|
$getitstarted->header();
|
||||||
|
$user = $con->prepare('SELECT * FROM users');
|
||||||
|
$user->execute();
|
||||||
|
$users = $user->fetchAll();
|
||||||
|
foreach($users as $user) {
|
||||||
|
?>
|
||||||
|
<table class="table table-hover">
|
||||||
|
<a href="/user?id=<?php echo $user['id']; ?>">
|
||||||
|
<thead>
|
||||||
|
<tr class="table-dark">
|
||||||
|
<th scope="row"><a href="/user?id=<?php echo $user['id']; ?>"><?php echo $user['username']; ?></a></th>
|
||||||
|
<td><?php echo $user['description']; ?></td>
|
||||||
|
<td><?php echo $user['status']; ?></td>
|
||||||
|
<td><?php echo $user['date']; ?></td>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
</a>
|
||||||
|
<tbody>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
@ -1,3 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
// can't be bothered il do it later
|
if(isset($_GET['userId'])) {
|
||||||
|
$id = $_GET['userId'];
|
||||||
|
// we do not care about the placeid literally
|
||||||
|
if($id == '0') {
|
||||||
|
die('http://roblox.com/asset/?id=76157786;http://roblox.com/asset/?id=129459077'); // default guest avatar
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
Loading…
Reference in New Issue