forked from bofh/fetsite
login fix
This commit is contained in:
@@ -19,9 +19,24 @@
|
|||||||
if request.referer == sign_in_url
|
if request.referer == sign_in_url
|
||||||
super
|
super
|
||||||
else
|
else
|
||||||
stored_location_for(resource) || request.referer || root_path
|
stored_location_for(resource) || root_path
|
||||||
end
|
end
|
||||||
end^
|
end
|
||||||
|
rescue_from CanCan::AccessDenied do |exception|
|
||||||
|
|
||||||
|
if user_signed_in?
|
||||||
|
flash[:error] = "Not authorized to view this page"
|
||||||
|
session[:user_return_to] = nil
|
||||||
|
redirect_to root_url
|
||||||
|
|
||||||
|
else
|
||||||
|
flash[:error] = "You must first login to view this page"
|
||||||
|
session[:user_return_to] = request.url
|
||||||
|
redirect_to "/users/sign_in"
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
def get_theme
|
def get_theme
|
||||||
if ThemesForRails.available_theme_names.include?(params[:theme])
|
if ThemesForRails.available_theme_names.include?(params[:theme])
|
||||||
params[:theme]
|
params[:theme]
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
<h2>Sign in</h2>
|
<h2>Sign in</h2>
|
||||||
<p id="notice"><%= notice %></p>
|
<p id="notice"><%= notice %></p>
|
||||||
|
<p> <ul class="linklist">
|
||||||
|
<li>
|
||||||
|
<%= link_to ffi1_icon("facebook1") + I18n.t('home.fblogin'), user_omniauth_authorize_path(:facebook) ,class: :linkbox %>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<%= link_to ffi1_icon("academic") + I18n.t('home.login'), user_omniauth_authorize_path(:ldap) ,class: :linkbox %>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</p>
|
||||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||||
<div><%= f.label :email %><br />
|
<div><%= f.label :email %><br />
|
||||||
<%= f.email_field :email, :autofocus => true %></div>
|
<%= f.email_field :email, :autofocus => true %></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user