Commit d89562de by Julien Jorry

Add change password menu for all user + modal login + role_admin on all role…

Add change password menu for all user + modal login + role_admin on all role that has access to admin area
parent 5015f2c7
......@@ -20,13 +20,10 @@ global.$ = global.jQuery = $;
// no need to set this to a variable, just require it
// require('popper.js/dist/popper.js');
require('bootstrap');
// require('../css/lumen/_variables.scss');
// require('../css/lumen/_bootswatch.scss');
// require('../css/lumen/bootstrap.min.css');
// require('../leaflet/leaflet.css');
// leaftlet : for openstreetmap
require('../leaflet/leaflet.js');
// for flash message notification
require('../js/flash-messages.js');
const mlc = require('../js/mlc.js');
......
......@@ -2,7 +2,7 @@ framework:
templating: { engines: ['twig'] }
secret: '%env(APP_SECRET)%'
#default_locale: en
#csrf_protection: true
csrf_protection: true
#http_method_override: true
# Enables session support. Note that the session will ONLY be started if you read or write from it.
......
......@@ -86,14 +86,14 @@ security:
role_hierarchy:
ROLE_ADHERENT: ROLE_USER
ROLE_PRESTATAIRE: ROLE_USER
ROLE_ADMIN_SIEGE: ROLE_USER
ROLE_REDACTEUR: ROLE_USER
ROLE_TRESORIER: ROLE_USER
ROLE_CONTROLEUR: ROLE_USER
ROLE_GESTION_GROUPE: ROLE_USER
ROLE_COMPTOIR: ROLE_USER
ROLE_CONTACT: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_SONATA_ADMIN, ROLE_ALLOWED_TO_SWITCH]
ROLE_ADMIN_SIEGE: [ROLE_USER, ROLE_ADMIN]
ROLE_REDACTEUR: [ROLE_USER, ROLE_ADMIN]
ROLE_TRESORIER: [ROLE_USER, ROLE_ADMIN]
ROLE_CONTROLEUR: [ROLE_USER, ROLE_ADMIN]
ROLE_GESTION_GROUPE: [ROLE_USER, ROLE_ADMIN]
ROLE_COMPTOIR: [ROLE_USER, ROLE_ADMIN]
ROLE_CONTACT: [ROLE_USER, ROLE_ADMIN]
ROLE_SUPER_ADMIN: [ROLE_SONATA_ADMIN, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
......
......@@ -304,7 +304,7 @@ services:
admin.reconversion.gerer:
class: App\Admin\ReconversionAdmin
arguments: [~, App\Entity\Transfert, ~]
arguments: [~, App\Entity\TransfertPrestataireSiege, ~]
tags:
- name: sonata.admin
manager_type: orm
......
......@@ -23,16 +23,21 @@ use Swagger\Annotations as SWG;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Security as Secur;
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
class IndexController extends AbstractController
{
private $em;
private $um;
private $tokenManager;
public function __construct(EntityManagerInterface $em, UserManagerInterface $um)
public function __construct(EntityManagerInterface $em, UserManagerInterface $um, CsrfTokenManagerInterface $tokenManager = null)
{
$this->em = $em;
$this->um = $um;
$this->tokenManager = $tokenManager;
}
/**
......@@ -50,8 +55,20 @@ class IndexController extends AbstractController
// array('%name%' => $user->getName())
// );
/* Pour la modale de login => SecurityController loginAction */
/** @var $session Session */
$session = $request->getSession();
$lastUsernameKey = Secur::LAST_USERNAME;
// last username entered by the user
$lastUsername = (null === $session) ? '' : $session->get($lastUsernameKey);
$csrfToken = $this->tokenManager
? $this->tokenManager->getToken('authenticate')->getValue()
: null;
return $this->render('index.html.twig', [
'news' => array(),
'last_username' => $lastUsername,
'csrf_token' => $csrfToken
]);
}
......
......@@ -3,7 +3,7 @@
namespace App\Controller;
use App\Entity\User;
use App\Form\Type\RegistrationFormType;
use App\Form\Type\UserInfosFormType;
use Doctrine\ORM\EntityManagerInterface;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
......@@ -29,7 +29,7 @@ class UserController extends AbstractController
*/
public function userInfosAction(Request $request)
{
$form = $this->createForm(RegistrationFormType::class, $this->getUser());
$form = $this->createForm(UserInfosFormType::class, $this->getUser());
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
......
......@@ -31,6 +31,8 @@ use App\Form\Type\TransfertGroupeSiegeFormType;
use App\Form\Type\TransfertPrestataireComptoirFormType;
use App\Form\Type\TransfertPrestataireSiegeFormType;
use App\Form\Type\TransfertSiegeGroupeFormType;
use App\Form\Type\UserInfosFormType;
use FOS\UserBundle\Form\Type\ChangePasswordFormType;
use Symfony\Component\Form\FormFactoryInterface as FormF;
use Symfony\Component\Routing\RouterInterface;
......@@ -48,9 +50,19 @@ class FormFactory
public function getUserInfosForm(User $user)
{
if (empty($user)) {
throw new \Exception("[FORM 0] Opération impossible !");
}
$form = $this->ff->create(UserInfosFormType::class, $user, array('action' => $this->router->generate('user_infos')));
return $form->createView();
}
public function getUserPasswordForm(User $user)
{
if (empty($user)) {
throw new \Exception("[FORM 1] Opération impossible !");
}
$form = $this->ff->create(RegistrationFormType::class, $user, array('action' => $this->router->generate('user_infos')));
$form = $this->ff->create(ChangePasswordFormType::class, $user, array('action' => $this->router->generate('fos_user_change_password')));
return $form->createView();
}
......
......@@ -9,6 +9,7 @@ use App\Entity\User;
use App\Enum\MoyenEnum;
use App\Form\Type\GeolocFormType;
use App\Form\Type\RegistrationFormType;
use App\Form\Type\UserInfosFormType;
use Doctrine\DBAL\Types\FloatType;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
......@@ -43,7 +44,7 @@ class AdherentInfosFormType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('user', RegistrationFormType::class, array(
->add('user', UserInfosFormType::class, array(
'label' => false,
'required' => false
))
......
......@@ -47,6 +47,7 @@ class RegistrationFormType extends AbstractType
))
->add('plainPassword', RepeatedType::class, array(
'type' => PasswordType::class,
'required' => false,
'options' => array(
'translation_domain' => 'FOSUserBundle',
'attr' => array(
......
<?php
namespace App\Form\Type;
use App\Entity\User;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\OptionsResolver\OptionsResolver;
class UserInfosFormType extends AbstractType
{
protected $em;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->remove('username')
->add('firstname', TextType::class, array(
'label' => 'Prénom',
'required' => false,
))
->add('lastname', TextType::class, array(
'label' => 'Nom',
'required' => false,
))
->add('email', EmailType::class, array(
'label' => 'Courriel',
'required' => true,
'disabled' => true,
'translation_domain' => 'FOSUserBundle'
))
;
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults(array(
'data_class' => User::class,
'cascade_validation' => true,
// 'type' => null
));
}
public function getBlockPrefix()
{
return 'user_infos';
}
}
......@@ -24,6 +24,7 @@ class FormExtension extends AbstractExtension
{
return [
new \Twig_SimpleFunction('getUserInfosForm', array($this, 'getUserInfosForm')),
new \Twig_SimpleFunction('getUserPasswordForm', array($this, 'getUserPasswordForm')),
new \Twig_SimpleFunction('getGroupeInfosForm', array($this, 'getGroupeInfosForm')),
new \Twig_SimpleFunction('getComptoirInfosForm', array($this, 'getComptoirInfosForm')),
new \Twig_SimpleFunction('getPrestataireInfosForm', array($this, 'getPrestataireInfosForm')),
......@@ -54,6 +55,10 @@ class FormExtension extends AbstractExtension
{
return $this->container->get('app.formfactory')->getUserInfosForm($user);
}
public function getUserPasswordForm(User $user)
{
return $this->container->get('app.formfactory')->getUserPasswordForm($user);
}
public function getGroupeInfosForm(User $user)
{
return $this->container->get('app.formfactory')->getGroupeInfosForm($user);
......
{% set modal_id = modal_id is defined ? modal_id : 'modal_id' %}
{% set modal_title = modal_title is defined ? modal_title : 'Modal title' %}
{% set modal_content = modal_content is defined ? modal_content : 'Modal content' %}
{% set btn_primary = btn_primary is defined ? btn_primary : '' %}
{% set btn_secondary = btn_secondary is defined ? btn_secondary : 'Fermer' %}
{#
<!-- Button trigger modal -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#{{ modal_id }}">
VOIR MODAL
</button>
#}
<div class="modal fade" tabindex="-1" role="dialog" id="{{ modal_id }}" aria-labelledby="{{ modal_id }}" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ modal_title }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
{{ modal_content }}
</div>
<div class="modal-footer">
{% if btn_primary is not empty %}
<button type="button" class="btn btn-primary">{{ btn_primary }}</button>
{% endif %}
{% if btn_secondary is not empty %}
<button type="button" class="btn btn-secondary" data-dismiss="modal">{{ btn_secondary }}</button>
{% endif %}
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -48,16 +48,19 @@
{% set soldelabel = 'Solde du siège'|trans %}
{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
{% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{% include 'siege/block/transfert_siegegroupe.html.twig' %}
{% include 'siege/block/transfert_groupesiege.html.twig' %}
{% elseif is_granted('ROLE_REDACTEUR') %}
{% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{% elseif is_granted('ROLE_TRESORIER') %}
{% set siege = getSiege() %}
{% set compte = siege.getCompte() %}
{% set soldelabel = 'Solde du siège'|trans %}
{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
{% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{# {% include 'block/soldegroupes.html.twig' %} #}
{% elseif is_granted('ROLE_CONTROLEUR') %}
{% include 'block/userinfos.html.twig' %}
......@@ -69,6 +72,7 @@
{% endif %}
{% include 'groupe/block/infos.html.twig' %}
{% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% include 'groupe/block/transaction_comptoir.html.twig' %}
{% elseif is_granted('ROLE_COMPTOIR') %}
......@@ -79,6 +83,7 @@
{% endif %}
{% include 'comptoir/block/infos.html.twig' %}
{% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% include 'comptoir/block/transaction_adherent.html.twig' %}
{% include 'comptoir/block/reconversion.html.twig' %}
......@@ -90,6 +95,7 @@
{% endif %}
{% include 'groupe/block/infos.html.twig' %}
{% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% elseif is_granted('ROLE_SUPER_ADMIN') %}
{% set siege = getSiege() %}
......@@ -97,10 +103,12 @@
{% set soldelabel = 'Solde du siège'|trans %}
{% include 'block/solde.html.twig' with {'compte': compte, 'soldelabel': soldelabel} %}
{% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{% elseif is_granted('ROLE_PRESTATAIRE') %}
{% include 'presta/block/solde.html.twig' %}
{% include 'presta/block/infos.html.twig' %}
{% include 'block/userinfos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{% include 'block/cotisations.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% include 'groupepresta/block/inscription.html.twig' %}
......@@ -110,6 +118,7 @@
{% elseif is_granted('ROLE_ADHERENT') %}
{% include 'adherent/block/solde.html.twig' %}
{% include 'adherent/block/infos.html.twig' %}
{% include 'block/userpassword.html.twig' %}
{% include 'block/cotisations.html.twig' %}
{% include 'block/transactions.html.twig' %}
{% include 'adherent/block/transaction_presta.html.twig' %}
......
......@@ -11,7 +11,6 @@
{{ form_row(form.email) }}
{{ form_row(form.firstname) }}
{{ form_row(form.lastname) }}
{{ form_row(form.plainPassword) }}
<input type="submit" id="_submit" name="_submit" value="{{ 'Valider'|trans }}" />
{{form_end(form)}}
{% endblock blockcontent %}
\ No newline at end of file
{% extends 'block/block_collapse.html.twig' %}
{% block blocktitle %}
<i class="fa fa-user-cog mr-4"></i> {{'Changer votre mot de passe'|trans}}
{% endblock blocktitle %}
{% block blocksubtitle %}
{% endblock blocksubtitle %}
{% block blockcontent %}
{% set form = getUserPasswordForm(app.user) %}
{{form_start(form)}}
{{ form_row(form.current_password) }}
{{ form_row(form.plainPassword) }}
<input type="submit" id="_submit" name="_submit" value="{{ 'Valider'|trans }}" />
{{form_end(form)}}
{% endblock blockcontent %}
\ No newline at end of file
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/ChangePassword/change_password_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, { 'action': path('fos_user_change_password'), 'attr': { 'class': 'fos_user_change_password' } }) }}
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'change_password.submit'|trans }}" />
</div>
{{ form_end(form) }}
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Group/edit_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, { 'action': path('fos_user_group_edit', {'groupName': group_name}), 'attr': { 'class': 'fos_user_group_edit' } }) }}
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'group.edit.submit'|trans }}" />
</div>
{{ form_end(form) }}
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Group/list_content.html.twig" %}
{% endblock fos_user_content %}
<div class="fos_user_group_list">
<ul>
{% for group in groups %}
<li><a href="{{ path('fos_user_group_show', {'groupName': group.getName()} ) }}">{{ group.getName() }}</a></li>
{% endfor %}
</ul>
</div>
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Group/new_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, { 'action': path('fos_user_group_new'), 'attr': { 'class': 'fos_user_group_new' } }) }}
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'group.new.submit'|trans }}" />
</div>
{{ form_end(form) }}
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Group/show_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
<div class="fos_user_group_show">
<p>{{ 'group.show.name'|trans }}: {{ group.getName() }}</p>
</div>
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Profile/edit_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, { 'action': path('fos_user_profile_edit'), 'attr': { 'class': 'fos_user_profile_edit' } }) }}
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'profile.edit.submit'|trans }}" />
</div>
{{ form_end(form) }}
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Profile/show_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
<div class="fos_user_user_show">
<p>{{ 'profile.show.username'|trans }}: {{ user.username }}</p>
<p>{{ 'profile.show.email'|trans }}: {{ user.email }}</p>
</div>
{% extends "@FOSUser/layout.html.twig" %}
{% trans_default_domain 'FOSUserBundle' %}
{% block fos_user_content %}
<p>{{ 'registration.check_email'|trans({'%email%': user.email}) }}</p>
{% endblock fos_user_content %}
{% extends "@FOSUser/layout.html.twig" %}
{% trans_default_domain 'FOSUserBundle' %}
{% block fos_user_content %}
<p>{{ 'registration.confirmed'|trans({'%username%': user.username}) }}</p>
{% if targetUrl %}
<p><a href="{{ targetUrl }}">{{ 'registration.back'|trans }}</a></p>
{% endif %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
{% block subject %}
{%- autoescape false -%}
{{ 'registration.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{%- endautoescape -%}
{% endblock %}
{% block body_text %}
{% autoescape false %}
{{ 'registration.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_html %}{% endblock %}
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Registration/register_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, {'method': 'post', 'action': path('fos_user_registration_register'), 'attr': {'class': 'fos_user_registration_register'}}) }}
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'registration.submit'|trans }}" />
</div>
{{ form_end(form) }}
{% extends "@FOSUser/layout.html.twig" %}
{% trans_default_domain 'FOSUserBundle' %}
{% block fos_user_content %}
<p>
{{ 'resetting.check_email'|trans({'%tokenLifetime%': tokenLifetime})|nl2br }}
</p>
{% endblock %}
{% trans_default_domain 'FOSUserBundle' %}
{% block subject %}
{%- autoescape false -%}
{{ 'resetting.email.subject'|trans({'%username%': user.username}) }}
{%- endautoescape -%}
{% endblock %}
{% block body_text %}
{% autoescape false %}
{{ 'resetting.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}) }}
{% endautoescape %}
{% endblock %}
{% block body_html %}{% endblock %}
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Resetting/request_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
<form action="{{ path('fos_user_resetting_send_email') }}" method="POST" class="fos_user_resetting_request">
<div>
<label for="username">{{ 'resetting.request.username'|trans }}</label>
<input type="text" id="username" name="username" required="required" />
</div>
<div>
<input type="submit" value="{{ 'resetting.request.submit'|trans }}" />
</div>
</form>
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{% include "@FOSUser/Resetting/reset_content.html.twig" %}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
{{ form_start(form, { 'action': path('fos_user_resetting_reset', {'token': token}), 'attr': { 'class': 'fos_user_resetting_reset' } }) }}
{{ form_widget(form) }}
<div>
<input type="submit" value="{{ 'resetting.reset.submit'|trans }}" />
</div>
{{ form_end(form) }}
{# MLC : Overwrite fos user template for login #}
{% extends 'common/layout.html.twig' %}
{% block content %}
<div class='container homepage'>
<div class='row'>
<div class='col-1'>
<div class='col-0 col-md-1'>
</div>
<div class='col-10 text-center'>
<div class='col-12 col-md-10 text-center'>
<div class="card my-4 mx-4">
<div class="card-header">{{'Se connecter'|trans}}</div>
<div class="card-body">
<div class="card-text mx-auto">
{% include 'common/login.html.twig' %}
</div>
<div class='col-1'>
</div>
</div>
</div>
<div class='col-0 col-md-1'>
</div>
</div>
</div>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
</head>
<body>
<div>
{% if is_granted("IS_AUTHENTICATED_REMEMBERED") %}
{{ 'layout.logged_in_as'|trans({'%username%': app.user.username}, 'FOSUserBundle') }} |
<a href="{{ path('fos_user_security_logout') }}">
{{ 'layout.logout'|trans({}, 'FOSUserBundle') }}
</a>
{% else %}
<a href="{{ path('fos_user_security_login') }}">{{ 'layout.login'|trans({}, 'FOSUserBundle') }}</a>
{% endif %}
</div>
{% if app.request.hasPreviousSession %}
{% for type, messages in app.session.flashbag.all() %}
{% for message in messages %}
<div class="flash-{{ type }}">
{{ message }}
</div>
{% endfor %}
{% endfor %}
{% endif %}
<div>
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
</body>
</html>
......@@ -8,7 +8,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{{title|default('mlc_title'|trans) }}</title>
<title>{{title|default(parameter('mlc_title')) }}</title>
<meta name="description" content="{{ description|default('mlc_description'|trans) }}" />
<meta name="keywords" content="{{ keywords|default('mlc_keywords'|trans) }}" />
<meta name="author" content="{{ 'mlc_author'|trans }}">
......@@ -33,7 +33,6 @@
</head>
<body>
{% include 'common/flash-messages.html.twig' %}
{% include 'common/modale_choix_groupe.html.twig' %}
<!-- HEADER -->
......@@ -43,6 +42,7 @@
<!-- CONTAINER -->
<div class="container">
{% include 'common/flash-messages.html.twig' %}
{% block content %}
<!-- CONTENT -->
{% endblock content %}
......
<div class="card my-4 mx-4">
<div class="card-header">{{'Se connecter'|trans}}</div>
<div class="card-body">
<div class="card-text mx-auto">
{% trans_default_domain 'FOSUserBundle' %}
{% if error %}
{% trans_default_domain 'FOSUserBundle' %}
{% if error is defined and error %}
<div>{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
{% endif %}
<form action="{{ path("fos_user_security_check") }}" method="post">
<form action="{{ path("fos_user_security_check") }}" method="post">
{% if csrf_token %}
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />
{% endif %}
......@@ -17,7 +12,7 @@
<label for="username">{{ 'security.login.username'|trans }} :</label>
</div>
<div class='col-6 text-left'>
<input type="text" id="username" name="_username" value="{{ last_username }}" required="required" autocomplete="username" />
<input type="text" id="username" name="_username" value="{{ last_username is defined ? last_username : '' }}" required="required" autocomplete="username" />
</div>
</div>
<div class='row'>
......@@ -39,7 +34,4 @@
<input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans }}" />
</div>
</div>
</form>
</div>
</div>
</div>
\ No newline at end of file
</form>
\ No newline at end of file
......@@ -18,7 +18,13 @@
<div class='col-12 order-3 order-md-3 col-md-3'>
{% block colonne_droite %}
{% if app.user is null %}
<a class='btn btn-secondary w-100 mb-4' title='{{'Se connecter'|trans}}' href="{{path('fos_user_security_login')}}">{{'Se connecter'|trans}}</a>
{% set modal_id = 'mlcloginmodal' %}
{% set modal_title = 'Se connecter'|trans %}
{% set modal_content %}
{% include 'common/login.html.twig' %}
{% endset %}
{% include 'block/modal.html.twig' %}
<a class='btn btn-secondary w-100 mb-4' data-toggle="modal" data-target="#{{ modal_id }}" title='{{'Se connecter'|trans}}' href="{{path('fos_user_security_login')}}">{{'Se connecter'|trans}}</a>
{% endif %}
{% include 'common/news.html.twig' %}
{% endblock colonne_droite %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment