Provide a helper to point to sign up/in for different configs

This commit is contained in:
Henne Vogelsang 2014-11-12 10:20:53 +01:00
parent 2c98ba9711
commit a9581445f3
2 changed files with 17 additions and 1 deletions

View file

@ -4,7 +4,7 @@ module Admin
def verify_user_admin
if (current_user.nil?)
redirect_to new_user_session_path
redirect_to sign_in_path
return false
end
unless (current_user.has_role? :organizer, :any) || (current_user.has_role? :cfp, :any) ||

View file

@ -211,4 +211,20 @@ module ApplicationHelper
false
end
end
def sign_in_path
if CONFIG['authentication']['ichain']['enabled']
new_user_ichain_session_path
else
new_user_session_path
end
end
def sign_up_path
if CONFIG['authentication']['ichain']['enabled']
new_user_ichain_registration_path
else
new_user_registration_path
end
end
end