... | ... |
@@ -1,18 +1,15 @@ |
1 | 1 |
class ApplicationController < ActionController::Base |
2 |
- #protect_from_forgery |
|
3 | 2 |
|
4 | 3 |
before_filter :require_login |
5 | 4 |
|
6 | 5 |
def require_login |
7 |
- #if controller_name == 'sessions' && action_name == 'new' |
|
8 |
- # true |
|
9 |
- #end |
|
10 |
- |
|
11 | 6 |
if authenticated? |
12 | 7 |
create_new_authentification() |
13 | 8 |
else |
14 |
- #create_new_authentification() |
|
15 |
- #Redirect to login page |
|
9 |
+ unless controller_name == 'sessions' && (action_name == 'new' || action_name == 'create') |
|
10 |
+ flash.now[:error] = I18n.t 'login.access-denied' |
|
11 |
+ render "sessions/new" |
|
12 |
+ end |
|
16 | 13 |
end |
17 | 14 |
end |
18 | 15 |
|