From 11c061ec8875d7fb4bcb6c80f0e12c882ec8a483 Mon Sep 17 00:00:00 2001 From: Mario <100047175+Mariopizza1@users.noreply.github.com> Date: Sun, 4 Jun 2023 15:46:42 +0300 Subject: [PATCH] yes --- admin.php | 34 ++++++++++++++++++++-------------- core/classes.php | 23 +++++++++++++++++------ core/config.php | 2 +- grublox.sql | 10 +++++----- home.php | 5 ++--- not_approved.php | 3 ++- partners.php | 0 users.php | 37 +++++++++++++++++++++++++++++++++++++ v1.1/avatar-fetch.php | 10 ++++++++-- 9 files changed, 92 insertions(+), 32 deletions(-) create mode 100644 partners.php create mode 100644 users.php diff --git a/admin.php b/admin.php index ded68b0..ef75db7 100644 --- a/admin.php +++ b/admin.php @@ -1,27 +1,27 @@ isLoggedIn()) { + header('location: /login'); + exit; +} ?> header(); - if(isset($_GET['p'])) { $page = $_GET['p']; } else { @@ -56,15 +56,19 @@ $offset = $page * $limit; Date registered Money Admin + Banned 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']); ?> @@ -73,8 +77,10 @@ $offset = $page * $limit; getMoney(true)." (".$sUser->getMoney(false).")"; ?> True"; } else { echo "False"; } ?> + False'; } ?> - + diff --git a/core/classes.php b/core/classes.php index f372ad0..7e2a210 100644 --- a/core/classes.php +++ b/core/classes.php @@ -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(' '); -} } +} +} +} +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 { diff --git a/core/config.php b/core/config.php index 5fd0b19..2a53013 100644 --- a/core/config.php +++ b/core/config.php @@ -108,4 +108,4 @@ try { } catch (PDOException $e) { die("Connection failed: " . $e->getMessage()); } -?> +?> \ No newline at end of file diff --git a/grublox.sql b/grublox.sql index b4304de..8a39091 100644 --- a/grublox.sql +++ b/grublox.sql @@ -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); -- -------------------------------------------------------- diff --git a/home.php b/home.php index 29350c8..4f64cdf 100644 --- a/home.php +++ b/home.php @@ -1,8 +1,7 @@ isLoggedIn()) { header('location: /login'); @@ -91,7 +90,7 @@ $getitstarted->header(); $q->execute(); if ($numberOfGames >= 1) { while ($game = $q->fetch()) { - $playingCount = 69; + $playingCount = $game['players']; ?>
diff --git a/not_approved.php b/not_approved.php index 72858e8..5eab65f 100644 --- a/not_approved.php +++ b/not_approved.php @@ -25,7 +25,8 @@ $query->execute(); $ban = $query->fetch(); if(empty($ban)) { -die("no bans"); +header('Location: /home'); +exit; } if($ban['type'] == 1) { diff --git a/partners.php b/partners.php new file mode 100644 index 0000000..e69de29 diff --git a/users.php b/users.php new file mode 100644 index 0000000..6e0d77f --- /dev/null +++ b/users.php @@ -0,0 +1,37 @@ +isLoggedIn()) { + header('location: /login'); + exit; +} +?> +<?php echo $pagename; ?> | <?php echo $sitename; ?> + + +header(); +$user = $con->prepare('SELECT * FROM users'); +$user->execute(); +$users = $user->fetchAll(); +foreach($users as $user) { +?> + + + + + + + + + + + + + \ No newline at end of file diff --git a/v1.1/avatar-fetch.php b/v1.1/avatar-fetch.php index 6b25052..b4099d3 100644 --- a/v1.1/avatar-fetch.php +++ b/v1.1/avatar-fetch.php @@ -1,3 +1,9 @@ +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 + } +} +?> \ No newline at end of file