permission checking

This commit is contained in:
Roman Hergenreder 2020-06-18 15:35:09 +02:00
parent f91567186e
commit b7d3e569d3
2 changed files with 10 additions and 4 deletions

0
core/Configuration/KeyData.class.php Normal file → Executable file

@ -1,6 +1,7 @@
<?php <?php
use Api\Request; use Api\Request;
use Configuration\Configuration;
use Documents\Document404; use Documents\Document404;
use Elements\Document; use Elements\Document;
@ -8,16 +9,21 @@ include_once 'core/core.php';
include_once 'core/datetime.php'; include_once 'core/datetime.php';
include_once 'core/constants.php'; include_once 'core/constants.php';
if (!is_readable(getClassPath(Configuration::class))) {
die("Configuration directory is not readable, please check permissions before proceeding");
}
spl_autoload_extensions(".php"); spl_autoload_extensions(".php");
spl_autoload_register(function($class) { spl_autoload_register(function($class) {
$full_path = getClassPath($class); $full_path = getClassPath($class, true);
if(file_exists($full_path)) if(file_exists($full_path)) {
include_once $full_path; include_once $full_path;
else } else {
include_once getClassPath($class, false); include_once getClassPath($class, false);
}
}); });
$config = new Configuration\Configuration(); $config = new Configuration();
$installation = (!$config->load()); $installation = (!$config->load());
$user = new Objects\User($config); $user = new Objects\User($config);