26 lines
922 B
PHP
26 lines
922 B
PHP
<?php
|
|
|
|
define("CONF", parse_ini_file(__DIR__ . "/../config.ini", true, INI_SCANNER_TYPED));
|
|
|
|
define("SERVICE", substr(dirname($_SERVER['PHP_SELF']), strlen(CONF['common']['prefix']) + 1));
|
|
define("PAGE", basename($_SERVER['PHP_SELF'], '.php'));
|
|
define("DB_PATH", CONF['common']['root_path'] . "/db/niver.db"); // Niver's SQLite database
|
|
|
|
// Service-specific functions and constants
|
|
if (SERVICE === "reg" OR SERVICE === "ns")
|
|
require CONF['common']['root_path'] . "/dns.php";
|
|
if (SERVICE !== "")
|
|
require CONF['common']['root_path'] . "/" . SERVICE . ".php";
|
|
|
|
// Page titles definition
|
|
require "pages.php";
|
|
|
|
function userError($msg) {
|
|
http_response_code(422);
|
|
exit("<strong>User error</strong>: The server refused to process this request: <em>" . $msg . "</em>");
|
|
}
|
|
|
|
function serverError($msg) {
|
|
http_response_code(500);
|
|
exit("<strong>Server error</strong>: The server encountered an error: <em>" . $msg . "</em>");
|
|
}
|