diff --git a/public/css/style.css b/public/css/style.css index c793356..c6653e5 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -23,6 +23,14 @@ img { max-width: 100%; height: auto; } +#la_page { + text-align: center; + width: 1174px; + min-height: 901px; + height:auto; + margin-left: auto; + margin-right: auto; +} #la_page a { color: #5B5EA6; @@ -77,14 +85,6 @@ header.header img { font-family: Bree serif, Arial; font-size: 26px; } -#la_page { - text-align: center; - width: 1174px; - min-height: 901px; - height:auto; - margin-left: auto; - margin-right: auto; -} .article { width:auto; @@ -99,6 +99,12 @@ header.header img { .container { font-family: Arial, sans-serif; } +.profil_user { + height: 400px; + width: 900px; + background-color: lightgray; + text-align: center; +} .records_content th, .records_content2 th { background-color: lightgray; color: rgba(0,0,0,0.85); @@ -108,7 +114,9 @@ header.header img { margin: 5px auto; text-align: center; } - +/******************************************************************/ +/* signup.twig */ +/******************************************************************/ #signupContain { background-color: lightgray; opacity: 0.9; @@ -128,7 +136,7 @@ header.header img { display: inline-block; } -#champsOgligatoire { +#champsObligatoires { float: right; font-size: 0.8em; } @@ -137,6 +145,13 @@ header.header img { display: block; margin: auto; } +/******************************************************************/ +/* layout.twig */ +/******************************************************************/ + +.mdp_oublie:hover { + background-color: deepskyblue; +} /******************************************************************/ /* LOADING PUBKEY */ diff --git a/src/Account/AccountModule.php b/src/Account/AccountModule.php index 7010a59..6c67a7a 100644 --- a/src/Account/AccountModule.php +++ b/src/Account/AccountModule.php @@ -3,6 +3,7 @@ namespace App\Account; use App\Account\Action\AccountAction; use App\Account\Action\AccountEditAction; +use App\Account\Action\ProfilAction; use App\Account\Action\SignupAction; use Framework\Auth\LoggedInMiddleware; use Framework\Module; @@ -23,5 +24,7 @@ class AccountModule extends Module $router->post('/inscription', SignupAction::class); $router->get('/mon-profil', [LoggedInMiddleware::class, AccountAction::class], 'account'); $router->post('/mon-profil', [LoggedInMiddleware::class, AccountEditAction::class]); + $router->get('/profil-utilisateur', ProfilAction::class, 'account.profil'); + $router->post('/profil-utilisateur', ProfilAction::class); } } diff --git a/src/Account/Action/ProfilAction.php b/src/Account/Action/ProfilAction.php new file mode 100644 index 0000000..7ab019e --- /dev/null +++ b/src/Account/Action/ProfilAction.php @@ -0,0 +1,39 @@ +renderer = $renderer; + $this->auth = $auth; + } + + public function __invoke(ServerRequestInterface $request) + { + /* Transmission du nom de l'utilistateur connecté à la vue Twig */ + session_start(); + if (isset($_SESSION['user'])) { + $nom_user = $_SESSION['user']; + } else { + $nom_user = ''; + } + return $this->renderer->render('@account/profil', compact('nom_user')); + } +} diff --git a/src/Account/views/profil.twig b/src/Account/views/profil.twig new file mode 100644 index 0000000..71e9ee6 --- /dev/null +++ b/src/Account/views/profil.twig @@ -0,0 +1,15 @@ +{% extends 'layout.twig' %} + +{% block body %} + +
+

Profil utilisateur {{ nom_user }}

