-
Notifications
You must be signed in to change notification settings - Fork 1
/
functions.inc.php
53 lines (44 loc) · 1.59 KB
/
functions.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/****
_ _ _____ ______ __ _ _ _ ___
| |_| |__ ___|__ /___ ___ / / /\ \ / /__| |__ | | | |_ _|
| __| '_ \ / _ \ / // _ \ / _ \ / / / \ \ /\ / / _ \ '_ \| | | || |
| |_| | | | __// /| (_) | (_) / / / \ V V / __/ |_) | |_| || |
\__|_| |_|\___/____\___/ \___/_/_/ \_/\_/ \___|_.__/ \___/|___|
by KawaiiPantsu
https://github.com/kawaiipantsu/theZoo-WebUI
***************************************************************************/
// Functions for simplification
function sendHTTPcode($code=false,$text="",$terminate=false) {
if ( $code && is_int($code) ) {
http_response_code($code);
if ($terminate) die($text);
}
}
function isLocalIP() {
$remote_ip = trim($_SERVER["REMOTE_ADDR"]);
if ( ! filter_var($remote_ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) ) return true;
else return false;
}
function dbVersion() {
global $cfg;
$theZooVer = rtrim($cfg["thezoo"],"/")."/conf/db.ver";
if (is_file($theZooVer) && is_readable($theZooVer) ) {
$ver = file_get_contents($theZooVer);
return trim($ver);
} else return "";
}
function dbVersionLatest() {
global $cfg;
$theZooVer = rtrim($cfg["thezoo"],"/")."/conf/db.ver";
if (is_file($theZooVer) && is_readable($theZooVer) ) {
} else {
}
}
function checkEULA() {
global $cfg;
$theZooEULA = rtrim($cfg["thezoo"],"/")."/conf/eula_run.conf";
if (is_file($theZooEULA) && is_readable($theZooEULA) ) return true;
else return false;
}
?>