search for: check_authentication

Displaying 15 results from an estimated 15 matches for "check_authentication".

2006 May 16
2
before_filter and the application controller
...er I''d like to allow access to the RSS feed method in a ''member'' controller and skip the login checks that the before_filters are currently performing. In my application my filters look like this: class ApplicationController < ActionController::Base before_filter :check_authentication, :except => [:check_authentication] before_filter :register_member_activity, :except => [:check_authentication] def check_authentication unless session[:member_id] session[:intended_uri] = @request.request_uri redirect_to :controller => ''logi...
2006 Jun 04
5
filter function with parameter
Hi! I want to add a function with a static paramter ("2" in the example) to a filter, but somehow Rails seems to be looking for another syntax. before_filter :check_quantity(2), :only => [:show] doesn''t work. What''s the right way to do this? Thanks a lot! -- Posted via http://www.ruby-forum.com/.
2008 Oct 03
2
Filter chain halted as [:check_authentication] rendered_or_r
...iated with Travel Managers who get tossed out, apprarently when they hit a before_filter to check authenication. However, it seams that they are properly getting authenticated and moved along correctly in the grand scheme of things before they are kicked. I get this error: Filter chain halted as [:check_authentication] rendered_or_redirected. I recently upgraded to rails 2.1.0 and only after I did that did I start to see this error. Before this was a non-issue. Anyone have this experience and how do I fix it? Thanks, -S -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--...
2006 Jul 07
13
Rails Recipes Book: Authentication
Hi, The user/login management system in Chapter 31: Authenticating Your Users and Chapter 32: Authorizing Users with Roles of Chad Fowler''s Rails Recipes looks reasonable and adequate. However, when I ran the Chapter 31 code, I get the following error: Username or password invalid And I am not even given the chance to sign in; that is, the signin form does not appear at all. Has
2006 Apr 21
1
Catch authentication result from a model in a controller
...user.blank? || Digest::SHA256.hexdigest(password + user.password_salt) != user.password_hash raise "user or password wrong" end user end end #controller--------------------------------------------- class AdminController < ApplicationController before_filter :check_authentication, :except => [:signin_form, :signin] def index render "admin" end def check_authentication unless session[:user] session[:intended_action] = action_name redirect_to :action => "signin_form" end end def signin_form render "login_form" end def signin...
2006 May 19
0
No luck with multiple before_filters
I''ve got these two lines set up in my controller before_filter :check_authentication before_filter :check_max_hands, :only => [ :play ] Here''s the corresponding code for each def check_authentication unless session[:user] and authorize?(session[:user]) session[:intended_action] = request.request_uri redirect_to :controller => ''user'&...
2006 Nov 04
3
role based authorization question
...ll not work as is, and to force it to do so would violate MVC, but is there some other way to accomplish having something like this in a controller: loggedin=false; if session[:user] Applicant.find(session[:user]).roles.each{|r| loggedin=true if r.name== "admin"} end skip_before_filter :check_authentication, :check_authorization if loggedin Thanks, Howard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060824/92154834/attachment-0001.html
2006 Jun 30
8
before_filter: nil vs. true vs. false
Folks, My understanding of how filters work is that I should return true if everything is ok and false if not. How does the filter below work then (from the Rails Recipies book)? It would return nil if there''s a user in the session. Does nil count as true? before_filter :check_authentication def check_authentication unless session[:user] session[:intended_action] = action_name session[:intended_controller] = controller_name redirect_to :action => "signin" end end Thanks, Joel -- http://wagerlabs.com/
2006 Apr 27
7
Role Based Authorization recipe implementation?
i got the rails recipes book, i have now an auth system for users without problems, now i want to made a role based acces for my app, im following the "Role Based Authorization" recipe of the book but i cant make it to work even when the tables created and correctly added data manually definig the roles and rights. als i dont know how to define a right for use all the actions in a
2006 Aug 07
2
Ugggh..another recipes question
sorry, because it seems that I need more explanation on this Rails Recipes authorization - I finally got the code working but after using the login I get this back from Rails- Routing Error No url can be generated for the hash {} I''m guessing it''s coming from the redirect- def login if request.post? session[:user] = User.authenticate(params[:first_name],
2006 Dec 01
0
You are being redirected message
Ticket #3082 details a fix to add a body to redirect pages. This seems like an old patch, but only now is it biting me. I have an authentication scheme like this: class ApplicationController < ActionController::Base before_filter :check_authentication, :except => [:signin] def check_authentication return true if session[:user] session[:return_to] = request.request_uri if request.request_uri !~ /login/ redirect_to(:controller => ''admin'', :action => ''signin'') # **** return...
2007 Jan 21
0
Functional Test Fails with before filter in application.rb
...nd missedsomething? Thanks. THE TEST: in user_contorller_test.rb def test_index_without_user get :index assert_response :redirect assert_redirected_to :action => "login" assert_equal "Please login", flash[:notice] end in application.rb before_filter :check_authentication, :check_authorization, :except => [:login] def check_authentication unless session[:user] flash[:notice] = "Please login" redirect_to :controller => :user, :action => :login return false end end -- Posted via http:...
2007 Jul 17
12
Getting past my login system
Thank you in advance for your help. I am relatively new to both Rails and Rspec and I am hoping for some insight from some experienced veterans. Right now I am using Rspec for code that has already been written so that additional functionality can be developed using the BDD method. My problem shows up when I try to spec controllers that are behind the login system. Each page checks for the
2006 Nov 04
0
Having problems with edge rails
I just switched to Edge Rails (revision 5207) since I want to use the BigDecimal support for an e-commerce website.. Unfortunately, some of my old code seems to be breaking things.. First off, it looks like my "skip_before_filter :check_authentication, :check_authorization, :only => [:login, :forgot_password]" doesn''t work at all, since the before_filter gets executed for every action, including :login and :forgot_password. Also, when I try doing something simple in a view such as: <%= text_field :model_name, :attribute_nam...
2008 Jan 14
0
Controoler/View problem
...site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 One thing that i don''t understant is why is running the show method if the url that i put was "http://127.0.0.1:3000/logins/signin" Another problem with this it that when I use before_filter "check_authentication, :except => :signin", I have try to put this line in the ApplicationController and in LoginsControllers, or in both, but the results are the same. Any help will be appreciate it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to t...