From 9347cd046340651e2a878bb39152c17c6e57247d Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Fri, 29 Nov 2013 13:06:36 +0800 Subject: [PATCH] Rake task for confirming and approving existing users --- Gemfile | 1 - config/environments/production.rb | 5 ++--- config/routes.rb | 2 +- lib/tasks/confirm_and_approve_users.rake | 6 ++++++ 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 lib/tasks/confirm_and_approve_users.rake diff --git a/Gemfile b/Gemfile index fc32055b..54f32939 100644 --- a/Gemfile +++ b/Gemfile @@ -19,7 +19,6 @@ gem 'time_difference' gem "acts_as_unvlogable" gem 'youtube_it' gem 'gotcha' -gem 'tlsmail' # gem "memcached", "~> 1.4.3" # gem "memcache-client" diff --git a/config/environments/production.rb b/config/environments/production.rb index e3c44cf0..4eae9ed2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,3 @@ -require 'tlsmail' Orbit::Application.configure do # Settings specified here will take precednece over those in config/application.rb @@ -61,12 +60,12 @@ Orbit::Application.configure do # Send deprecation notices to registered listeners config.active_support.deprecation = :notify - Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE) config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true - config.action_mailer.raise_delivery_errors = false + config.action_mailer.raise_delivery_errors = true config.action_mailer.smtp_settings = { :enable_starttls_auto => true, + :openssl_verify_mode => 'none', :address => "http://smtp.gmail.com", :port => '587', :domain => "new.tp.rulingcom.com", diff --git a/config/routes.rb b/config/routes.rb index 20da690c..0c7e99d3 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -3,7 +3,7 @@ Orbit::Application.routes.draw do # get "robots.txt" => 'robots#index' - devise_for :users, :controllers => { :registrations => "registrations" } do + devise_for :users, :controllers => { :registrations => "registrations", :confirmations => 'confirmations' } do match "/users_passwd" => "desktop/registrations#update", :as => :users_passwd, :via => :put end diff --git a/lib/tasks/confirm_and_approve_users.rake b/lib/tasks/confirm_and_approve_users.rake new file mode 100644 index 00000000..6322a4a0 --- /dev/null +++ b/lib/tasks/confirm_and_approve_users.rake @@ -0,0 +1,6 @@ +namespace :confirm_and_approve do + task :existing_users => :environment do + users = User.update_all({:confirmation_token => nil, :confirmed_at => Time.now, :approved => true}) + puts "Users Updated" + end +end \ No newline at end of file