38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
/*
|
|
_____ _____ _ _
|
|
/ ____| / ____| | | | |
|
|
_ __ ___ ___| (___ ___ _ ____ _| | ___ _ __ | |_ _ __ ___ | |
|
|
| '_ ` _ \ / __|\___ \ / _ \ '__\ \ / / | / _ \| '_ \| __| '__/ _ \| |
|
|
| | | | | | (__ ____) | __/ | \ V /| |___| (_) | | | | |_| | | (_) | |
|
|
|_| |_| |_|\___|_____/ \___|_| \_/ \_____\___/|_| |_|\__|_| \___/|_|
|
|
|
|
* By RootMarc
|
|
*/
|
|
|
|
class mcServ {
|
|
public function checkConf() {
|
|
if (!file_exists("../mcServ.db")) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public function getConf() {
|
|
$env = parse_ini_file(__DIR__ . "/.env");
|
|
return $env;
|
|
}
|
|
|
|
public function checkLogin() {
|
|
if (!isset($_COOKIE["session_id"]) || !isset($_COOKIE["user_id"])) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public function generateSessionID() {
|
|
$num = rand(1, 999999);
|
|
$hash = hash("sha256", $num);
|
|
|
|
return $hash;
|
|
}
|
|
} |