Finalisation Connexion user - Ajout lien Reinit mot de passe - Ajout Profil user
This commit is contained in:
parent
0e895c8ae1
commit
3e65bf1fcf
|
@ -23,6 +23,14 @@ img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
}
|
}
|
||||||
|
#la_page {
|
||||||
|
text-align: center;
|
||||||
|
width: 1174px;
|
||||||
|
min-height: 901px;
|
||||||
|
height:auto;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
#la_page a {
|
#la_page a {
|
||||||
color: #5B5EA6;
|
color: #5B5EA6;
|
||||||
|
@ -77,14 +85,6 @@ header.header img {
|
||||||
font-family: Bree serif, Arial;
|
font-family: Bree serif, Arial;
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
#la_page {
|
|
||||||
text-align: center;
|
|
||||||
width: 1174px;
|
|
||||||
min-height: 901px;
|
|
||||||
height:auto;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.article {
|
.article {
|
||||||
width:auto;
|
width:auto;
|
||||||
|
@ -99,6 +99,12 @@ header.header img {
|
||||||
.container {
|
.container {
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
.profil_user {
|
||||||
|
height: 400px;
|
||||||
|
width: 900px;
|
||||||
|
background-color: lightgray;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.records_content th, .records_content2 th {
|
.records_content th, .records_content2 th {
|
||||||
background-color: lightgray;
|
background-color: lightgray;
|
||||||
color: rgba(0,0,0,0.85);
|
color: rgba(0,0,0,0.85);
|
||||||
|
@ -108,7 +114,9 @@ header.header img {
|
||||||
margin: 5px auto;
|
margin: 5px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
/******************************************************************/
|
||||||
|
/* signup.twig */
|
||||||
|
/******************************************************************/
|
||||||
#signupContain {
|
#signupContain {
|
||||||
background-color: lightgray;
|
background-color: lightgray;
|
||||||
opacity: 0.9;
|
opacity: 0.9;
|
||||||
|
@ -128,7 +136,7 @@ header.header img {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#champsOgligatoire {
|
#champsObligatoires {
|
||||||
float: right;
|
float: right;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
}
|
}
|
||||||
|
@ -137,6 +145,13 @@ header.header img {
|
||||||
display: block;
|
display: block;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
/******************************************************************/
|
||||||
|
/* layout.twig */
|
||||||
|
/******************************************************************/
|
||||||
|
|
||||||
|
.mdp_oublie:hover {
|
||||||
|
background-color: deepskyblue;
|
||||||
|
}
|
||||||
|
|
||||||
/******************************************************************/
|
/******************************************************************/
|
||||||
/* LOADING PUBKEY */
|
/* LOADING PUBKEY */
|
||||||
|
|
|
@ -3,6 +3,7 @@ namespace App\Account;
|
||||||
|
|
||||||
use App\Account\Action\AccountAction;
|
use App\Account\Action\AccountAction;
|
||||||
use App\Account\Action\AccountEditAction;
|
use App\Account\Action\AccountEditAction;
|
||||||
|
use App\Account\Action\ProfilAction;
|
||||||
use App\Account\Action\SignupAction;
|
use App\Account\Action\SignupAction;
|
||||||
use Framework\Auth\LoggedInMiddleware;
|
use Framework\Auth\LoggedInMiddleware;
|
||||||
use Framework\Module;
|
use Framework\Module;
|
||||||
|
@ -23,5 +24,7 @@ class AccountModule extends Module
|
||||||
$router->post('/inscription', SignupAction::class);
|
$router->post('/inscription', SignupAction::class);
|
||||||
$router->get('/mon-profil', [LoggedInMiddleware::class, AccountAction::class], 'account');
|
$router->get('/mon-profil', [LoggedInMiddleware::class, AccountAction::class], 'account');
|
||||||
$router->post('/mon-profil', [LoggedInMiddleware::class, AccountEditAction::class]);
|
$router->post('/mon-profil', [LoggedInMiddleware::class, AccountEditAction::class]);
|
||||||
|
$router->get('/profil-utilisateur', ProfilAction::class, 'account.profil');
|
||||||
|
$router->post('/profil-utilisateur', ProfilAction::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
<?php
|
||||||
|
namespace App\Account\Action;
|
||||||
|
|
||||||
|
use Framework\Auth;
|
||||||
|
use Framework\Renderer\RendererInterface;
|
||||||
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
|
|
||||||
|
class ProfilAction
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var RendererInterface
|
||||||
|
*/
|
||||||
|
private $renderer;
|
||||||
|
/**
|
||||||
|
* @var Auth
|
||||||
|
*/
|
||||||
|
private $auth;
|
||||||
|
|
||||||
|
public function __construct(
|
||||||
|
RendererInterface $renderer,
|
||||||
|
Auth $auth
|
||||||
|
) {
|
||||||
|
$this->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'));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
{% extends 'layout.twig' %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
|
||||||
|
<div class="profil_user" style="margin-top:5px;">
|
||||||
|
<h4>Profil utilisateur {{ nom_user }}</h4>
|
||||||
|
<div>
|
||||||
|
<h5>Biens achetés</h5>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h5>Biens vendus</h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
|
@ -13,7 +13,7 @@
|
||||||
{{ field('email', user.email, "Email *", {type: 'email'}) }}
|
{{ field('email', user.email, "Email *", {type: 'email'}) }}
|
||||||
{{ field('password', null, "Mot de passe *", {type: 'password'}) }}
|
{{ field('password', null, "Mot de passe *", {type: 'password'}) }}
|
||||||
{{ field('password_confirm', null, "Confirmez le mot de passe *", {type: 'password'}) }}
|
{{ field('password_confirm', null, "Confirmez le mot de passe *", {type: 'password'}) }}
|
||||||
<div id="champsOgligatoire">* Champs obligatoires</div>
|
<div id="champsObligatoires">* Champs obligatoires</div>
|
||||||
{{ field('created_at', date(), null, {type: 'hidden'}) }}
|
{{ field('created_at', date(), null, {type: 'hidden'}) }}
|
||||||
<button class="btn btn-primary" id="validSignup">S'inscrire</button>
|
<button class="btn btn-primary" id="validSignup">S'inscrire</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -39,7 +39,6 @@ class LoginAttemptAction
|
||||||
Router $router,
|
Router $router,
|
||||||
SessionInterface $session
|
SessionInterface $session
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$this->renderer = $renderer;
|
$this->renderer = $renderer;
|
||||||
$this->auth = $auth;
|
$this->auth = $auth;
|
||||||
$this->router = $router;
|
$this->router = $router;
|
||||||
|
@ -51,7 +50,8 @@ class LoginAttemptAction
|
||||||
$params = $request->getParsedBody();
|
$params = $request->getParsedBody();
|
||||||
$user = $this->auth->login($params['username'], $params['password']);
|
$user = $this->auth->login($params['username'], $params['password']);
|
||||||
if ($user) {
|
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');
|
$this->session->delete('auth.redirect');
|
||||||
return new RedirectResponse($path);
|
return new RedirectResponse($path);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -63,7 +63,7 @@ class PasswordForgetAction
|
||||||
$this->flashService->success('Un email vous a été envoyé');
|
$this->flashService->success('Un email vous a été envoyé');
|
||||||
return new RedirectResponse($request->getUri()->getPath());
|
return new RedirectResponse($request->getUri()->getPath());
|
||||||
} catch (NoRecordException $e) {
|
} catch (NoRecordException $e) {
|
||||||
$errors = ['email' => 'Aucun utilisateur ne correspon à cet email'];
|
$errors = ['email' => 'Aucun utilisateur ne correspond à cet email'];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$errors = $validator->getErrors();
|
$errors = $validator->getErrors();
|
||||||
|
|
|
@ -56,7 +56,7 @@ class PasswordResetAction
|
||||||
} else {
|
} else {
|
||||||
$params = $request->getParsedBody();
|
$params = $request->getParsedBody();
|
||||||
$validator = (new Validator($params))
|
$validator = (new Validator($params))
|
||||||
->length('password', 4)
|
->length('password', 8)
|
||||||
->confirm('password');
|
->confirm('password');
|
||||||
if ($validator->isValid()) {
|
if ($validator->isValid()) {
|
||||||
$this->userTable->updatePassword($user->getId(), $params['password']);
|
$this->userTable->updatePassword($user->getId(), $params['password']);
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
<p>
|
<p>
|
||||||
Vous avez demandé la réinitialisation de votre de mot de passe.
|
Site Ğ1-Marché
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Vous avez demandé la réinitialisation de votre mot de passe.
|
||||||
|
<br />
|
||||||
|
Veuillez pour se faire, cliquer sur le lien ci-dessous :
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="{{ domain }}{{ path('auth.reset', {id: id, token: token}) }}">{{ domain }}{{ path('auth.reset', {id: id, token: token}) }}</a>
|
<a href="{{ domain }}{{ path('auth.reset', {id: id, token: token}) }}">{{ domain }}{{ path('auth.reset', {id: id, token: token}) }}</a>
|
||||||
|
|
|
@ -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}) }}
|
{{ domain }}{{ path('auth.reset', {id: id, token: token}) }}
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
|
<div class="container" style="color:floralwhite;background-color: #333333;padding: 1rem;">
|
||||||
{% if flash('error') %}
|
{% if flash('error') %}
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
{{ flash('error') }}
|
{{ flash('error') }}
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
{{ csrf_input() }}
|
{{ csrf_input() }}
|
||||||
{{ field('password', null, 'Mot de passe', {type: 'password'}) }}
|
{{ field('password', null, 'Mot de passe', {type: 'password'}) }}
|
||||||
{{ field('password_confirm', null, 'Confirmer le mot de passe', {type: 'password'}) }}
|
{{ field('password_confirm', null, 'Confirmer le mot de passe', {type: 'password'}) }}
|
||||||
<button class="btn btn-primary">Réinitialiser mon mot de passe</button>
|
<button class="btn btn-primary">Enregistrer mon nouveau mot de passe</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -47,21 +47,24 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="navbar-nav">
|
<div class="navbar-nav">
|
||||||
<div class="navbar-text" style="color:lightgray;margin-right:15px; margin-top:-3px;">
|
<div class="navbar-text" style="color:lightgray;margin-right:15px; margin-top:3px;">
|
||||||
{{ "now"|date('d/m/y') }}
|
{{ "now"|date('d/m/y') }}
|
||||||
</div>
|
</div>
|
||||||
<!--{pourcent if current_user() pourcent}-->
|
<!--{pourcent if current_user() pourcent}-->
|
||||||
{% if nom_user != '' %}
|
{% if nom_user != '' %}
|
||||||
<div class="navbar-text" id="user"><span><img src="\avatar_user.png" width="22" height="22" /></span>
|
<!-- <button style="background-color: transparent;padding:0;border:0;" -->
|
||||||
<span id="nom_connecte">{{ nom_user }}</span>
|
<form method="post" style="margin-top:5px;" action="{{ path('account.profil') }}">
|
||||||
</div>
|
<span><img src="\avatar_user.png" width="22" height="22" /></span>
|
||||||
|
<!--<span id="nom_connecte"> nom_user </span>-->
|
||||||
|
<button style="color:white;font-size: 14px;" class="btn-primary">{{ nom_user }}</button>
|
||||||
|
</form>
|
||||||
<form method="post" action="{{ path('auth.logout') }}">
|
<form method="post" action="{{ path('auth.logout') }}">
|
||||||
<!-- csrf_input() }}-->
|
<!-- csrf_input() }}-->
|
||||||
<button class="btn btn-danger" style="margin-left: 7px; font-size:14px;">Se déconnecter</button>
|
<button class="btn btn-danger" style="margin-left: 7px; font-size:14px;">Se déconnecter</button>
|
||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="nav-item" id="bouton-connexion">
|
<div class="nav-item" id="bouton-connexion">
|
||||||
<button style="color:white; font-size: 14px;" class="btn btn-primary" data-toggle="modal" data-target="#connexion_modal">Se connecter
|
<button style="color:white; font-size: 14px;" class="btn btn-primary" data-toggle="modal" data-target="#connexion_modal">Se connecter</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="nom_connecte" style="display:none;margin-left:10px;margin-top:6px;margin-right:8px;">
|
<div id="nom_connecte" style="display:none;margin-left:10px;margin-top:6px;margin-right:8px;">
|
||||||
</div>
|
</div>
|
||||||
|
@ -86,6 +89,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
|
|
||||||
<div class="modal fade" id="connexion_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
<div class="modal fade" id="connexion_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||||
<div class="modal-dialog" role="document" style="color: black;">
|
<div class="modal-dialog" role="document" style="color: black;">
|
||||||
<div class="modal-content" style="text-align: left;">
|
<div class="modal-content" style="text-align: left;">
|
||||||
|
@ -103,6 +107,11 @@
|
||||||
<input type="password" id="mdp" class="form-control"/>
|
<input type="password" id="mdp" class="form-control"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<button class="mdp_oublie" type="button" class="btn-default">
|
||||||
|
<a style="color:gray;" href="{{ path('auth.password') }}">Mot de passe oublié ?</a>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
|
<button type="button" class="btn btn-default" data-dismiss="modal">Annuler</button>
|
||||||
<button type="button" class="btn btn-primary"
|
<button type="button" class="btn btn-primary"
|
||||||
|
|
Loading…
Reference in New Issue