'niver', 'sid_length' => 64, 'cookie_secure' => true, 'cookie_httponly' => true, 'cookie_samesite' => 'Strict', 'cookie_lifetime' => 604800, 'gc_maxlifetime' => 604800, 'use_strict_mode' => true, 'use_cookies' => true, 'use_only_cookies' => true, ]); define("USERNAME_REGEX", "^[a-z]{4,32}$"); define("PASSWORD_REGEX", "^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])[a-zA-Z0-9]{8,1024}|.{10,1024}$"); define("SUBDOMAIN_REGEX", "^[a-z]{4,63}$"); define("PREFIX", "/malaxe"); define("SERVICE", substr(dirname($_SERVER['PHP_SELF']), strlen(PREFIX) + 1)); define("ROOT_PATH", "/var/www/niver" . PREFIX); define("PAGE", basename($_SERVER['PHP_SELF'], '.php')); define("DB_PATH", ROOT_PATH . "/db/niver.db"); define("KNOTC_PATH", "/usr/sbin/knotc"); if (SERVICE != "auth" AND !isset($_SESSION['username'])) { header('Location: ' . PREFIX . '/auth/login?redir=' . SERVICE . "/" . PAGE, true, 302); exit; } if (substr($_SERVER['REQUEST_URI'], -4) == '.php') { header("Location: " . PREFIX . "/" . SERVICE . "/" . PAGE, true, 301); // 301 Moved Permanently exit; } $theme = array( 'htColor' => "#FF0000", 'nicColor' => "#DA03E5", 'authColor' => "#00FF00", 'nsColor' => "#00FFFF", 'lightColor' => '#FFFFFF', 'darkColor' => '#2a2a2a', ); switch (SERVICE) { case "ht": $theme = array('mainColor' => $theme['htColor']) + $theme; break; case "reg": $theme = array('mainColor' => $theme['nicColor']) + $theme; break; case "auth": $theme = array('mainColor' => $theme['authColor']) + $theme; break; case "": $theme = array('mainColor' => $theme['authColor']) + $theme; break; case "ns": $theme = array('mainColor' => $theme['nsColor']) + $theme; break; } require "inc/all.inc.php"; require "inc/format.inc.php"; require "inc/ht.inc.php"; require "inc/pages.inc.php"; require "inc/reg.inc.php"; require_once 'lessphp/lib/Less/Autoloader.php'; Less_Autoloader::register(); $relativeLessFiles = array_diff(scandir(ROOT_PATH . "/less"), array('..', '.')); $relativeLessFiles = array_flip($relativeLessFiles); foreach ($relativeLessFiles as $relativeLessFile => $nothing) { $absoluteLessFiles[ROOT_PATH . "/less/" . $relativeLessFile] = ""; } $options = array('cache_dir' => ROOT_PATH . '/css/', 'compress' => true); $cssFileName = Less_Cache::Get($absoluteLessFiles, $options, $theme); ?> <?php if ($page['title'] != "Accueil") echo $page['title'] . " · "; ?><?php if (isset($page['service'])) { echo $page['service'] . " · "; } ?>Atope