diff --git a/common/html.php b/common/html.php
index d54c703..c14d8bf 100644
--- a/common/html.php
+++ b/common/html.php
@@ -2,11 +2,6 @@
require "init.php";
-function antiCSRF() {
- if (!isset($_SERVER['HTTP_SEC_FETCH_SITE']) OR $_SERVER['HTTP_SEC_FETCH_SITE'] !== "same-origin")
- userError("Anti-CSRF verification failed ! (Wrong or unset Sec-Fetch-Site HTTP header)");
-}
-
// Session initialisation (with cookies)
if (
isset($_COOKIE['niver-session-key']) // Resume session
@@ -75,7 +70,7 @@ $cssFileName = Less_Cache::Get($absoluteLessFiles, $options, THEME);
-
+
/css/= $cssFileName ?>">
-
+
" . $page['title'] . "";
+
+// Protect against cross-site request forgery if a POST request is received
+if (empty($_POST) === false AND (isset($_SERVER['HTTP_SEC_FETCH_SITE']) !== true OR $_SERVER['HTTP_SEC_FETCH_SITE'] !== "same-origin"))
+ userError("Anti-CSRF verification failed ! (Wrong or unset Sec-Fetch-Site
HTTP header)");
+
function closeHTML() {
?>
diff --git a/form.ns.php b/form.ns.php
index ab301c7..7a7b5f0 100644
--- a/form.ns.php
+++ b/form.ns.php
@@ -1,59 +1,58 @@
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/less/main.less b/less/main.less
index dfd0b2c..d4461f2 100644
--- a/less/main.less
+++ b/less/main.less
@@ -9,6 +9,7 @@ html {
}
h1 {
+ text-align: center;
font-size: @fontSize + 25px;
line-height: @fontSize + 30px
}
diff --git a/ns.php b/ns.php
index 7409a0f..f807390 100644
--- a/ns.php
+++ b/ns.php
@@ -1,15 +1,12 @@
En créer un
if (isset($_POST['username']) AND isset($_POST['password'])) {
- antiCSRF();
-
checkPasswordFormat($_POST['password']);
checkUsernameFormat($_POST['username']);
diff --git a/public/auth/password.php b/public/auth/password.php
index b601308..a55e681 100644
--- a/public/auth/password.php
+++ b/public/auth/password.php
@@ -18,8 +18,6 @@
if (isset($_SESSION['username']) AND isset($_POST['newPassword']) AND isset($_POST['currentPassword'])) {
- antiCSRF();
-
checkPasswordFormat($_POST['newPassword']);
if (checkPassword($_SESSION['username'], $_POST['currentPassword']) !== true)
diff --git a/public/auth/register.php b/public/auth/register.php
index 7e61ee6..64c711e 100644
--- a/public/auth/register.php
+++ b/public/auth/register.php
@@ -4,8 +4,6 @@
if (isset($_POST['username']) AND isset($_POST['password'])) {
- antiCSRF();
-
checkPasswordFormat($_POST['password']);
checkUsernameFormat($_POST['username']);
diff --git a/public/ht/http-onion.php b/public/ht/http-onion.php
index 778a243..cb208a7 100644
--- a/public/ht/http-onion.php
+++ b/public/ht/http-onion.php
@@ -30,8 +30,6 @@ if (isset($_SESSION['username'])) {
if (isset($_POST['dir']) AND isset($_SESSION['username'])) {
- antiCSRF();
-
if ($dirsStatuses[$_POST['dir']] !== false)
userError("Wrong value for dir
.");
diff --git a/public/ht/https-domain.php b/public/ht/https-domain.php
index 492bd35..23caaf9 100644
--- a/public/ht/https-domain.php
+++ b/public/ht/https-domain.php
@@ -36,8 +36,6 @@ if (isset($_SESSION['username'])) {
if (isset($_POST['domain']) AND isset($_POST['dir']) AND isset($_SESSION['username'])) {
- antiCSRF();
-
checkDomainFormat($_POST['domain']);
if ($dirsStatuses[$_POST['dir']] !== false)
diff --git a/public/ht/le.php b/public/ht/le.php
index f37c933..75784ec 100644
--- a/public/ht/le.php
+++ b/public/ht/le.php
@@ -22,8 +22,6 @@
if (isset($_POST['domain']) AND isset($_SESSION['username'])) {
- antiCSRF();
-
exec(CONF['ht']['sudo_path'] . " " . CONF['ht']['certbot_path'] . " certonly --dry-run --test-cert --webroot --webroot-path /srv/acme --register-unsafely-without-email --agree-tos --domain " . $_POST['domain'], $output, $returnCode);
// Log Certbot response
diff --git a/public/ns/caa.php b/public/ns/caa.php
index a4f9238..043b2cf 100644
--- a/public/ns/caa.php
+++ b/public/ns/caa.php
@@ -2,7 +2,7 @@