...
 
Commits (6)
......@@ -83,6 +83,8 @@ fos_user:
db_driver: orm
firewall_name: main
user_class: TechnoBundle\Entity\User
group:
group_class: TechnoBundle\Entity\Group
from_email:
address: mat@collectifs.net
sender_name: admin
......@@ -16,21 +16,10 @@ techno:
### fos_userbundle
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
prefix: /user
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
fos_user_group:
resource: "@FOSUserBundle/Resources/config/routing/group.xml"
prefix: /group
......@@ -13,18 +13,20 @@ security:
firewalls:
main:
pattern: ^/
anonymous: true
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
default_target_path: techno_homepage
use_referer : true
csrf_token_generator: security.csrf.token_manager # Use form.csrf_provider instead for Symfony <2.4
logout:
path: fos_user_security_logout
target: fos_user_security_login
anonymous: true
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 }
- { path: ^/asso/, role: ROLE_ADMIN }
<?php
namespace TechnoBundle\Entity;
use FOS\UserBundle\Model\Group as BaseGroup;
use Doctrine\ORM\Mapping as ORM;
/**
* Group
*
* @ORM\Entity
* @ORM\Table(name="fosgroup")
*/
class Group extends BaseGroup
{
/**
* @var int
*
* @ORM\Id
* @ORM\Column(name="id", type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
}
......@@ -22,6 +22,15 @@ class User extends BaseUser
*/
protected $id;
/**
* @ORM\ManyToMany(targetEntity="TechnoBundle\Entity\Group")
* @ORM\JoinTable(name="fosuser_fosgroup",
* joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")}
* )
*/
protected $groups;
/**
* Get id
......
<?php
namespace TechnoBundle\Repository;
/**
* GroupRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class GroupRepository extends \Doctrine\ORM\EntityRepository
{
}
......@@ -4,6 +4,11 @@
Ajouter une Image
{% endblock %}
{% block sidebar %}
{% include '@Techno/Image/sidebar.html.twig' %}
{{ parent() }}
{% endblock %}
{% block content %}
{{ block('breadcrumb') }}
......
......@@ -4,6 +4,11 @@
Galerie
{% endblock %}
{% block sidebar %}
{% include '@Techno/Image/sidebar.html.twig' %}
{{ parent() }}
{% endblock %}
{% block content %}
{{ block('breadcrumb') }}
......
......@@ -4,6 +4,11 @@
Galerie
{% endblock %}
{% block sidebar %}
{% include '@Techno/Image/sidebar.html.twig' %}
{{ parent() }}
{% endblock %}
{% block content %}
<div>
......
<h3>Albums</h3>
<ul>
<li class="{{ app.request.get('_route') == 'techno_gallery_create' ? 'active' }}">
<a href="{{ path('techno_gallery_create') }}">
<i class="fas fa-plus"></i> Ajouter une image
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_dump_image' ? 'active' }}">
<a href="{{ path('techno_dump_image') }}">
<i class="fas fa-table"></i> Table Image
</a>
</li>
</ul>
<h3>Auteurs</h3>
<ul>
<li class="{{ app.request.get('_route') == 'techno_owner_read' ? 'active' }}">
<a href="{{ path('techno_owner_read') }}">
<i class="fas fa-users"></i> Les auteurs
</a>
</li>
</ul>
......@@ -4,6 +4,11 @@
Editer une image
{% endblock %}
{% block sidebar %}
{% include '@Techno/Image/sidebar.html.twig' %}
{{ parent() }}
{% endblock %}
{% block content %}
{{ block('breadcrumb') }}
......
......@@ -4,6 +4,11 @@
Ajouter un auteur
{% endblock %}
{% block sidebar %}
{% include '@Techno/Owner/sidebar.html.twig' %}
{{ parent() }}
{% endblock %}
{% block content %}
{{ block('breadcrumb') }}
......
......@@ -4,6 +4,11 @@
Auteurs
{% endblock %}
{% block sidebar %}
{% include '@Techno/Owner/sidebar.html.twig' %}
{{ parent() }}
{% endblock %}
{% block content %}
{{ block('breadcrumb') }}
......
<h3>Auteurs</h3>
<ul>
<li class="{{ app.request.get('_route') == 'techno_owner_read' ? 'active' }}">
<a href="{{ path('techno_owner_read') }}">
<i class="fas fa-users"></i> Les auteurs
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_owner_create' ? 'active' }}">
<a href="{{ path('techno_owner_create') }}">
<i class="fas fa-plus"></i> Ajouter un auteur
</a>
</li>
</ul>
......@@ -4,6 +4,11 @@
Editer un auteur
{% endblock %}
{% block sidebar %}
{% include '@Techno/Owner/sidebar.html.twig' %}
{{ parent() }}
{% endblock %}
{% block content %}
{{ block('breadcrumb') }}
......
{% extends "@FOSUser/layout.html.twig" %}
{% block fos_user_content %}
{{ include('@FOSUser/Security/login_content.html.twig') }}
{% endblock fos_user_content %}
{% trans_default_domain 'FOSUserBundle' %}
{% if error %}
<div>{{ error.messageKey|trans(error.messageData, 'security') }}</div>
{% endif %}
<form action="{{ path("fos_user_security_check") }}" method="post">
{% if csrf_token %}
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />
{% endif %}
<label for="username">{{ 'security.login.username'|trans }}</label>
<input type="text" id="username" name="_username" value="{{ last_username }}" required="required" autocomplete="username" />
<br>
<label for="password">{{ 'security.login.password'|trans }}</label>
<input type="password" id="password" name="_password" required="required" autocomplete="current-password" />
<br>
<input type="checkbox" id="remember_me" name="_remember_me" value="on" />
<label for="remember_me">{{ 'security.login.remember_me'|trans }}</label>
<br>
<input type="submit" id="_submit" name="_submit" value="{{ 'security.login.submit'|trans }}" />
</form>
......@@ -32,33 +32,6 @@
<aside>
{% block sidebar %}
<h3>Albums</h3>
<ul>
<li class="{{ app.request.get('_route') == 'techno_owner_read' ? 'active' }}">
<a href="{{ path('techno_owner_read') }}">
<i class="fas fa-users"></i> Les auteurs
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_dump_image' ? 'active' }}">
<a href="{{ path('techno_dump_image') }}">
<i class="fas fa-table"></i> Table Image
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_gallery_create' ? 'active' }}">
<a href="{{ path('techno_gallery_create') }}">
<i class="fas fa-plus"></i> Ajouter une image
</a>
</li>
<li class="{{ app.request.get('_route') == 'techno_owner_create' ? 'active' }}">
<a href="{{ path('techno_owner_create') }}">
<i class="fas fa-plus"></i> Ajouter un auteur
</a>
</li>
</ul>
<h3>Liens</h3>
<ul>
<li><a href="../../../../0ne/index.php">0ne</a></li>
......