+ def confirm_email
+ if params[:confirm_action]
+ token = UserToken.find_by_token(params[:confirm_string])
+ if token and token.user.new_email?
+ @user = token.user
+ @user.email = @user.new_email
+ @user.new_email = nil
+ @user.active = true
+ @user.email_valid = true
+ @user.save!
+ token.destroy
+ flash[:notice] = 'Confirmed your email address, thanks for signing up!'
+ session[:user] = @user.id
+ redirect_to :action => 'account', :display_name => @user.display_name
+ else
+ @notice = 'Something went wrong confirming that email address.'
+ end
+ end
+ end
+
+ def upload_image
+ @user.image = params[:user][:image]
+ @user.save!
+ redirect_to :controller => 'user', :action => 'view', :display_name => @user.display_name
+ end
+
+ def delete_image
+ @user.image = nil
+ @user.save!
+ redirect_to :controller => 'user', :action => 'view', :display_name => @user.display_name
+ end
+