aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/user_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/user_controller.rb')
-rw-r--r--app/controllers/user_controller.rb13
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