/** Datei: plugins/systems/hooks/model/hashids.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * * @hook model::hashids * @param array $numbers Numbers to encode * @param int $primid Primary ID * @param object $table Tablename * * @since 1.0.0 File is created */ if( defined( "SYSTEM" ) ) { $numbers[] = SYSTEM->id; } return $numbers; /** Datei: plugins/systems/hooks/router/dispatch-before_logo.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * * @hook router::resolve->before * @param array $route current route data * * @since 1.0.0 File is created */ use ARUNOX\Plugins\Systems; if( $route[0] !== "/logo" ) return $route; $system = Systems\Model::getByColumn( "domain", trim( $_SERVER["HTTP_HOST"] ) ); if( !$system ) return $route; $file = UPLOADS_DIR . $system->logo; $file = realpath( $file ); $mimeType = mime_content_type( $file ); header("Content-Type: $mimeType"); readfile( $file ); exit; /** Datei: plugins/systems/hooks/generator/controls.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * * @since 1.0.0 File is created */ use ARUNOX\Core\Hooks; use ARUNOX\Core\Router; use ARUNOX\Plugins\Systems; Router::get('/api/v1/logo', function(){ $file = UPLOADS_DIR . SYSTEM->logo; $file = realpath( $file ); $mimeType = mime_content_type( $file ); header("Content-Type: $mimeType"); readfile( $file ); exit; }, FALSE ); Hooks::add('template::title', function( $title ) { return SYSTEM->name; }); Hooks::add('template::pagetitle', function( $title ) { return SYSTEM->title; }); Hooks::add('public::api->init', [ Systems\API\v1\Routes::class, "register" ] ); Hooks::add('public::api->init', [ Systems\Plugins\API\v1\Routes::class, "register" ] ); Hooks::add('config::constants', function() { if( SYSTEM && SYSTEM->id == 6 ) { ARUNOX\Themes\LCARS\Theme::set(); } }); /** Datei: plugins/systems/hooks/config/preload-loaded.php **/ * @copyright 2025 ARUNOX * @version 1.0.0 * * @hook config::preload->loaded * @param array $REQUEST Typically contains the data provided by $_REQUEST * * @since 1.0.0 File is created */ use ARUNOX\Core\Plugins; use ARUNOX\Plugins\REST; use ARUNOX\Plugins\Users; use ARUNOX\Plugins\Systems; use ARUNOX\Database\Connections; $system = Systems\Model::getByColumn( "domain", trim( $_SERVER["HTTP_HOST"] ) ); define( "SYSTEM", $system ); Connections::connect([ "host" => DB_HOST, "dbname" => DB_NAME, "charset" => DB_CHARSET, "user" => DB_USER, "pass" => DB_PASS, ], "admin" ); if( !SYSTEM ) return; $plugins = SYSTEM->plugins; $allPlugins = ARUNOX\Core\Plugins::getAll(); $pluginDeps = []; foreach( $plugins as $current ) { if( $plugin = Plugins::get( $current->plugin ) ) { $plugin->setStatus( $current->status->getValue() ); if( $plugin->active && $plugin->dependencies ) { $pluginDeps[] = $plugin; } } unset( $allPlugins[ $current->plugin ] ); } foreach( $pluginDeps as $plugin ) { $plugin->checkDependencies(); } foreach( $allPlugins as $name => $plugin ) { ARUNOX\Plugins\Systems\Plugins\Model::save([ "plugin" => $name, "system_id" => SYSTEM->id, ]); } if( !SYSTEM->type->isTenantIsolated() ) { if( PUBLIC_SCRIPT_NAME == PUBLIC_SCRIPT_NAME_API ) { if( SYSTEM->db_status->getValue() < Systems\DBStatus::AdminMissing ) { if( SYSTEM->db_status->getValue() <= Systems\DBStatus::Failed ) { REST\Response::addNotify( "danger", "FATAL DATABASE ERROR", NULL, 0 ); } if( SYSTEM->db_status->getValue() == Systems\DBStatus::Installing ) { REST\Response::addNotify( "warning", "INSTALLING SYSTEM...", NULL, 0 ); } if( SYSTEM->db_status->getValue() == Systems\DBStatus::Maintenance ) { REST\Response::addNotify( "warning", "SYSTEM IS UNDER MAINTENANCE...", NULL, 0 ); } Users\API\v1\Controller::restConfigLogin(); REST\Response::jsonResponse( 401 )->send(); return; } } } SYSTEM->connect();