+
+
Biens achetés
+
+
+
Biens vendus
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/src/Account/views/signup.twig b/src/Account/views/signup.twig index 523a9eb..17c3b89 100644 --- a/src/Account/views/signup.twig +++ b/src/Account/views/signup.twig @@ -13,7 +13,7 @@ {{ field('email', user.email, "Email *", {type: 'email'}) }} {{ field('password', null, "Mot de passe *", {type: 'password'}) }} {{ field('password_confirm', null, "Confirmez le mot de passe *", {type: 'password'}) }} -
* Champs obligatoires
+
* Champs obligatoires
{{ field('created_at', date(), null, {type: 'hidden'}) }} diff --git a/src/Auth/Action/LoginAttemptAction.php b/src/Auth/Action/LoginAttemptAction.php index 036f4c1..cbec142 100644 --- a/src/Auth/Action/LoginAttemptAction.php +++ b/src/Auth/Action/LoginAttemptAction.php @@ -39,7 +39,6 @@ class LoginAttemptAction Router $router, SessionInterface $session ) { - $this->renderer = $renderer; $this->auth = $auth; $this->router = $router; @@ -51,7 +50,8 @@ class LoginAttemptAction $params = $request->getParsedBody(); $user = $this->auth->login($params['username'], $params['password']); if ($user) { - $path = $this->session->get('auth.redirect') ?: $this->router->generateUri('gmarche.index'); + $path = $this->session->get('auth.redirect'); + $path = $this->session->get('auth.redirect') ?? $this->router->generateUri('gmarche.index'); $this->session->delete('auth.redirect'); return new RedirectResponse($path); } else { diff --git a/src/Auth/Action/PasswordForgetAction.php b/src/Auth/Action/PasswordForgetAction.php index cc34761..881642d 100644 --- a/src/Auth/Action/PasswordForgetAction.php +++ b/src/Auth/Action/PasswordForgetAction.php @@ -63,7 +63,7 @@ class PasswordForgetAction $this->flashService->success('Un email vous a été envoyé'); return new RedirectResponse($request->getUri()->getPath()); } catch (NoRecordException $e) { - $errors = ['email' => 'Aucun utilisateur ne correspon à cet email']; + $errors = ['email' => 'Aucun utilisateur ne correspond à cet email']; } } else { $errors = $validator->getErrors(); diff --git a/src/Auth/Action/PasswordResetAction.php b/src/Auth/Action/PasswordResetAction.php index c23a7be..6550d11 100644 --- a/src/Auth/Action/PasswordResetAction.php +++ b/src/Auth/Action/PasswordResetAction.php @@ -56,7 +56,7 @@ class PasswordResetAction } else { $params = $request->getParsedBody(); $validator = (new Validator($params)) - ->length('password', 4) + ->length('password', 8) ->confirm('password'); if ($validator->isValid()) { $this->userTable->updatePassword($user->getId(), $params['password']); diff --git a/src/Auth/views/email/password.html.twig b/src/Auth/views/email/password.html.twig index be16cff..e2a84fe 100644 --- a/src/Auth/views/email/password.html.twig +++ b/src/Auth/views/email/password.html.twig @@ -1,5 +1,10 @@

- Vous avez demandé la réinitialisation de votre de mot de passe. +Site Ğ1-Marché +

+

+ Vous avez demandé la réinitialisation de votre mot de passe. +
+ Veuillez pour se faire, cliquer sur le lien ci-dessous :

{{ domain }}{{ path('auth.reset', {id: id, token: token}) }} diff --git a/src/Auth/views/email/password.text.twig b/src/Auth/views/email/password.text.twig index 4595714..53018bd 100644 --- a/src/Auth/views/email/password.text.twig +++ b/src/Auth/views/email/password.text.twig @@ -1,3 +1,7 @@ -Vous avez demandé la réinitialisation de votre de mot de passe. +Site Ğ1-Marché + +Vous avez demandé la réinitialisation de votre mot de passe. + +Veuillez pour se faire, cliquer sur le lien ci-dessous : {{ domain }}{{ path('auth.reset', {id: id, token: token}) }} \ No newline at end of file diff --git a/src/Auth/views/reset.twig b/src/Auth/views/reset.twig index c99dc5c..9e30243 100644 --- a/src/Auth/views/reset.twig +++ b/src/Auth/views/reset.twig @@ -3,7 +3,7 @@ {% block body %} - +

{% if flash('error') %}
{{ flash('error') }} @@ -14,7 +14,7 @@ {{ csrf_input() }} {{ field('password', null, 'Mot de passe', {type: 'password'}) }} {{ field('password_confirm', null, 'Confirmer le mot de passe', {type: 'password'}) }} - + - +
{% endblock %} diff --git a/views/layout.twig b/views/layout.twig index 67a0791..e562efc 100644 --- a/views/layout.twig +++ b/views/layout.twig @@ -47,21 +47,24 @@