diff options
author | Francis Irving <francis@mysociety.org> | 2010-07-14 14:34:18 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-07-14 14:34:18 +0100 |
commit | ac69b8f9f86b6703fc882119aa04b8707e062dab (patch) | |
tree | 2576fd55e72cc0827edc0279b52a9ed648810a00 /app/controllers/user_controller.rb | |
parent | 3975bcbd9c1c23467a6657f9c8741f49b17e9cc1 (diff) |
Show photo on profile page
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r-- | app/controllers/user_controller.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 277d0cd73..b45b98001 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -378,6 +378,19 @@ class UserController < ApplicationController redirect_to user_url(@user) end + def get_profile_photo + @display_user = User.find(:first, :conditions => [ "url_name = ? and email_confirmed = ?", params[:url_name], true ]) + if !@display_user + raise "user not found, url_name=" + params[:url_name] + end + if !@display_user.profile_photo + raise "user has no profile photo, url_name=" + params[:url_name] + end + + response.content_type = "image/png" + render_for_text(@display_user.profile_photo.data) + end + private # Decide where we are going to redirect back to after signin/signup, and record that |