diff --git a/EnigmePython/genCryptarythme.py b/EnigmePython/genCryptarythme.py new file mode 100644 index 00000000..e69de29b diff --git a/WEB/Config/Validation.php b/WEB/Config/Validation.php index 49a0d99c..16477f87 100644 --- a/WEB/Config/Validation.php +++ b/WEB/Config/Validation.php @@ -36,4 +36,11 @@ class Validation } return true; } + public function ValidatePassword(string $password) : bool{ + if(strlen($password)>100) + { + return false; + } + return true; + } } diff --git a/WEB/Controller/Controller.php b/WEB/Controller/Controller.php index 97399bb5..25a282d3 100644 --- a/WEB/Controller/Controller.php +++ b/WEB/Controller/Controller.php @@ -54,7 +54,10 @@ class Controller throw (new Exception("Email non valide")); } if(! $validation->ValidateUsername($_REQUEST['username'])){ - throw(new Exception("Username non valide")); + throw(new Exception("Pseudo non valide")); + } + if(! $validation->ValidatePassword($_REQUEST['password'])){ + throw(new InvalidMdpException("Mot de passe non valide")); } $joueur = new Joueur($_REQUEST['email'], $_REQUEST['username'], $_REQUEST['password']); $gateway->insert($joueur);