This commit is contained in:
Mario 2023-06-04 15:46:42 +03:00
parent 61fba547ea
commit 11c061ec88
9 changed files with 92 additions and 32 deletions

View File

@ -1,27 +1,27 @@
<?php
ob_start();
session_start();
require_once 'core/classes.php';
require_once 'core/classes/user.php';
headStart();
require_once('core/config.php');
if($maintenance && $pagename !== "Maintenance") {
header("Location: /maintenance"
); }
$user = new User($con, $_SESSION['user'] ?? 0);
if(!$user->isLoggedIn()) {
header('location: /login');
exit;
}
?>
<!DOCTYPE html>
<html data-bs-theme="dark">
<head>
<?php
require_once('core/classes.php');
require_once('core/classes/user.php');
if(isset($_SESSION['user'])) {
$user = new User($con, $_SESSION['user']);
$loggedIn = true;
} else {
$loggedIn = false;
if(isAdmin() == '0') {
header('Location: /home');
exit;
}
$getitstarted = new PartyStarter;
$getitstarted->header();
if(isset($_GET['p'])) {
$page = $_GET['p'];
} else {
@ -56,15 +56,19 @@ $offset = $page * $limit;
<th scope="col" class="border">Date registered</th>
<th scope="col" class="border">Money</th>
<th scope="col" class="border">Admin</th>
<th scope="col" class="border">Banned</th>
</tr>
</thead>
<tbody>
<?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->execute();
$users = $q->fetchAll();
foreach ($users as $user) {
foreach ($users as $user) {
$sUser = New User($con, $user['id']);
?>
<tr style="vertical-align: middle;">
@ -73,8 +77,10 @@ $offset = $page * $limit;
<td><?php echo $user['date']; ?></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 foreach ($banned as $ban) {
echo '<td>False</td>'; } ?></td>
</tr>
<?php } ?>
<?php }?>
</tbody>
</table>

View File

@ -151,9 +151,9 @@ function jobOpened($jobId,$expirationInSeconds) {
return discordmsg($msg, $webhook); // SENDS MESSAGE TO DISCORD
}
function getChildren() {
return "Got 0 children, this isn't lua dumbass.";
}
/* function getChildren() {
return "Got 0 children, this isn't lua dumbass."; // bro who the fuck made this function?
} */
function isBanned() {
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->execute();
$ban = $query->fetch();
if(!empty($ban)) {
if($ban['ip'] == $_SERVER['REMOTE_ADDR'] && $ban['type'] == 4 || $ban['type'] == 4) {
ob_end_clean();
@ -176,8 +175,21 @@ die('
</body>
</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() {
@ -188,7 +200,6 @@ if($maintenance && $pagename !== "Maintenance") {
header("Location: /maintenance"
); }
isBanned();
}
class PartyStarter {

View File

@ -108,4 +108,4 @@ try {
} catch (PDOException $e) {
die("Connection failed: " . $e->getMessage());
}
?>
?>

View File

@ -1,11 +1,11 @@
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 06, 2023 at 09:42 AM
-- Server version: 10.4.28-MariaDB
-- PHP Version: 8.2.4
-- Generation Time: Jun 04, 2023 at 02:45 PM
-- Server version: 10.4.27-MariaDB
-- PHP Version: 8.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
@ -140,7 +140,7 @@ CREATE TABLE `games` (
--
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);
-- --------------------------------------------------------

View File

@ -1,8 +1,7 @@
<?php
require_once 'core/classes.php';
headStart();
require_once 'core/classes.php';
require_once 'core/classes/user.php';
headStart();
$user = new User($con, $_SESSION['user'] ?? 0);
if(!$user->isLoggedIn()) {
header('location: /login');
@ -91,7 +90,7 @@ $getitstarted->header();
$q->execute();
if ($numberOfGames >= 1) {
while ($game = $q->fetch()) {
$playingCount = 69;
$playingCount = $game['players'];
?>
<div class="col">
<div class="card bg-dark border-start rounded shadow-sm" style="min-width: 140px; max-width: 220px; ">

View File

@ -25,7 +25,8 @@ $query->execute();
$ban = $query->fetch();
if(empty($ban)) {
die("no bans");
header('Location: /home');
exit;
}
if($ban['type'] == 1) {

0
partners.php Normal file
View File

37
users.php Normal file
View File

@ -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
}
?>

View File

@ -1,3 +1,9 @@
<?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
}
}
?>