diff --git a/backend/class/Config/JsonConfig.php b/backend/class/Config/JsonConfig.php index 2c5dfd4..7ccc74f 100644 --- a/backend/class/Config/JsonConfig.php +++ b/backend/class/Config/JsonConfig.php @@ -11,7 +11,6 @@ use noxkiwi\core\Path; use function array_replace_recursive; use function compact; -use function is_array; use const E_ERROR; /** @@ -44,11 +43,11 @@ public function __construct(string $file, bool $inherit = false) if (empty($file)) { throw new InvalidArgumentException('FILE_IS_EMPTY', E_ERROR); } - $config = []; + $config = []; if (! $inherit) { $this->file = (string)$this->getFullPath($file); $config = $this->decodeFile($this->file); - if (! is_array($config)) { + if (empty($config)) { throw new ConfigurationException('CONTENT_IS_NOT_AN_ARRAY', E_ERROR, compact('file', 'config')); } $this->put($config); @@ -88,12 +87,12 @@ private function getFullPath(string $file): ?string * * @param string $fullPath * - * @return array|null + * @return array */ - protected function decodeFile(string $fullPath): ?array + protected function decodeFile(string $fullPath): array { try { - return JsonHelper::decodeFileToArray($fullPath); + return (array)JsonHelper::decodeFileToArray($fullPath); } catch (InvalidJsonException $exception) { ErrorHandler::handleException($exception); diff --git a/backend/class/Context.php b/backend/class/Context.php index 85f97ab..827eec3 100644 --- a/backend/class/Context.php +++ b/backend/class/Context.php @@ -1,9 +1,9 @@ validate($request); $response = $this->backendController($request); } catch (\Exception $exception) { ErrorHandler::handleException($exception); @@ -119,6 +129,47 @@ public function dispatch(Request $request): void } } + /** + * I will validate the given Request against the configured parameter structure of the action and view. + * + * @param \noxkiwi\core\Request $request + * + * @throws \noxkiwi\core\Exception\InvalidArgumentException + * @return void + */ + protected function validate(Request $request): void + { + $actionConst = static::class . '::' . strtoupper("REQUEST_{$request->get(Mvc::ACTION)}_ACTION"); + $errors = []; + if (defined($actionConst)) { + $design = constant($actionConst); + foreach ($design as $name => $validator) { + $val = $validator::get($validator); + $error = $val->validate($request->get($name)); + if (empty($error)) { + continue; + } + $errors[$name] = $error; + } + } + $viewConst = static::class . '::' . strtoupper("REQUEST_{$request->get(Mvc::VIEW)}_VIEW"); + if (defined($viewConst)) { + $design = constant($viewConst); + foreach ($design as $name => $validator) { + $val = $validator::get($validator); + $error = $val->validate($request->get($name)); + if (empty($error)) { + continue; + } + $errors[$name] = $error; + } + } + if (empty($errors)) { + return; + } + throw new InvalidArgumentException('REQUEST_PARAMETERS_VIOLATED', E_WARNING, $errors); + } + /** * I will perform any actions that belong to the backend of the application. * @@ -126,7 +177,7 @@ public function dispatch(Request $request): void * * @return \noxkiwi\core\Response */ - final protected function backendController(Request $request): Response + protected function backendController(Request $request): Response { $this->doAction($request); $this->doView($request); @@ -145,11 +196,15 @@ final protected function doAction(Request $request): void if ($action === null) { return; } - $action = static::makeActionMethod($action); + $action = 'action' . ucfirst($action); if (! method_exists($this, $action)) { return; } - $this->$action(); + try { + $this->$action(); + } catch (Exception $exception) { + ErrorHandler::handleException($exception, E_USER_NOTICE); + } } /** @@ -159,22 +214,16 @@ final protected function doAction(Request $request): void */ final protected function doView(Request $request): void { - $method = static::getViewName($request->get(Mvc::VIEW, '')); - if (method_exists($this, $method)) { - $this->{$method}(); + $view = $request->get(Mvc::VIEW, ''); + $method = Mvc::VIEW . ucfirst($view); + if (! method_exists($this, $method)) { + return; + } + try { + $this->$method(); + } catch (Exception $exception) { + ErrorHandler::handleException($exception, E_USER_NOTICE); } - } - - /** - * I will solely return the given $view's method name. - * - * @param string $view - * - * @return string - */ - #[Pure] final protected static function getViewName(string $view): string - { - return Mvc::VIEW . ucfirst($view); } /** @@ -216,16 +265,4 @@ final protected function doOutput(Response $response): void { $response->pushOutput(); } - - /** - * I will solely return the given $action's method name. - * - * @param string $action - * - * @return string - */ - #[Pure] private static function makeActionMethod(string $action): string - { - return 'action' . ucfirst($action); - } } diff --git a/backend/class/Context/ResourceContext.php b/backend/class/Context/ResourceContext.php index 47d0a78..13d3568 100644 --- a/backend/class/Context/ResourceContext.php +++ b/backend/class/Context/ResourceContext.php @@ -25,7 +25,7 @@ abstract class ResourceContext extends Context * I will output the content of the requested file, and then I will exit. * @throws \noxkiwi\singleton\Exception\SingletonException */ - #[NoReturn] protected function viewFile(): void + #[NoReturn] final protected function viewFile(): void { [$type, $file] = explode( '/', diff --git a/backend/class/Cookie/CookieCookie.php b/backend/class/Cookie/CookieCookie.php index a6010fb..c29420a 100644 --- a/backend/class/Cookie/CookieCookie.php +++ b/backend/class/Cookie/CookieCookie.php @@ -82,7 +82,7 @@ public function set(string $key, mixed $data): void } setcookie($key, $data, $this->getExpires(), '/', $_SERVER['HTTP_HOST'], false, true); $_COOKIE[$key] = $data; - if ($this->get($key) === null) { + if ($this->get($key) !== $data) { throw new CookieException('EXCEPTION_COOKIES_NOT_WRITABLE', E_NOTICE); } } @@ -109,6 +109,5 @@ public function exists(string $key): bool */ public function put(array $data): void { - } } diff --git a/backend/class/Environment.php b/backend/class/Environment.php index 9a8ec5d..44a2725 100644 --- a/backend/class/Environment.php +++ b/backend/class/Environment.php @@ -58,7 +58,7 @@ protected function initialize(): void parent::initialize(); $data = JsonHelper::decodeFileToArray(self::getPath()); if (empty($data)) { - throw new ConfigurationException('ENVIRONMENT_INVALID', E_ERROR, ['path'=>self::getPath()]); + throw new ConfigurationException('ENVIRONMENT_INVALID', E_ERROR); } $this->add($data); self::$loaded = true; diff --git a/backend/class/Error.php b/backend/class/Error.php index 6459197..e038507 100644 --- a/backend/class/Error.php +++ b/backend/class/Error.php @@ -22,7 +22,7 @@ class Error extends \Error * @param int $code * @param \Throwable|null $previous */ - #[Pure] public function __construct($message = '', $code = 0, Throwable $previous = null) + #[Pure] public function __construct(string $message = '', int $code = 0, Throwable $previous = null) { parent::__construct($message, $code, $previous); $this->detail = []; diff --git a/backend/class/ErrorHandler.php b/backend/class/ErrorHandler.php index ef7871f..e417ced 100644 --- a/backend/class/ErrorHandler.php +++ b/backend/class/ErrorHandler.php @@ -38,6 +38,7 @@ abstract class ErrorHandler { private const SURROUND_LINES = 10; + public static int $errorsReported = 0; /** * I will handle the given $error as info element on a new Exception that will be handled right after. @@ -67,6 +68,7 @@ final public static function handleError(\Error $error, int $errorLevel = E_ERRO */ public static function handleException(\Exception $exception, int $errorLevel = E_ERROR): void { + self::$errorsReported++; if (error_reporting() === 0) { return; } diff --git a/backend/class/ErrorStack.php b/backend/class/ErrorStack.php index 79622fd..16887db 100644 --- a/backend/class/ErrorStack.php +++ b/backend/class/ErrorStack.php @@ -10,7 +10,8 @@ use function count; /** - * I am + * I am... + * @deprecated * Class StackOf * @package noxkiwi\core */ diff --git a/backend/class/Exception.php b/backend/class/Exception.php index 485ce31..7379937 100644 --- a/backend/class/Exception.php +++ b/backend/class/Exception.php @@ -2,8 +2,6 @@ namespace noxkiwi\core; use noxkiwi\hook\Hook; -use function chr; -use function file_put_contents; /** * I am the Core project's base exception. diff --git a/backend/class/Gate.php b/backend/class/Gate.php index b14b930..3299b0a 100644 --- a/backend/class/Gate.php +++ b/backend/class/Gate.php @@ -26,6 +26,14 @@ */ abstract class Gate extends Singleton implements GateInterface { + /** + * @inheritDoc + */ + public function isOpen(): bool + { + return true; + } + /** * @inheritDoc */ diff --git a/backend/class/Gate/CidrGate.php b/backend/class/Gate/CidrGate.php index 206e405..9d083a3 100644 --- a/backend/class/Gate/CidrGate.php +++ b/backend/class/Gate/CidrGate.php @@ -38,6 +38,9 @@ public function setRanges(array $ranges): void */ #[Pure] public function isOpen(): bool { + if (! parent::isOpen()) { + return false; + } foreach ($this->allowedRanges as $allowedRange) { if (WebHelper::isCidr($allowedRange) === true) { return true; diff --git a/backend/class/Gate/CliGate.php b/backend/class/Gate/CliGate.php index ffb3999..e653335 100644 --- a/backend/class/Gate/CliGate.php +++ b/backend/class/Gate/CliGate.php @@ -1,6 +1,7 @@ session = Session::getInstance(); + $this->cookie = Cookie::getInstance(); + } + + /** + * @inheritDoc * @return bool */ public function isOpen(): bool { - $fromGet = Request::getInstance()->get(self::CSRF_TOKEN, ''); - if (self::checkCsrf($fromGet)) { - return true; - } - $fromPost = Request::getInstance()->get(self::CSRF_TOKEN, ''); - if (self::checkCsrf($fromPost)) { - return true; - } - $fromCookie = Cookie::getInstance()->get(self::CSRF_TOKEN, ''); - if (self::checkCsrf($fromCookie)) { - return true; + if (! parent::isOpen()) { + return false; } try { - Session::getInstance()->destroy(); - Cookie::getInstance()->end(); - } catch (Exception $exception) { - ErrorHandler::handleException($exception); + if ($this->checkCsrf()) { + return true; + } + } catch (Exception) { + // IGNORED + } finally { + $this->createToken(); } return false; @@ -56,20 +59,14 @@ public function isOpen(): bool /** * I will validate the CSRF. * - * @param string $csrfToken - * * @return bool */ - private static function checkCsrf(string $csrfToken): bool + private function checkCsrf(): bool { try { - if (Session::getInstance()->get(self::CSRF_TOKEN, '_') === $csrfToken) { - self::setCsrfToken(); - - return true; - } - } catch (Exception $exception) { - ErrorHandler::handleException($exception); + return $this->session->get(self::CSRF_TOKEN, '') === $this->cookie->get(self::CSRF_TOKEN, ''); + } catch (Exception) { + //IGNORED } return false; @@ -78,19 +75,19 @@ private static function checkCsrf(string $csrfToken): bool /** * I will solely set the new CSRF Token. */ - private static function setCsrfToken(): void + public function createToken(): void { try { - $csrfToken = self::generateCsrf(); - Cookie::getInstance()->set(self::CSRF_TOKEN, $csrfToken); - Session::getInstance()->set(self::CSRF_TOKEN, $csrfToken); - } catch (Exception $exception) { - ErrorHandler::handleException($exception); + $newToken = CsrfGate::generateCsrf(); + $this->cookie->set(self::CSRF_TOKEN, $newToken); + $this->session->set(self::CSRF_TOKEN, $newToken); + } catch (Exception) { + //IGNORED } } /** - * Function generateRandomUUID2 + * Function generateCsrf * * @throws \Exception * @return string diff --git a/backend/class/Gate/Fail2banGate.php b/backend/class/Gate/Fail2banGate.php index 1a163e4..8fd1302 100644 --- a/backend/class/Gate/Fail2banGate.php +++ b/backend/class/Gate/Fail2banGate.php @@ -1,6 +1,7 @@ hostNames, true); } } diff --git a/backend/class/Gate/IpGate.php b/backend/class/Gate/IpGate.php index 950515c..1419b16 100644 --- a/backend/class/Gate/IpGate.php +++ b/backend/class/Gate/IpGate.php @@ -39,6 +39,10 @@ public function setAllowedHosts(array $allowedIps): void */ #[Pure] public function isOpen(): bool { + if (! parent::isOpen()) { + return false; + } + return in_array(WebHelper::getClientIp(), $this->allowedHosts, true); } } diff --git a/backend/class/Gate/MaintenanceGate.php b/backend/class/Gate/MaintenanceGate.php index 19b751b..6196049 100644 --- a/backend/class/Gate/MaintenanceGate.php +++ b/backend/class/Gate/MaintenanceGate.php @@ -28,6 +28,10 @@ final class MaintenanceGate extends Gate */ public function isOpen(): bool { + if (! parent::isOpen()) { + return false; + } + return ! Filesystem::getInstance()->fileAvailable(self::getPath()); } diff --git a/backend/class/Gate/ProtocolGate.php b/backend/class/Gate/ProtocolGate.php index 750753f..92df636 100644 --- a/backend/class/Gate/ProtocolGate.php +++ b/backend/class/Gate/ProtocolGate.php @@ -37,6 +37,9 @@ protected function __construct(?array $options = null) */ #[Pure] public function isOpen(): bool { + if (! parent::isOpen()) { + return false; + } foreach (self::$allowedRanges as $allowedRange) { if (WebHelper::isCidr($allowedRange) === true) { return true; diff --git a/backend/class/Gate/RemoteHostnameGate.php b/backend/class/Gate/RemoteHostnameGate.php index 644b6f5..4ece7d6 100644 --- a/backend/class/Gate/RemoteHostnameGate.php +++ b/backend/class/Gate/RemoteHostnameGate.php @@ -38,6 +38,9 @@ protected function __construct(?array $remoteHostnames = null) */ #[Pure] public function isOpen(): bool { + if (! parent::isOpen()) { + return false; + } foreach (self::$remoteHostnames as $remoteHostname) { $ipAddress = gethostbyname($remoteHostname); if (WebHelper::getClientIp() === $ipAddress) { diff --git a/backend/class/Helper/CryptographyHelper.php b/backend/class/Helper/CryptographyHelper.php index de6874b..0cddcae 100644 --- a/backend/class/Helper/CryptographyHelper.php +++ b/backend/class/Helper/CryptographyHelper.php @@ -2,22 +2,25 @@ namespace noxkiwi\core\Helper; use noxkiwi\core\Exception\CryptographyException; +use noxkiwi\core\Exception\SystemComponentException; use function base64_decode; use function base64_encode; +use function extension_loaded; use function is_string; use function openssl_decrypt; use function openssl_encrypt; use function substr; +use const E_ERROR; use const E_WARNING; /** - * I am + * I am the helper for cryptographic operations. * * @package noxkiwi\core * @author Jan Nox * @license https://nox.kiwi/license - * @copyright 2016 - 2018 noxkiwi - * @version 1.0.0 + * @copyright 2016 - 2022 noxkiwi + * @version 1.0.1 * @link https://nox.kiwi/ */ abstract class CryptographyHelper @@ -29,10 +32,15 @@ abstract class CryptographyHelper * @param string $key * @param string $iv * + * @throws \noxkiwi\core\Exception\SystemComponentException * @return string */ public static function encrypt(string $decrypted, string $key, string $iv): string { + if (! extension_loaded('openssl')) { + throw new SystemComponentException('openSSL unavailable', E_ERROR); + } + return base64_encode(openssl_encrypt($decrypted, 'AES-256-CBC', $key, 0, substr($iv, 0, 16))); } @@ -44,10 +52,14 @@ public static function encrypt(string $decrypted, string $key, string $iv): stri * @param string $iv * * @throws \noxkiwi\core\Exception\CryptographyException + * @throws \noxkiwi\core\Exception\SystemComponentException * @return string */ public static function decrypt(string $encrypted, string $key, string $iv): string { + if (! extension_loaded('openssl')) { + throw new SystemComponentException('openSSL unavailable', E_ERROR); + } $encrypted = base64_decode($encrypted); if (! is_string($encrypted)) { throw new CryptographyException('EXCEPTION_DECRYPT_BASEDECODEERROR', E_WARNING, $encrypted); diff --git a/backend/class/Helper/DateHelper.php b/backend/class/Helper/DateHelper.php index a434a51..6f72aac 100644 --- a/backend/class/Helper/DateHelper.php +++ b/backend/class/Helper/DateHelper.php @@ -187,7 +187,7 @@ public static function timeInWords($date, bool $withTime = null): string } elseif ($distance < 14568) { $return = date('l, F d, Y', $timestamp) . ($withTime ? ' at ' . date('g:i A', $timestamp) : ''); } else { - $return = date('F d ', $timestamp) . date('Y') !== date('Y', $timestamp) ? ' ' . date('Y', $timestamp) : '' . ($withTime ? ' at ' . date('g:i A', $timestamp) : ''); + $return = date('F d ', $timestamp) . date('Y') !== date('Y', $timestamp) ? ' ' . date('Y', $timestamp) : ($withTime ? ' at ' . date('g:i A', $timestamp) : ''); } return $return; diff --git a/backend/class/Helper/FormHelper.php b/backend/class/Helper/FormHelper.php deleted file mode 100644 index 9c3d53f..0000000 --- a/backend/class/Helper/FormHelper.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @license https://nox.kiwi/license - * @copyright 2016 - 2018 noxkiwi - * @version 1.0.0 - * @link https://nox.kiwi/ - */ -abstract class FormHelper -{ - /** - * @var string - */ - public const FIELDTYPE_YESNO = 'yesno'; - /** - * I am a list of Field types and their template names. - * - * @var array - */ - public static array $fieldTypes = ['YESNO' => 'yesno']; -} diff --git a/backend/class/Helper/LinkHelper.php b/backend/class/Helper/LinkHelper.php index a2fc8ea..b4e4710 100644 --- a/backend/class/Helper/LinkHelper.php +++ b/backend/class/Helper/LinkHelper.php @@ -83,7 +83,7 @@ public static function makeUrl(array $parameters = null): string $original = [ Mvc::CONTEXT => $response->get(Mvc::CONTEXT), Mvc::VIEW => $response->get(Mvc::VIEW), - Mvc::ACTION => $response->get(Mvc::ACTION), + Mvc::ACTION => null, ]; $parameters = ArrayHelper::arrayMergeRecursive($original, $parameters); @@ -114,8 +114,12 @@ private static function encryptLink(string $decrypted): string if (! static::$encryptLinks) { return $decrypted; } - - return CryptographyHelper::encrypt($decrypted, static::$secret, static::$secret); + try { + return CryptographyHelper::encrypt($decrypted, static::$secret, static::$secret); + } catch (Exception) { + // IGNORED + return ''; + } } /** diff --git a/backend/class/Request/HttpRequest.php b/backend/class/Request/HttpRequest.php index c3ad113..fa36a64 100644 --- a/backend/class/Request/HttpRequest.php +++ b/backend/class/Request/HttpRequest.php @@ -61,8 +61,7 @@ protected function __construct(array $data = []) $this->add(filter_input_array(INPUT_POST) ?? []); $decoded = (array)(json_decode(file_get_contents('php://input') ?? '', true) ?? []); $this->add($decoded); - if (! is_array($decoded)) - { + if (empty($decoded)) { return; } $this->add($data); @@ -77,20 +76,26 @@ public function build(): Request { parent::build(); Cookie::getInstance()->start(); - $uri = substr($_SERVER['REQUEST_URI'], 1); - $requestData = $this->getRedirection($uri); - if (! empty($uri) && ! empty($requestData)) { + if (! empty($requestData)) { foreach ($requestData as $key => $value) { $this->set($key, $value); } } else { - if (empty($_GET) && ! empty($uri)) { - $noParams = explode('?', $_SERVER['REQUEST_URI'])[0]; - try { - $params = LinkHelper::decryptLink($noParams); - parse_str($params, $_GET); - } catch (Exception) { - exit(WebHelper::HTTP_BAD_REQUEST); + $environment = Environment::getInstance(); + // Encrypted Urls? + if ($environment->get('url>encrypt', false) === true) { + if (! empty($_GET) && $environment->get('url>forceencrypt', false) === true) { + LinkHelper::forward('/'); + } + $uri = substr($_SERVER['REQUEST_URI'], 1); + if (! empty($uri)) { + $noParams = explode('?', $_SERVER['REQUEST_URI'])[0]; + try { + $params = LinkHelper::decryptLink($noParams); + parse_str($params, $_GET); + } catch (Exception) { + exit(WebHelper::HTTP_BAD_REQUEST); + } } } static::getInstance()->add($_GET); diff --git a/backend/class/Session.php b/backend/class/Session.php index e77a0eb..6fab359 100644 --- a/backend/class/Session.php +++ b/backend/class/Session.php @@ -2,6 +2,7 @@ namespace noxkiwi\core; use noxkiwi\core\Interfaces\SessionInterface; +use noxkiwi\core\Traits\HookTrait; use noxkiwi\singleton\Singleton; use function session_id; @@ -17,8 +18,12 @@ */ abstract class Session extends Singleton implements SessionInterface { - protected const USE_DRIVER = true; - public const SESSIONKEY = 'phpsessid'; + use HookTrait; + + protected const USE_DRIVER = true; + public const SESSIONKEY = 'phpsessid'; + public const HOOK_DESTROYED = 'session_destroyed'; + public const HOOK_STARTED = 'session_started'; /** * I will construct the Session adding the given $data into the Session. diff --git a/backend/class/Session/CacheSession.php b/backend/class/Session/CacheSession.php index 3a03e11..cbcfa1b 100644 --- a/backend/class/Session/CacheSession.php +++ b/backend/class/Session/CacheSession.php @@ -102,7 +102,6 @@ private function makeData(): void } $this->put($data); Cache::getInstance()->set(self::getCachegroup(), 'SESSION', $this->get(), $this->timeout); - $this->get(); return; } catch (Exception $exception) { @@ -160,6 +159,7 @@ public function remove(string $key): void /** * @inheritDoc + * @noinspection PhpMixedReturnTypeCanBeReducedInspection */ public function get(string $key = null, mixed $default = null): mixed { diff --git a/backend/class/Session/SessionSession.php b/backend/class/Session/SessionSession.php index 7dcfe67..c296c0a 100644 --- a/backend/class/Session/SessionSession.php +++ b/backend/class/Session/SessionSession.php @@ -12,13 +12,13 @@ use const E_ERROR; /** - * I am + * I am the regular, PHP-based session. * - * @package noxkiwi\core + * @package noxkiwi\core\Session * @author Jan Nox * @license http://www.noxkiwi.de/license - * @copyright 2016-2018 noxkiwi - * @version 1.0.0 + * @copyright 2016 - 2022 noxkiwi + * @version 1.0.1 * @link http://www.noxkiwi.de/ */ final class SessionSession extends Session @@ -45,27 +45,27 @@ protected function __construct(array $data = []) /** * Creates the instance and saves the data object in it * - * @author Jan Nox - * * @param array $data * - * @return Session + * @return \noxkiwi\core\Session */ public function start(array $data): Session { $_SESSION = $data; + $this->fireHook(self::HOOK_DESTROYED); return $this; } /** * Ends the Session the current user is in - * @author Jan Nox */ public function destroy(): void { session_destroy(); unset($_SESSION); + session_start(); + $this->fireHook(self::HOOK_DESTROYED); } /** @@ -73,7 +73,6 @@ public function destroy(): void *
If identified successfully, I will return TRUE *
In any other case I will return FALSE * - * @author Jan Nox * @return bool */ #[Pure] public function identify(): bool diff --git a/backend/class/Traits/HookTrait.php b/backend/class/Traits/HookTrait.php new file mode 100644 index 0000000..edf8669 --- /dev/null +++ b/backend/class/Traits/HookTrait.php @@ -0,0 +1,54 @@ + + * @license https://nox.kiwi/license + * @copyright 2016 - 2018 noxkiwi + * @version 1.0.0 + * @link https://nox.kiwi/ + */ +trait HookTrait +{ + /** + * I will add the given $callback to the given $event. + * + * @param string $event + * @param callable $callable + * + * @return void + */ + final public function addHook(string $event, callable $callable): void + { + try { + $hook = Hook::getInstance(); + $hook->add($event, $callable); + } catch (Exception) { + // IGNORE + } + } + + /** + * I will fire the given $event and pass the given $arguments to each of the callbacks. + * + * @param string $event + * @param mixed $arguments + * + * @return void + */ + final protected function fireHook(string $event, mixed $arguments = null): void + { + try { + $hook = Hook::getInstance(); + $hook->fire($event, $arguments); + } catch (Exception) { + // IGNORE + } + } +} diff --git a/frontend/page/maintenance.php b/frontend/page/maintenance.php index 31c2853..ed375b9 100644 --- a/frontend/page/maintenance.php +++ b/frontend/page/maintenance.php @@ -1,11 +1,24 @@ setTimestamp(filemtime($path)); + $begin = $dateTime->format('c'); + $reason = file_get_contents($path); +} ?> @@ -25,7 +38,7 @@

💀

-

This application went into Maintenance Mode at because of

+

This application went into Maintenance Mode at because of


"Kicking The Bucket" by Vikram Madan diff --git a/frontend/page/notallowed.php b/frontend/page/notallowed.php deleted file mode 100644 index 2137582..0000000 --- a/frontend/page/notallowed.php +++ /dev/null @@ -1,88 +0,0 @@ - - - - - - - - Uups! - - - - - - - - - - - - - - - - - - - - -
- - -
-
-
-
-
-
-

Access denied

-

- This page should be hidden from you. -
Please log in first. -

-
-
-
-
-
-
-
- - - - -
-
- -
-
- - - - - - diff --git a/frontend/page/notfound.php b/frontend/page/notfound.php deleted file mode 100644 index e261c6f..0000000 --- a/frontend/page/notfound.php +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - Uups! - - - - - - - - - - - - - - - - - - - - -
- - -
-
-
-
-
-
-

-

404 - Nicht gefunden

-

- Die angeforderte Seite wurde leider nicht gefunden =( -

-
-
-
-
-
-
-
- - - - -
-
- -
-
- - - - - -