Commit 1b78e916 authored by Mat's avatar Mat

Merge branch 'master' into paginate

parents 19963210 4209708d
......@@ -21,6 +21,7 @@ class AppKernel extends Kernel
new APIBundle\APIBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
new FOS\UserBundle\FOSUserBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
......
......@@ -9,11 +9,11 @@ imports:
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
locale: en
locale: fr
framework:
#esi: ~
#translator: { fallbacks: ['%locale%'] }
translator: { fallbacks: ['%locale%'] }
secret: '%secret%'
router:
resource: '%kernel.project_dir%/app/config/routing.yml'
......@@ -33,8 +33,8 @@ framework:
assets: ~
php_errors:
log: true
# templating:
# engines: [ twig ]
templating:
engines: [ twig ]
# Twig Configuration
twig:
......@@ -77,3 +77,12 @@ fos_js_routing:
- api_owner_*
- api_image_*
- api_membre_*
# FOSUserBundle Configuration
fos_user:
db_driver: orm
firewall_name: main
user_class: TechnoBundle\Entity\User
from_email:
address: mat@collectifs.net
sender_name: admin
fos_js_routing:
resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
api:
resource: "@APIBundle/Resources/config/routing.yml"
prefix: /API/v1
......@@ -12,3 +12,25 @@ asso:
techno:
resource: "@TechnoBundle/Resources/config/routing.yml"
prefix: /techno
### fos_userbundle
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /profile
fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /register
fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /resetting
fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /profile
# To get started with security, check out the documentation:
# https://symfony.com/doc/current/security.html
security:
encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: ROLE_ADMIN
# https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
providers:
in_memory:
memory: ~
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
anonymous: ~
# activate different ways to authenticate
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
#http_basic: ~
pattern: ^/
form_login:
provider: fos_userbundle
csrf_token_generator: security.csrf.token_manager # Use form.csrf_provider instead for Symfony <2.4
login_path: fos_user_security_login
check_path: fos_user_security_check
logout:
path: fos_user_security_logout
target: fos_user_security_login
anonymous: true
# https://symfony.com/doc/current/security/form_login_setup.html
#form_login: ~
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin/, role: ROLE_ADMIN }
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "497196b1a309623619011eb58a446e34",
"content-hash": "5cebd51aebb688c541b393278db55859",
"packages": [
{
"name": "composer/ca-bundle",
......@@ -948,6 +948,82 @@
],
"time": "2018-02-07T20:08:48+00:00"
},
{
"name": "friendsofsymfony/user-bundle",
"version": "v2.1.2",
"source": {
"type": "git",
"url": "https://github.com/FriendsOfSymfony/FOSUserBundle.git",
"reference": "1049935edd24ec305cc6cfde1875372fa9600446"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/FriendsOfSymfony/FOSUserBundle/zipball/1049935edd24ec305cc6cfde1875372fa9600446",
"reference": "1049935edd24ec305cc6cfde1875372fa9600446",
"shasum": ""
},
"require": {
"paragonie/random_compat": "^1 || ^2",
"php": "^5.5.9 || ^7.0",
"symfony/form": "^2.8 || ^3.0 || ^4.0",
"symfony/framework-bundle": "^2.8 || ^3.0 || ^4.0",
"symfony/security-bundle": "^2.8 || ^3.0 || ^4.0",
"symfony/templating": "^2.8 || ^3.0 || ^4.0",
"symfony/twig-bundle": "^2.8 || ^3.0 || ^4.0",
"symfony/validator": "^2.8 || ^3.0 || ^4.0",
"twig/twig": "^1.28 || ^2.0"
},
"conflict": {
"doctrine/doctrine-bundle": "<1.3",
"symfony/doctrine-bridge": "<2.7"
},
"require-dev": {
"doctrine/doctrine-bundle": "^1.3",
"friendsofphp/php-cs-fixer": "^2.2",
"phpunit/phpunit": "^4.8.35|^5.7.11|^6.5",
"swiftmailer/swiftmailer": "^4.3 || ^5.0 || ^6.0",
"symfony/console": "^2.8 || ^3.0 || ^4.0",
"symfony/phpunit-bridge": "^2.8 || ^3.0 || ^4.0",
"symfony/yaml": "^2.8 || ^3.0 || ^4.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.1.x-dev"
}
},
"autoload": {
"psr-4": {
"FOS\\UserBundle\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Christophe Coevoet",
"email": "stof@notk.org"
},
{
"name": "FriendsOfSymfony Community",
"homepage": "https://github.com/friendsofsymfony/FOSUserBundle/contributors"
},
{
"name": "Thibault Duplessis"
}
],
"description": "Symfony FOSUserBundle",
"homepage": "http://friendsofsymfony.github.com",
"keywords": [
"User management"
],
"time": "2018-03-08T08:59:27+00:00"
},
{
"name": "incenteev/composer-parameter-handler",
"version": "v2.1.3",
......
<?php
namespace TechnoBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use FOS\UserBundle\Model\User as BaseUser;
/**
* User
*
* @ORM\Table(name="fosuser")
* @ORM\Entity(repositoryClass="TechnoBundle\Repository\UserRepository")
*/
class User extends BaseUser
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* Get id
*
* @return int
*/
public function getId()
{
return $this->id;
}
}
<?php
namespace TechnoBundle\Repository;
/**
* UserRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class UserRepository extends \Doctrine\ORM\EntityRepository
{
}
<a href="http://mathieu.actic.be">Tchama</a> 2018 —
propulsé par <a href="https://symfony.com/doc/current/index.html" target="_blank">Symfony 3</a>
habillé avec <a href="https://twig.symfony.com/doc/2.x/" target="_blank">Twig</a>
{{ 'now'|date('U') }}
<a href="{{ path('asso_association_read')}}">Admin Asso</a>
<div id="login">
{% 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> |
<a href="{{ path('fos_user_registration_register') }}">
{{ 'layout.register'|trans({}, 'FOSUserBundle') }}
</a>
{% endif %}
</div>
<nav id="mainnav">
<ul>
<li class="{{ app.request.get('_route') == 'techno_homepage' ? 'active' }}">
<a href="{{ path('techno_homepage') }}">
Accueil
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_hello' ? 'active' }}">
<a href="{{ path('techno_hello', {'name': "Emile"}) }}">
Hello
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_gallery_read' ? 'active' }}">
<a href="{{ path('techno_gallery_read') }}">
Galerie
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_owner_main_display' ? 'active' }}">
<a href="{{ path('techno_owner_main_display') }}">
Ajax
</a>
</li>
</ul>
</nav>
......@@ -10,7 +10,7 @@
<h1>{{ block('title') }}</h1>
{% for label, messages in app.flashes({'success', 'warning', 'errors'}) %}
{% for label, messages in app.flashes() %}
{% for message in messages %}
<div class="flash-{{ label }}">
{{ message }}
......
......@@ -11,38 +11,18 @@
{% block layout %}
<header id="header">
<div class="container">
{% block header %}
{% include '@Techno/Default/login.html.twig' %}
<div class="accueil">
<h1>cassis</h1>
<h3>la dernière chance du moment</h3>
</div>
<nav id="mainnav">
<ul>
<li class="{{ app.request.get('_route') == 'techno_homepage' ? 'active' }}">
<a href="{{ path('techno_homepage') }}">
Accueil
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_hello' ? 'active' }}">
<a href="{{ path('techno_hello', {'name': "Emile"}) }}">
Hello
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_gallery_read' ? 'active' }}">
<a href="{{ path('techno_gallery_read') }}">
Galerie
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_owner_main_display' ? 'active' }}">
<a href="{{ path('techno_owner_main_display') }}">
Ajax
</a>
</li>
</ul>
</nav>
{% endblock %}
{% include '@Techno/Default/navbar.html.twig' %}
{% endblock %}
</div>
</header>
<div id="content">
......@@ -82,8 +62,6 @@
<h3>Liens</h3>
<ul>
<li><a href="../../../../0ne/index.php">0ne</a></li>
<li><a href="#">bam</a></li>
<li><a href="#">boum</a></li>
</ul>
{% endblock %}
......@@ -102,6 +80,23 @@
<h1>{{ block('title') }}</h1>
<div class="foslogin">
{% 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 %}
{% block fos_user_content %}
{% endblock fos_user_content %}
</div>
{% endblock %}
</section>
......@@ -115,15 +110,11 @@
<footer id="footer">
<div class="container">
{% block footer %}
<a href="http://mathieu.actic.be">Tchama</a> 2018 —
propulsé par <a href="https://symfony.com/doc/current/index.html" target="_blank">Symfony 3</a>
habillé avec <a href="https://twig.symfony.com/doc/2.x/" target="_blank">Twig</a>
{{ 'now'|date('U') }}
<a href="{{ path('asso_association_read')}}">Admin Asso</a>
{% endblock %}
{% include '@Techno/Default/footer.html.twig' %}
{% endblock %}
</div>
</footer>
......
......@@ -6,4 +6,8 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
class TechnoBundle extends Bundle
{
public function getParent()
{
return 'FOSUserBundle';
}
}
......@@ -104,7 +104,12 @@ div.container {
#header .container {
padding-bottom: 1px;
min-height: 120px;
position: relative;
}
#header .container #login {
position: absolute;
top: 1em;
right: 3em;
}
#hero .container {
padding: 0;
......
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