summaryrefslogtreecommitdiff
path: root/Core/Functions/func_register.php
diff options
context:
space:
mode:
authorDebulois <quentin@debulois.fr>2022-04-10 21:25:00 +0200
committerDebulois <quentin@debulois.fr>2022-04-10 21:25:00 +0200
commit2923e6fca634231533cca11e43a9091344ff4ba5 (patch)
tree7181e1b0e26ddb072530adec7d55f77e9e389783 /Core/Functions/func_register.php
parent9939f74c0b274ee916f742a45a32d3c843e0960b (diff)
Ajout d'un système de notification pour alerter les pro et finition
Diffstat (limited to 'Core/Functions/func_register.php')
-rw-r--r--Core/Functions/func_register.php14
1 files changed, 8 insertions, 6 deletions
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;