Skip to content
This repository was archived by the owner on Dec 5, 2019. It is now read-only.

Commit f9ef4aa

Browse files
committed
finalization of to edit the content
1 parent d40573d commit f9ef4aa

File tree

4 files changed

+42
-1
lines changed

4 files changed

+42
-1
lines changed

app/config/routing.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,13 @@ create:
77
resource: "@SymfonyCmfCreateBundle/Resources/config/routing/rest.xml"
88
create_image:
99
resource: "@SymfonyCmfCreateBundle/Resources/config/routing/image.xml"
10+
11+
_logout:
12+
pattern: /logout
13+
14+
_logout:
15+
pattern: /login
16+
defaults:
17+
_controller: FrameworkBundle:Redirect:urlRedirect
18+
path: /
19+
permanent: true

app/config/security.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@ security:
55
anonymous: ~
66
http_basic:
77
realm: "Acess to the content editing of the website"
8+
logout:
9+
path: /logout
10+
target: /
11+
invalidate_session: true
812

913
access_control:
10-
- { path: ^/news, roles: ROLE_EDITOR }
14+
- { path: ^/login, roles: ROLE_EDITOR }
1115

1216
providers:
1317
my_chain_provider:

src/Cmf/MainBundle/Resources/public/css/style.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,26 @@ input.button {
250250
color: #fff;
251251
}
252252

253+
254+
/* login-info */
255+
#login-info {
256+
position: absolute;
257+
margin: 0;
258+
padding: 10px 15px 8px 15px;
259+
background: #333;
260+
font-family: 'Trebuchet MS', Arial, Sans-serif;
261+
color: #FFF;
262+
263+
bottom: 0px; right: 70px
264+
}
265+
#login-info p {
266+
margin: 0; padding: 0;
267+
}
268+
#login-info a {
269+
font-weight: bold;
270+
color: #fff;
271+
}
272+
253273
/* Navigation */
254274
#nav {
255275
clear: both;

src/Cmf/MainBundle/Resources/views/layout.html.twig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
<div id="top-menu">
2929
<p><a href="http://www.symfony.com" target="_BLANK">Symfony2</a> + <a href="http://www.doctrine-project.org/projects/orm/2.0/docs/en" target="_BLANK">Doctrine2</a></p>
3030
</div>
31+
32+
{% if is_granted('ROLE_EDITOR') %}
33+
<div id="login-info">
34+
<p>Logged in as: {{ app.user.username }} - <a href="{{path('_logout')}}">Logout</a></p>
35+
</div>
36+
{% endif %}
37+
3138
</div>
3239

3340
<div id="nav">

0 commit comments

Comments
 (0)