# Flat FTP mode
define("PROJECT_PATH_ROOT", dirname(getcwd()) . "/");
#../
} else {
# Dedicated server mode
define("PROJECT_PATH_ROOT", dirname(dirname(getcwd())) . "/");
#../../
}
if (!file_exists(PROJECT_PATH_ROOT . 'vendor/')) {
die('<h1>Incomplete installation</h1><p>Baïkal dependencies have not been installed. Please, execute "<strong>composer install</strong>" in the folder where you installed Baïkal.');
}
require PROJECT_PATH_ROOT . 'vendor/autoload.php';
# Bootstraping Flake
\Flake\Framework::bootstrap();
# Bootstrap BaikalAdmin
\BaikalAdmin\Framework::bootstrap();
# Assert that BaikalAdmin is enabled
\BaikalAdmin\Core\Auth::assertEnabled();
# Create and setup a page object
$oPage = new \Flake\Controller\Page(BAIKALADMIN_PATH_TEMPLATES . "Page/index.html");
$oPage->injectHTTPHeaders();
$oPage->setTitle("Baïkal " . BAIKAL_VERSION . " Web Admin");
$oPage->setBaseUrl(PROJECT_URI);
# Authentication
if (\BaikalAdmin\Core\Auth::isAuthenticated() === FALSE && \BaikalAdmin\Core\Auth::authenticate() === FALSE) {
$oPage->zone("navbar")->addBlock(new \BaikalAdmin\Controller\Navigation\Topbar\Anonymous());
$oPage->zone("Payload")->addBlock(new \BaikalAdmin\Controller\Login());
} else {
$oPage->zone("navbar")->addBlock(new \BaikalAdmin\Controller\Navigation\Topbar());
# Route the request
$GLOBALS["ROUTER"]::route($oPage);