From 2923e6fca634231533cca11e43a9091344ff4ba5 Mon Sep 17 00:00:00 2001 From: Debulois Date: Sun, 10 Apr 2022 21:25:00 +0200 Subject: Ajout d'un système de notification pour alerter les pro et finition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Functions/func_register.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Core/Functions/func_register.php') diff --git a/Core/Functions/func_register.php b/Core/Functions/func_register.php index d8960ce..1a94bc1 100644 --- a/Core/Functions/func_register.php +++ b/Core/Functions/func_register.php @@ -8,14 +8,16 @@ function register($email, $password, $userStatus) { // les regex necessaire pour vérifier le mot de passe - $numb = "/[0-9]/"; - $upper = "/[A-Z]/"; - $special = "/[`!@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?~µ°€£]/"; + $regNumb = "/[0-9]/"; + $regUpper = "/[A-Z]/"; + $regSpecial = "/[`!@#$%^&*()_+\-=\[\]{};':\"\\|,.<>\/?~µ°€£]/"; + $regEmail = "/^[a-z0-9_-]+@[a-z0-9-]+\.[a-z]/"; if ((strlen($password) >= 8) - && preg_match($numb, $password) - && preg_match($upper, $password) - && preg_match($special, $password) + && preg_match($regNumb, $password) + && preg_match($regUpper, $password) + && preg_match($regSpecial, $password) + && preg_match($regEmail, $email) ) { $dbuser = new DbUser; -- cgit v1.2.3