diff options
author | Louise Crow <louise.crow@gmail.com> | 2011-05-16 14:54:39 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2011-05-16 15:00:32 +0100 |
commit | cb67f4d0ef9feae96a90ea5bba63c939268b1224 (patch) | |
tree | 1563c5d338fb04ef661a75b21c4023b3678a343f /lib/tasks/temp.rake | |
parent | 17a2daab9d11c01f5da7208a310f5afe4e8e72cf (diff) |
Don't store passwords in post_params.
Diffstat (limited to 'lib/tasks/temp.rake')
-rw-r--r-- | lib/tasks/temp.rake | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/tasks/temp.rake b/lib/tasks/temp.rake new file mode 100644 index 000000000..ce04c7ddd --- /dev/null +++ b/lib/tasks/temp.rake @@ -0,0 +1,15 @@ +namespace :temp do + + desc "Remove plaintext passwords from post_redirect params" + task :remove_post_redirect_passwords => :environment do + PostRedirect.find_each(:conditions => ['post_params_yaml is not null']) do |post_redirect| + if post_redirect.post_params && post_redirect.post_params[:signchangeemail] && post_redirect.post_params[:signchangeemail][:password] + params = post_redirect.post_params + params[:signchangeemail].delete(:password) + post_redirect.post_params = params + post_redirect.save! + end + end + end + +end |