Continue Setup
This commit is contained in:
38
main.php
Normal file
38
main.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user