Various minor changes

This commit is contained in:
Miraty 2022-11-26 20:10:37 +01:00
parent dc3c976d37
commit 43aa08fca8
5 changed files with 20 additions and 8 deletions

View File

@ -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"

View File

@ -4,6 +4,17 @@
<?php displayIndex(); ?>
<h2>Serveurs de noms</h2>
<p>Une zone hébergée sur ce service est servie par ces serveurs de noms :</p>
<ul>
<?php
foreach (CONF['ns']['servers'] as $server)
echo ' <li><code>' . $server . '</code></li>';
?>
</ul>
<h2>Zones actuellement hébergées</h2>
<?php

View File

@ -3,7 +3,7 @@
if (processForm()) {
$values = nsParseCommonRequirements();
if (!(preg_match('/^[a-zA-Z0-9 =:!%$+\/\()[\]_-]{5,8192}$/D', $_POST['txt'])))
if (!(preg_match('/^[a-zA-Z0-9 .@=:!%$+\/\()[\]_-]{5,8192}$/D', $_POST['txt'])))
output(403, 'Wrong value for <code>txt</code>.');
knotcZoneExec($_POST['zone'], array(
@ -27,7 +27,7 @@ if (processForm()) {
<br>
<label for="txt">Texte</label>
<br>
<input id="txt" minlenght="5" maxlength="8192" pattern="^[a-zA-Z0-9 =:!%$+/\()[\]_-]{5,8192}$" placeholder="Du texte..." name="txt" type="text">
<input id="txt" minlenght="5" maxlength="8192" pattern="^[a-zA-Z0-9 .@=:!%$+/\()[\]_-]{5,8192}$" placeholder="Du texte..." name="txt" type="text">
<br>
<input value="Valider" type="submit">
</form>

View File

@ -77,10 +77,12 @@ https
ssl
tls
mtx
matrix
gmi
gemini
ftp
ftps
mx
imap
imaps
smtp

View File

@ -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,