mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-21 12:19:15 +12:00
Update web
This commit is contained in:
parent
852b5f33ec
commit
6e32fc9aca
18 changed files with 480 additions and 158 deletions
|
@ -1,8 +1,17 @@
|
|||
<?php
|
||||
|
||||
function GenHmacMessage(string $data, string $channel)
|
||||
{
|
||||
if($hmac_secret === "!!NOTSET!!"){
|
||||
die("Please set HMAC_SECRET !");
|
||||
exit();
|
||||
}
|
||||
return $hmac = hash_hmac('sha256', $data, $hmac_secret.$channel.$_SERVER['REMOTE_ADDR'].date('mhdY'));
|
||||
}
|
||||
|
||||
function getNoPlayersOnlineInServer($database)
|
||||
{
|
||||
include('dbconfig.php');
|
||||
include('config.php');
|
||||
$dbname = $database;
|
||||
$connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'");
|
||||
$onlineUsers = mysqli_query($connect, "SELECT COUNT(1) FROM OnlineUsers");
|
||||
|
@ -11,7 +20,7 @@ function getNoPlayersOnlineInServer($database)
|
|||
|
||||
function getNoSubbedPlayersOnlineInServer($database)
|
||||
{
|
||||
include('dbconfig.php');
|
||||
include('config.php');
|
||||
$dbname = $database;
|
||||
$connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'");
|
||||
$onlineSubscribers = mysqli_query($connect, "SELECT COUNT(1) FROM OnlineUsers WHERE Subscribed = 'YES'");
|
||||
|
@ -20,7 +29,7 @@ function getNoSubbedPlayersOnlineInServer($database)
|
|||
|
||||
function getNoModPlayersOnlineInServer($database)
|
||||
{
|
||||
include('dbconfig.php');
|
||||
include('config.php');
|
||||
$dbname = $database;
|
||||
$connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'");
|
||||
$onlineModerators = mysqli_query($connect, "SELECT COUNT(1) FROM OnlineUsers WHERE Moderator = 'YES' OR Admin='YES'");
|
||||
|
@ -41,7 +50,7 @@ function getServerById(string $id)
|
|||
|
||||
function userid_exists(string $database, string $userid)
|
||||
{
|
||||
include('dbconfig.php');
|
||||
include('config.php');
|
||||
$dbname = $database;
|
||||
$connect = mysqli_connect($dbhost, $dbuser, $dbpass,$dbname) or die("Unable to connect to '$dbhost'");
|
||||
$stmt = $connect->prepare("SELECT COUNT(1) FROM Users WHERE Id=?");
|
||||
|
@ -54,7 +63,7 @@ function userid_exists(string $database, string $userid)
|
|||
|
||||
function createAccountOnServer(string $database)
|
||||
{
|
||||
include('dbconfig.php');
|
||||
include('config.php');
|
||||
$dbname = $database;
|
||||
|
||||
$id = intval($_SESSION['PLAYER_ID']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue