From df929e7458a92b925d8e4b4db4f14576dfe147d2 Mon Sep 17 00:00:00 2001 From: samuel Date: Tue, 21 Nov 2023 10:50:20 +0100 Subject: [PATCH] conception --- Documentation/models.puml | 24 ++++++++++++++---------- src/Gateway/AuthGateway.php | 2 +- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/Documentation/models.puml b/Documentation/models.puml index 48973d4..1a28172 100755 --- a/Documentation/models.puml +++ b/Documentation/models.puml @@ -69,25 +69,29 @@ class Color { } class AuthController{ - -twig: Environment - + login (request) : int - + register (request) : int + + displayRegister() : HttpResponse + + displayBadFields(viewName : string, fails : array) : HttpResponse + + confirmRegister(request : array) : HttpResponse + + displayLogin() : HttpResponse + + confirmLogin() : HttpResponse } -AuthController --> "- modelAuth" AuthModel +AuthController --> "- model" AuthModel class AuthModel{ - + validationRegister(username : string, email : string, password : string) - + validationLogin (username : string, email : string, password : string) + + + register(username : string, password : string, confirmPassword : string, email : string): array + + getUserFields(email : string):array + + login(email : string, password : string) } AuthModel --> "- gateway" AuthGateway class AuthGateway{ -con : Connection - + insert(mail : string, password : string) - + isAccountEqual(mail : string, password : string) + + mailExist(email : string) : bool + + insertAccount(username : string, hash : string, email : string) + + getUserHash(email : string):string + + getUserFields (email : string): array } - - @enduml \ No newline at end of file diff --git a/src/Gateway/AuthGateway.php b/src/Gateway/AuthGateway.php index c04e5e3..e6c7199 100644 --- a/src/Gateway/AuthGateway.php +++ b/src/Gateway/AuthGateway.php @@ -21,7 +21,7 @@ class AuthGateway { } - public function insertAccount(string $username, string $hash, string $email) { + public function insertAccount(string $username, string $hash, string $email):void{ $this->con->exec("INSERT INTO AccountUser VALUES (:username,:hash,:email)", [':username' => [$username, PDO::PARAM_STR],':hash'=> [$hash, PDO::PARAM_STR],':email'=>[$email, PDO::PARAM_STR]]); }