diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/application.rb | 4 | ||||
-rw-r--r-- | app/controllers/user_controller.rb | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/application.rb b/app/controllers/application.rb index f518a89e9..af3f8de1b 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: application.rb,v 1.29 2008-02-27 12:04:10 francis Exp $ +# $Id: application.rb,v 1.30 2008-02-27 12:18:28 francis Exp $ class ApplicationController < ActionController::Base @@ -44,7 +44,7 @@ class ApplicationController < ActionController::Base def authenticated_as_user?(user, reason_params) reason_params[:user_name] = user.name - reason_params[:user_url] = show_user_url(:simple_name => MySociety::Format.simplify_url_part(user.name)) + reason_params[:user_url] = show_user_url(:url_name => user.url_name) if session[:user_id] if session[:user_id] == user.id # They are logged in as the right user diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 8dc056167..2c10db6f8 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,16 +4,16 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user_controller.rb,v 1.27 2008-02-27 12:04:10 francis Exp $ +# $Id: user_controller.rb,v 1.28 2008-02-27 12:18:28 francis Exp $ class UserController < ApplicationController # XXX See controllers/application.rb simplify_url_part for reverse of expression in SQL below def show - if MySociety::Format.simplify_url_part(params[:simple_name]) != params[:simple_name] - redirect_to :simple_name => MySociety::Format.simplify_url_part(params[:simple_name]) + if MySociety::Format.simplify_url_part(params[:url_name]) != params[:url_name] + redirect_to :url_name => MySociety::Format.simplify_url_part(params[:url_name]) end - @display_users = User.find(:all, :conditions => [ "regexp_replace(replace(lower(name), ' ', '-'), '[^a-z0-9_-]', '', 'g') = ?", params[:simple_name] ], :order => "created_at desc") + @display_users = User.find(:all, :conditions => [ "url_name = ?", params[:url_name] ], :order => "created_at desc") end # Login form |