2024-04-25 21:55:08 +02:00
|
|
|
<?php session_start();
|
|
|
|
|
|
|
|
require_once 'site-config.php';
|
|
|
|
|
|
|
|
ini_set('display_errors', ($debugging == false ? 0 : 1));
|
|
|
|
ini_set('display_startup_errors', ($debugging == false ? 0 : 1));
|
|
|
|
error_reporting(E_ALL);
|
|
|
|
|
|
|
|
date_default_timezone_set($config_timezone);
|
|
|
|
|
|
|
|
$host = $_SERVER['HTTP_HOST'];
|
|
|
|
$uri = $_SERVER['REQUEST_URI'];
|
|
|
|
$is_local = (($host == 'localhost' OR strpos($host, '192.168') !== false) ? true : false);
|
|
|
|
|
|
|
|
$filename = basename($_SERVER['PHP_SELF']);
|
|
|
|
$filename_get = (!empty($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : null);
|
|
|
|
|
|
|
|
$google = ['notranslate','nositelinkssearchb'];
|
|
|
|
$robots = ['nofollow','nosnippet','noarchive','noimageindex'];
|
|
|
|
|
2024-04-25 21:57:34 +02:00
|
|
|
$dir_files = $config_root.'/files/'.$config_folder;
|
2024-04-28 14:31:08 +02:00
|
|
|
$dir_css = 'css';
|
2024-04-25 21:55:08 +02:00
|
|
|
$dir_functions = 'functions';
|
|
|
|
$dir_images = 'images';
|
2024-04-28 14:31:08 +02:00
|
|
|
$dir_js = 'js';
|
2024-04-25 21:55:08 +02:00
|
|
|
$dir_languages = 'languages';
|
|
|
|
|
2024-04-28 14:31:08 +02:00
|
|
|
if(file_exists('vendor/autoload.php')) {
|
2024-04-25 21:55:08 +02:00
|
|
|
require_once 'vendor/autoload.php';
|
|
|
|
$Parsedown = new Parsedown();
|
2024-06-09 18:13:46 +02:00
|
|
|
|
2024-07-30 15:25:08 +02:00
|
|
|
$oldmask = umask(0);
|
|
|
|
mkdir($dir_files, 0777, true);
|
|
|
|
umask($oldmask);
|
|
|
|
|
2024-06-09 18:13:46 +02:00
|
|
|
if(!file_exists($dir_files.'/encryption.key')) {
|
|
|
|
$enckey = KeyFactory::generateEncryptionKey();
|
|
|
|
KeyFactory::save($enckey, $dir_files.'/encryption.key');
|
|
|
|
}
|
2024-04-25 21:55:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
require_once 'site-functions.php';
|
2024-04-28 14:31:08 +02:00
|
|
|
require_once 'languages/'.(isset($_GET['lang']) ? safetag($_GET['lang']) : 'se').'.php';
|
2024-04-25 21:55:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-30 15:25:08 +02:00
|
|
|
if(!empty($database_host) AND !empty($database_port) AND !empty($database_name) AND !empty($database_user) AND !empty($database_pass)) {
|
|
|
|
try {
|
|
|
|
$sql = null;
|
|
|
|
if($sql === null) {
|
|
|
|
$sql = new PDO('pgsql:host='.$database_host.';port='.$database_port.';dbname='.$database_name.';user='.$database_user.';password='.$database_pass);
|
|
|
|
$sql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
|
|
|
}
|
2024-04-25 21:55:08 +02:00
|
|
|
}
|
|
|
|
|
2024-07-30 15:25:08 +02:00
|
|
|
catch(PDOException $e) {
|
|
|
|
echo $e;
|
|
|
|
exit;
|
|
|
|
}
|
2024-04-25 21:55:08 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|