Here is the auth system:
---------------------------------------------------------------
class ApplicationController < ActionController::Base
helper :all
include NtlmSystem
private
...
def user_required
if !logged_in?
redirect_to('/login')
end
end
def logged_in?
if session[:logged_in].nil? || session[:logged_in] == :false
return false
end
return true
end
...
end
---------------------------------------------------------------
class UsersController < ApplicationController
before_filter :user_required, :except => :login
def login
samaccountname = request.env['REMOTE_USER']
cookies[:session] = session
if samaccountname.nil?
session[:logged_in] = :false
render :file => "#{RAILS_ROOT}/public/403.html", :layout => false,
:status => 403
return
end
samaccountname.sub!(/OU\\/,"")
@user = User.find(:first,:conditions => ["samaccountname =
?",samaccountname])
if @user.nil?
session[:logged_in] = :false
render :file => "#{RAILS_ROOT}/public/403.html", :layout => false,
:status => 403
return
end
session[:current_user] = samaccountname
session[:user_id] = @user.id
session[:logged_in] = :true
redirect_to session[:http_referer]
end
...
end
---------------------------------------------------------------
For NTLM authentication Mongrel_NTLM plugin used
Could it be problem here?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---