From 43aa08fca8f596fb9dfb4009c3eeb7355beaea4e Mon Sep 17 00:00:00 2001 From: Miraty Date: Sat, 26 Nov 2022 20:10:37 +0100 Subject: [PATCH] Various minor changes --- config.ini | 4 ++-- pages/ns/index.php | 11 +++++++++++ pages/ns/txt.php | 4 ++-- pages/reg/reserved.txt | 2 ++ router.php | 7 +++---- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/config.ini b/config.ini index 7fc6c74..92b1e99 100644 --- a/config.ini +++ b/config.ini @@ -10,7 +10,7 @@ knotc_path = "/usr/sbin/knotc" [reg] enabled = true -registry = niver.test. +registry = "niver.test." registry_file = "/srv/niver/reg/niver.test.zone" ttl = 86400 @@ -47,7 +47,7 @@ cat_path = "/usr/bin/cat" rm_path = "/usr/bin/rm" mkdir_path = "/usr/bin/mkdir" -sftpgo_group = sftpgo +sftpgo_group = "sftpgo" ; Will be shown to users ipv6_address = "::1" diff --git a/pages/ns/index.php b/pages/ns/index.php index 81bcadb..efe0933 100644 --- a/pages/ns/index.php +++ b/pages/ns/index.php @@ -4,6 +4,17 @@ +

Serveurs de noms

+ +

Une zone hébergée sur ce service est servie par ces serveurs de noms :

+ + +

Zones actuellement hébergées

txt.'); knotcZoneExec($_POST['zone'], array( @@ -27,7 +27,7 @@ if (processForm()) {

- +
diff --git a/pages/reg/reserved.txt b/pages/reg/reserved.txt index 08456cd..bfbb72f 100644 --- a/pages/reg/reserved.txt +++ b/pages/reg/reserved.txt @@ -77,10 +77,12 @@ https ssl tls mtx +matrix gmi gemini ftp ftps +mx imap imaps smtp diff --git a/router.php b/router.php index d667532..23c17e6 100644 --- a/router.php +++ b/router.php @@ -27,9 +27,7 @@ define('PAGE_LINEAGE', explode('/', PAGE_ADDRESS)); define('SERVICE', dirname(PAGE_ADDRESS)); define('PAGE', basename(PAGE_ADDRESS, '.php')); -$pageMetadata = []; function getPageInformations($pages, $pageElements) { - global $pageMetadata; if (!isset($pages['index']) OR $pageElements[0] === 'index') return [ 'titles_lineage' => [$pages[$pageElements[0]]['title'] ?? false], @@ -53,13 +51,14 @@ if (!TITLES_LINEAGE[array_key_last(TITLES_LINEAGE)]) { exit('Page not found.'); } +const SESSION_COOKIE_NAME = 'niver-session-key'; if ( - isset($_COOKIE['niver-session-key']) // Resume session + isset($_COOKIE[SESSION_COOKIE_NAME]) // Resume session OR (isset($_POST['username']) AND in_array(PAGE_URL, ['auth/login', 'auth/register'])) // Start new session ) { session_start([ - 'name' => 'niver-session-key', + 'name' => SESSION_COOKIE_NAME, 'sid_length' => 64, 'sid_bits_per_character' => 6, 'cookie_secure' => true,