From 532a21ba4941197a13524ac3f1ce9267a46bec1d Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Mon, 25 Feb 2013 17:25:59 +1100 Subject: Update to new mail sending API --- app/controllers/user_controller.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'app/controllers/user_controller.rb') diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 4ee527bae..d20308937 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -288,7 +288,7 @@ class UserController < ApplicationController post_redirect.user = user_signchangepassword post_redirect.save! url = confirm_url(:email_token => post_redirect.email_token) - UserMailer.deliver_confirm_login(user_signchangepassword, post_redirect.reason_params, url) + UserMailer.confirm_login(user_signchangepassword, post_redirect.reason_params, url).deliver else # User not found, but still show confirm page to not leak fact user exists end @@ -352,7 +352,7 @@ class UserController < ApplicationController # if new email already in use, send email there saying what happened user_alreadyexists = User.find_user_by_email(@signchangeemail.new_email) if user_alreadyexists - UserMailer.deliver_changeemail_already_used(@user.email, @signchangeemail.new_email) + UserMailer.changeemail_already_used(@user.email, @signchangeemail.new_email).deliver # it is important this screen looks the same as the one below, so # you can't change to someone's email in order to tell if they are # registered with that email on the site @@ -373,7 +373,7 @@ class UserController < ApplicationController post_redirect.save! url = confirm_url(:email_token => post_redirect.email_token) - UserMailer.deliver_changeemail_confirm(@user, @signchangeemail.new_email, url) + UserMailer.changeemail_confirm(@user, @signchangeemail.new_email, url).deliver # it is important this screen looks the same as the one above, so # you can't change to someone's email in order to tell if they are # registered with that email on the site @@ -419,13 +419,13 @@ class UserController < ApplicationController params[:contact][:email] = @user.email @contact = ContactValidator.new(params[:contact]) if @contact.valid? - ContactMailer.deliver_user_message( + ContactMailer.user_message( @user, @recipient_user, main_url(user_url(@user)), params[:contact][:subject], params[:contact][:message] - ) + ).deliver flash[:notice] = _("Your message to {{recipient_user_name}} has been sent!",:recipient_user_name=>CGI.escapeHTML(@recipient_user.name)) redirect_to user_url(@recipient_user) return @@ -631,7 +631,7 @@ class UserController < ApplicationController post_redirect.save! url = confirm_url(:email_token => post_redirect.email_token) - UserMailer.deliver_confirm_login(user, post_redirect.reason_params, url) + UserMailer.confirm_login(user, post_redirect.reason_params, url).deliver render :action => 'confirm' end @@ -642,7 +642,7 @@ class UserController < ApplicationController post_redirect.save! url = confirm_url(:email_token => post_redirect.email_token) - UserMailer.deliver_already_registered(user, post_redirect.reason_params, url) + UserMailer.already_registered(user, post_redirect.reason_params, url).deliver render :action => 'confirm' # must be same as for send_confirmation_mail above to avoid leak of presence of email in db end -- cgit v1.2.3 From 835b51c1de0d49e652fe9c9a60f0974275de070c Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Wed, 27 Feb 2013 10:34:47 +1100 Subject: Rename ALL THE TEMPLATES!!1!!!one!!1!! .rhtml is deprecated in favour of .erb in Rails 3 --- app/controllers/user_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/controllers/user_controller.rb') diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index d20308937..80c27ffd4 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -222,7 +222,7 @@ class UserController < ApplicationController post_redirect = PostRedirect.find_by_email_token(params[:email_token]) if post_redirect.nil? - render :template => 'user/bad_token.rhtml' + render :template => 'user/bad_token' return end @@ -465,7 +465,7 @@ class UserController < ApplicationController @draft_profile_photo = ProfilePhoto.new(:data => file_content, :draft => true) if !@draft_profile_photo.valid? # error page (uses @profile_photo's error fields in view to show errors) - render :template => 'user/set_draft_profile_photo.rhtml' + render :template => 'user/set_draft_profile_photo' return end @draft_profile_photo.save @@ -480,7 +480,7 @@ class UserController < ApplicationController return end - render :template => 'user/set_crop_profile_photo.rhtml' + render :template => 'user/set_crop_profile_photo' return elsif !params[:submitted_crop_profile_photo].nil? # crop the draft photo according to jquery parameters and set it as the users photo @@ -499,7 +499,7 @@ class UserController < ApplicationController redirect_to set_profile_about_me_url() end else - render :template => 'user/set_draft_profile_photo.rhtml' + render :template => 'user/set_draft_profile_photo' end end -- cgit v1.2.3 From cbdff06aa95a7987b54c712dc6729e138f608eca Mon Sep 17 00:00:00 2001 From: Henare Degan Date: Sun, 3 Mar 2013 14:52:30 +1100 Subject: Rename Configuration class to avoid conflict with ActiveSupport::Configurable --- app/controllers/user_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/user_controller.rb') diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 80c27ffd4..c1f9661b7 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -136,7 +136,7 @@ class UserController < ApplicationController # Login form def signin work_out_post_redirect - @request_from_foreign_country = country_from_ip != Configuration::iso_country_code + @request_from_foreign_country = country_from_ip != AlaveteliConfiguration::iso_country_code # make sure we have cookies if session.instance_variable_get(:@dbman) if not session.instance_variable_get(:@dbman).instance_variable_get(:@original) @@ -190,7 +190,7 @@ class UserController < ApplicationController # Create new account form def signup work_out_post_redirect - @request_from_foreign_country = country_from_ip != Configuration::iso_country_code + @request_from_foreign_country = country_from_ip != AlaveteliConfiguration::iso_country_code # Make the user and try to save it @user_signup = User.new(params[:user_signup]) error = false -- cgit v1.2.3 From 44ec166b8691743e0ffbcc108eaf41ab0d2ef3cd Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Tue, 26 Mar 2013 09:47:06 +1100 Subject: Change email address in header of source code to hello@mysociety.org --- app/controllers/user_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/controllers/user_controller.rb') diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 658daeeff..dca3cda17 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -2,7 +2,7 @@ # Show information about a user. # # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. -# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# Email: hello@mysociety.org; WWW: http://www.mysociety.org/ require 'set' -- cgit v1.2.3 From 155d574baea76526f468db79943050ae18cb416a Mon Sep 17 00:00:00 2001 From: Mark Longair Date: Tue, 28 May 2013 16:45:55 +0100 Subject: Replace 'render_for_text data' with 'render :text => data' render_for_text no longer exists in Rails 3. Fixes #955 --- app/controllers/user_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/controllers/user_controller.rb') diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index dca3cda17..b7912b528 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -527,7 +527,7 @@ class UserController < ApplicationController def get_draft_profile_photo profile_photo = ProfilePhoto.find(params[:id]) response.content_type = "image/png" - render_for_text(profile_photo.data) + render :text => profile_photo.data end # actual profile photo of a user @@ -542,7 +542,7 @@ class UserController < ApplicationController end response.content_type = "image/png" - render_for_text(@display_user.profile_photo.data) + render :text => @display_user.profile_photo.data end # Change about me text on your profile page -- cgit v1.2.3