Re: UserEngine Infinite Loop (Scott Walter)

Hi

I also experienced the same issue yesterday. is it has anything to do
with store_location ?

Thanks

Things to do when you ‘upgrade’ from the login engine to the user
engine:

  1. make SURE that you read the README properly. In particular, the
    before_filter will change.
  2. make sure that you’ve run the engine_migrate and bootstrap rake
    tasks, so that you get the new tables and more importantly the
    guest/default user permissions!
  3. bear in mind that any users you have created will NOT automatically
    be given roles, so they essentially will have no permissions at all.
    You’ll want to get creative solving that issue. A patch for the
    UserEngine rakefile which ‘upgrades’ existing users by assigning them
    all a particular Role will guarantee you a seat in Valhalla!
  4. remove all sessions, just to be really clean about things.

In general, if you are finding that you get constantly redirected to
the login page in an infinite loop, it means that you don’t have
permission to get to it. This is either because:

a) the Guest role that the UserEngine assumes for all non-logged-in
users doesn’t exist or doesn’t have the right permissions (there’s a
handy UserEngine.check_system_roles method that can help you there)
b) the user that you are logged in as doesn’t have any role which has
permission for the login action.

Either way, it basically means your Roles setup is s-k-rewed and you
need to check that you’ve followed all the steps. Again, a simple rake
task (rake upgrade_to_user_engine ??) might easily be written to take
care of all these issues. The Norse Gods will welcome anyone brave
enough to write this (or even create the Trac ticket such that I might
get around to it).

james

On 2/7/06, Rajesh GS [email protected] wrote:

trying to redirect to /user/login until Firefox decides to stop trying.

  • → /user/login

engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

  • J *
    ~

Hello,

I also had the same problem half an hour ago, when trying to add the
UserEngine to the RikiEngine. And I was quite confident that I did
everything correctly according to the README, as I saw the database
populated as it was supposed to. Here is what my problem was, and how I
solved it:

So, the problem was the same: The Infinite UserEngine Loop. When I
looked in the log file (they are quite useful, sometimes), I saw the
following:

Processing PagesController#login (for 127.0.0.1 at 2006-02-16 21:03:13)
[GET]
Parameters: {“action”=>“login”, “controller”=>“pages”,
“book_url_name”=>“user”}
required_perm is pages/login
Permission Load (0.000000) SELECT DISTINCT permissions.*
FROM permissions, roles,
permissions_roles
WHERE roles.name = ‘Guest’
AND roles.id = permissions_roles.role_id
AND permissions_roles.permission_id = permissions.id
AND permissions.controller = ‘pages’
AND permissions.action = ‘login’

so the routing gets completely messed up, taking url/user/login, as the
name of a book. So by just adding the following:

map.connect ‘user/login’, :controller => ‘user’, :action => “login”

in the beginning of my routes.rb, I solved my problem.

Hope this is helpful,

Bart

Hello again,

In fact, you will have to do this for all the user related routes, like
user/show/#, and user/edit_user/# etc, or it will get confused with the
other routes you might have. Maybe James could sum a list of all
possible routes for the UserEngine, and put it as an EXAMPLE_Routes.rb
in the distribution. Just like with the WikiEngine, and RikiEngine…

have fun,

Bart

Oops, me again, sorry

Or what you also could write in routes.rb, to cover most (if not all?)
cases is \

map.connect ‘user/:action/:id’, :controller => ‘user’

Won’t bother again :wink:

Bart

In Bart’s case it was because his routes were grabbing the url
parameters and not passing them to the appopriate controller, and his
last post describes an adequate fix. Engine or not, every controller
would have to be explicitly ‘noted’ in the routes file to avoid being
interprettetd as a ‘book_url_name’ parameter.

So - it’s not really a bug in the engine. It’s the fact that you have
a set of routes which supercedes the typical :controller/:action/:id
default in such a complete way that ANY controller needs to be handled
as a special case. Perhaps the Riki/Wiki engine route documentation
might be clearer about this, and I’m sure that patches to such
documentation will be greatly appreciated.

  • james

On 2/16/06, Ryan T. [email protected] wrote:

This infinite loop happened to me too. It’s clearly a bug in the
engine. If you want to wall off people from /login by default, that’s
fine, if strange. But then don’t redirect them there if they don’t
have permissions.


engine-users mailing list
[email protected]
http://lists.rails-engines.org/listinfo.cgi/engine-users-rails-engines.org

  • J *
    ~

This infinite loop happened to me too. It’s clearly a bug in the
engine. If you want to wall off people from /login by default, that’s
fine, if strange. But then don’t redirect them there if they don’t
have permissions.