Minor changes
This commit is contained in:
parent
c674410bf0
commit
54c4f8ab68
14
fn/auth.php
14
fn/auth.php
|
@ -1,18 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
define("USERNAME_REGEX", "^[\p{L}\p{N}_-]{1,64}$");
|
const USERNAME_REGEX = '^[\p{L}\p{N}_-]{1,64}$';
|
||||||
define("PASSWORD_REGEX", "^(?=.*[\p{Ll}])(?=.*[\p{Lu}])(?=.*[\p{N}]).{8,1024}|.{10,1024}$");
|
const PASSWORD_REGEX = '^(?=.*[\p{Ll}])(?=.*[\p{Lu}])(?=.*[\p{N}]).{8,1024}|.{10,1024}$';
|
||||||
|
|
||||||
define("PLACEHOLDER_USERNAME", "lain");
|
const PLACEHOLDER_USERNAME = 'lain';
|
||||||
define("PLACEHOLDER_PASSWORD", "••••••••••••••••••••••••");
|
const PLACEHOLDER_PASSWORD = '••••••••••••••••••••••••';
|
||||||
|
|
||||||
// Password storage security
|
// Password storage security
|
||||||
define("ALGO_PASSWORD", PASSWORD_ARGON2ID);
|
const ALGO_PASSWORD = PASSWORD_ARGON2ID;
|
||||||
define("OPTIONS_PASSWORD", array(
|
const OPTIONS_PASSWORD = [
|
||||||
"memory_cost" => 65536,
|
"memory_cost" => 65536,
|
||||||
"time_cost" => 24,
|
"time_cost" => 24,
|
||||||
"threads" => 64,
|
"threads" => 64,
|
||||||
));
|
];
|
||||||
|
|
||||||
function checkPasswordFormat($password) {
|
function checkPasswordFormat($password) {
|
||||||
if (preg_match("/" . PASSWORD_REGEX . "/u", $password) !== 1)
|
if (preg_match("/" . PASSWORD_REGEX . "/u", $password) !== 1)
|
||||||
|
|
|
@ -25,7 +25,7 @@ if (processForm(false)) {
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
<label for="username">Identifiant</label><br>
|
<label for="username">Identifiant</label><br>
|
||||||
<input required="" minlength="4" maxlength="32" pattern="<?= USERNAME_REGEX ?>" id="username" name="username" type="text" placeholder="<?= PLACEHOLDER_USERNAME ?>">
|
<input required="" minlength="1" maxlength="64" pattern="<?= USERNAME_REGEX ?>" id="username" name="username" type="text" placeholder="<?= PLACEHOLDER_USERNAME ?>">
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<label for="password">Clé de passe</label><br>
|
<label for="password">Clé de passe</label><br>
|
||||||
|
|
|
@ -50,7 +50,7 @@ if (processForm(false)) {
|
||||||
<summary><label for="username">Identifiant</label></summary>
|
<summary><label for="username">Identifiant</label></summary>
|
||||||
Uniquement composé de lettres minuscules.
|
Uniquement composé de lettres minuscules.
|
||||||
</details>
|
</details>
|
||||||
<input id="username" maxlength="32" pattern="<?= USERNAME_REGEX ?>" required="" name="username" type="text" placeholder="<?= PLACEHOLDER_USERNAME ?>"><br>
|
<input id="username" minlength="1" maxlength="64" pattern="<?= USERNAME_REGEX ?>" required="" name="username" type="text" placeholder="<?= PLACEHOLDER_USERNAME ?>"><br>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary><label for="password">Clé de passe</label></summary>
|
<summary><label for="password">Clé de passe</label></summary>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (processForm()) {
|
if (processForm()) {
|
||||||
if (preg_match("/" . CONF['reg']['subdomain_regex'] . "/", $_POST['subdomain']) !== 1)
|
if (preg_match('/' . CONF['reg']['subdomain_regex'] . '/', $_POST['subdomain']) !== 1)
|
||||||
output(403, 'Erreur : Le nom de domaine doit être composé uniquement d\'entre 4 et 63 lettres minuscules (a-z)');
|
output(403, 'Le nom de domaine doit être composé uniquement d\'entre 4 et 63 lettres minuscules ou chiffre (a-z et 0-9)');
|
||||||
|
|
||||||
$domain = formatAbsoluteDomain($_POST['subdomain'] . '.' . CONF['reg']['registry']);
|
$domain = formatAbsoluteDomain($_POST['subdomain'] . '.' . CONF['reg']['registry']);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue