Allow login through link in message (and remember requested page).
This commit is contained in:
parent
03f61668aa
commit
2f02f89089
3 changed files with 6 additions and 3 deletions
|
@ -25,7 +25,8 @@ class ApplicationController < ActionController::Base
|
||||||
helper_method :current_user
|
helper_method :current_user
|
||||||
|
|
||||||
def deny_access
|
def deny_access
|
||||||
redirect_to root_url, :alert => I18n.t('application.controller.error_denied')
|
session[:return_to] = request.original_url
|
||||||
|
redirect_to root_url, alert: I18n.t('application.controller.error_denied', sign_in: ActionController::Base.helpers.link_to(t('application.controller.error_denied_sign_in'), login_path))
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -274,7 +274,8 @@ de:
|
||||||
application:
|
application:
|
||||||
controller:
|
controller:
|
||||||
error_authn: Anmeldung erforderlich!
|
error_authn: Anmeldung erforderlich!
|
||||||
error_denied: Kein Zugriff!
|
error_denied: Du darfst die gewünschte Seite nicht sehen. Wenn Du denkst, dass Du dürfen solltest, frage eine Administratorin, dass sie Dir die entsprechenden Rechte einräumt. Falls Du Zugang zu mehreren Benutzerkonten hast, möchtest Du Dich vielleicht %{sign_in}.
|
||||||
|
error_denied_sign_in: als ein anderer Benutzer anmelden
|
||||||
error_members_only: Diese Aktion ist nur für Mitglieder der Gruppe erlaubt!
|
error_members_only: Diese Aktion ist nur für Mitglieder der Gruppe erlaubt!
|
||||||
article_categories:
|
article_categories:
|
||||||
create:
|
create:
|
||||||
|
|
|
@ -274,7 +274,8 @@ en:
|
||||||
application:
|
application:
|
||||||
controller:
|
controller:
|
||||||
error_authn: Authentication required!
|
error_authn: Authentication required!
|
||||||
error_denied: Access denied!
|
error_denied: You are not allowed to view the requested page. If you think you should, ask an administrator to give you appropriate permissions. If you have access to multiple user accounts, you might want to %{sign_in}.
|
||||||
|
error_denied_sign_in: sign in as another user
|
||||||
error_members_only: This action is only available to members of the group!
|
error_members_only: This action is only available to members of the group!
|
||||||
article_categories:
|
article_categories:
|
||||||
create:
|
create:
|
||||||
|
|
Loading…
Reference in a new issue