search for: login_required

Displaying 20 results from an estimated 99 matches for "login_required".

2006 Jan 29
3
SHLG and lib dir
Slowly figuring out how to get my SaltedHashLoginGenerator stuff working. The wiki page says to put "before_filter :login_required" in the user (my "user" is "member") controller or in ApplicationController. However, wherever I put it I get NoMethodError. The rest of the SHLG stuff seems to be working... or at least I could get to the signup page, register, and confirm my registration from the email...
2005 Aug 17
4
Stop an action ?
...group of users with specific rights). For that purpose, I need to exit the action inside this method because it redirects to a login page if that person isn''t authentified. The only way I found on to do this is : class ArticlesController < ApplicationController def edit if not login_required("users") return false end ..... end end Is there a better way to do so, like calling something similar to exit() inside the login_required method ?
2006 Dec 11
0
auth_generator 2.0.1 undefined method `login_required' for ... ArticlesController
I am a relative RubNub and attempting to implement auth_generator v.2.0.1. I am getting an "undefined method `login_required'' for #<ArticlesController:0xb732c0b4>" error when I attempt... http://localhost:3000/articles/new Help would be appreciated. My app/controllers/application.rb reads... ------------------------------------------------------------------------ require ''auth_system'...
2007 Jul 30
6
Object.stubs doesn''t seem to work.
Hi I''m using Mocha 0.5.3 and I want to stub out a call to Time.now, just like the example in the post http://blog.floehopper.org/articles/2007/06/08/mocha-0-5-released However, trying it in irb gets me the following error: >> require ''mocha'' => true >> Time.stubs(:now).returns(Time.parse(''Thu Feb 01 00:00:00 UTC 2007'')) NoMethodError:
2006 Feb 27
3
Send parameter along with method in before_filter
Hello list, I have an app that has a very simple authorization scheme. A person can have many roles and roles can have many people. In my app, I''d like to do before_filter :login_required (since no role name is provided, it accepts any users with credentials) before_filter :login_required ("administrator") (only accepts those with role administrator) before_filter :login_required {"administrator", "buyer", "seller"} (accepts those with roles...
2007 Aug 15
4
nuby: how spec redirect_to at ApplicationController
Good morning rspec people! Still rspec nuby: I must do something wrong obviously. How can I spec about redirect_to at ApplicationController describe ApplicationController do it "method login_required should redirect to home path without login" do pending "I tried to use controller.login_required.should be_redirected and got NoMethodError with nil object didn''t expect error." end end class ApplicationController < ActionController::Base # using it wit...
2010 May 27
3
before_filter always running in test, not in development or production mode.
I''m using Shoulda and restful_authentication on Rails3 and whenever I run my tests a before filter for login_required is always triggered, despite my filter being set up as: before_filter :login_required, :only => [:update, :edit, :suspend, :unsuspend, :destroy, :purge] My test is this: context ''A guest to the site'' do context ''on GET to :show'' do setup { get...
2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
...allow nonbobs # def authorized? # current_user.login != "bob" # end def authorized? logged_in? end # Filter method to enforce a login requirement. # # To require logins for all actions, use this in your controllers: # # before_filter :login_required # # To require logins for specific actions, use this in your controllers: # # before_filter :login_required, :only => [ :edit, :update ] # # To skip this in a subclassed controller: # # skip_before_filter :login_required # def login_required auth...
2006 Apr 03
3
SaltedHashLoginGenerator Verification Trouble
Hello all, Any help with this one is MUCH appreciated. I am running Ruby 1.84 and Rails 1.1.0 on Win32 with a local SMTP server. I can successfully send a signup confirmation email with a confirmation link, but when I click on the link, it says that I am logged in, but it never verifies the account. This is the link provided by the system:
2011 Mar 30
3
Test errors in fuctional test after adding before_filter :login_required to controller
...executing the tests with rake test, I get different error messages. To show you my errors, I only executed the unit controller test with the following line: ruby -Itest test/functional/units_controller_test.rb I get the folowing errors: IN THE ATTACHED FILE If I delete the "before_filter :login_required" line from the unit controller, the test will be executed without any errors. I have a controller_authentication.rb file within my /lib directory. The content of the file: IN THE ATTACHED FILE Can I use one of the methods to get access for the tests? I tried to find a solution for that pro...
2007 Oct 15
0
Fwd: Content filtered message notification
...a-developer at rubyforge.org Date: Sun, 14 Oct 2007 18:15:09 +0200 Subject: Re: [mocha-developer] Stubbing a module method le 03/10/2007 10:40, James Mead nous a dit: On 27/09/2007, Christophe <anaema_ml at yahoo.fr> <anaema_ml at yahoo.fr> wrote: Hi, I''m trying to stub the login_required() method of the acts_as_authenticated plugin in an RoR integration test. This method is defined in the AuthenticatedSystem module, in the lib/authenticated_system.rb What happen is that the stub have no effect and the real method is still executed. Here is the code. Any idea ? Thank you requi...
2009 Mar 05
4
before_filter :action_name OR :action_name
Hi there I am wondering if we can use before_filter in the form of :action OR :action what i want to do is to implement one of the actions, if the first failed, then go to the second when i use before_filter :action1 before_filter :action2 each method will run them, my case is that i want to check if one of them is true and not both any idea?
2008 May 06
12
Why before_filter is not working?
I have been scratching my head on this one for most of the day. Hopefully someone can help explain why before_filter isn''t working for my codes. In my Application controller, I have this: before_filter :login_required, :except => [:newacct, :create_newacct, :passwd_reset ] def login_required unless session[:user_id] flash[:notice] = "Please log in" redirect_to new_session_url end end I have the passwd_reset method defined in my Users controller. My intention is if I call the...
2006 May 17
0
class filter: cannot call protected controller methods
...ting a filter from the method form to a class filter.(see below) Problem: some controller - redirect_to - and route - *_url - methods are protected (redirect_to, f.ex.), and cannot be called. Is this intended? Is there a solution workaround? TIA Alain BEFORE: ----------- before_filter :login_required, :except => [:welcome,:login] def login_required unless current_user session[:jumpto] = request.parameters redirect_to login_invite_url end end AFTER (does not compile) ----------- class AuthenticationFilter def self.filter(controll...
2009 Jul 25
3
Rails Authorization and Security question
Working through the Users and Authentication of Learning Rails book (great book, code needs to be proof-read in a few cases, though), I came across this: There''s still one leftover that may be worth addressing, depending on your security needs. The authorization? method has secured the data, and the view no longer shows the user options they can''t really use, but if a
2007 Jun 27
5
Filter Ordering in Edge Rails (Rev 7143)
...than Rails 1.2.x. It seems that I''m getting a lot of errors along the lines of: ActionController::ActionControllerError: filter #<ActionController::Filters::ClassMethods::BeforeFilterProxy:0x322f468 @filter=#<ActionController::Filters::ClassMethods::SymbolFilter: 0x322f4b8 @filter=:login_required>> was in the wrong place! This isn''t very helpful. How are you guys hunting down the problems with your filter ordering? James H. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:...
2006 Aug 02
12
Authenticate with an IP address : LoginGenerator
Is there a way to authenticate with an IP address? I''m using the LoginGenerator, but would like to bypass the "before_filter :login_required " if a user is in a correct IP range... Anyone know of a solution? Thanks! -- Posted via http://www.ruby-forum.com/.
2006 Oct 09
1
restful authentication - filtering out login ??
i am unable to reach the login page when adding ''before_filter :login_required'' to the application controller. I HAVE added the following to my sessions controller ''before_filter :login_required, :except => [:new, :create, :destroy]'' I figured this would overload the app controller filter but i get this loop while it looks for sessions/new and...
2006 Feb 20
6
LoginGenerator - multiple user types...
I have been looking at the LoginGenerator gem. Looks great and can be easily modified. However in my app I have two places where people can login, one is for in my case "employees" the other is for "users". They are seperate tables in my database and have many different fields. I have an admin area located at ./sysadmin/ where only "employees" can login, they
2008 Jun 13
3
before_filter order of execution
...trying to use before_filter to allow access to a site. Only logged in users can view any object in the controller, but only users with a access_level higher than 2 can view specific objects. My code is: ----------------------------------------------------------- IN USER_CONTROLLER before_filter :login_required before_filter :access_granted, :only => [:destroy, :new , :edit] IN APPLICATION.RB def logged_in? ! @current_user.blank? end helper_method :logged_in? def login_required return true if logged_in? session[:return_to] = request.request_uri redirect_to :controller => &...