This repository was archived by the owner on Dec 5, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +42
-1
lines changed
src/Cmf/MainBundle/Resources Expand file tree Collapse file tree 4 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 7
7
resource : " @SymfonyCmfCreateBundle/Resources/config/routing/rest.xml"
8
8
create_image :
9
9
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
Original file line number Diff line number Diff line change @@ -5,9 +5,13 @@ security:
5
5
anonymous : ~
6
6
http_basic :
7
7
realm : " Acess to the content editing of the website"
8
+ logout :
9
+ path : /logout
10
+ target : /
11
+ invalidate_session : true
8
12
9
13
access_control :
10
- - { path: ^/news , roles: ROLE_EDITOR }
14
+ - { path: ^/login , roles: ROLE_EDITOR }
11
15
12
16
providers :
13
17
my_chain_provider :
Original file line number Diff line number Diff line change @@ -250,6 +250,26 @@ input.button {
250
250
color : # fff ;
251
251
}
252
252
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
+
253
273
/* Navigation */
254
274
# nav {
255
275
clear : both;
Original file line number Diff line number Diff line change 28
28
<div id =" top-menu" >
29
29
<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 >
30
30
</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
+
31
38
</div >
32
39
33
40
<div id =" nav" >
You can’t perform that action at this time.
0 commit comments