trusty-rad-social-extension 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6948a734a3af4e80830004359ec3434756b1848
4
- data.tar.gz: a127cd55ac2c8137f397fd203ab520b182218aac
3
+ metadata.gz: 3a3f9f4d11eddf7fad8a75c449636689dfba66d9
4
+ data.tar.gz: 890ca8262059c87e8ce840f624d2f9285ad834f4
5
5
  SHA512:
6
- metadata.gz: a571a15d32b402aea5053b8f7dca5cc85f785b2c11522f0a06bab95524d8a9a596912f7d8ce3ff6cdaee9d7b99b9799431503c413123ddc5f7e30d736b42cc47
7
- data.tar.gz: aae83662b3cd7a8c9c7f28fa50cb59eca8cf06aac7670280cf169ecbbc569a8748aa445dd5880dddb04d0342999158db53521a7f0ee847d3a7294daa73ad3670
6
+ metadata.gz: 5d3887b0ccfdaf7a5d2b4b4695b46ca116c30daaba4c060f20e3c3d471484855284d3583deeea240f36bc99c77cbdda9bf8383756e3367d82eb3e4b53aa50d5d
7
+ data.tar.gz: 6765c3c4ea955032c549810a9568e8c0b5e6bfb03c89bee30d55d833e07ecef7cc5d5d4ba31add1a958a66b31d74aa42fc3044098085b1d88ca683ed4df6ef22
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- trusty-rad-social-extension (2.2.4)
4
+ trusty-rad-social-extension (2.2.5)
5
5
  recaptcha (~> 3.0)
6
6
  roadie-rails (~> 1.0.6)
7
7
  trusty-cms (~> 2.0.0)
@@ -1,6 +1,5 @@
1
1
  class SocialMailerController < ApplicationController
2
2
  trusty_layout "default", {:only => :create_social_mail}
3
- before_filter RadCaptchaFilter, :only => :create_social_mail
4
3
  no_login_required
5
4
 
6
5
  def create_social_mail
@@ -13,8 +12,12 @@ class SocialMailerController < ApplicationController
13
12
  :subject => params[:subject]
14
13
  }
15
14
 
16
- RadSocialMailer.social_mail(mailer_options).deliver_now
17
- head :ok
15
+ if verify_recaptcha
16
+ RadSocialMailer.social_mail(mailer_options).deliver_now
17
+ head :ok
18
+ else
19
+ head :bad_request, :ErrorMsg => "Please verify that you are not a robot. Tick the reCAPTCHA checkbox."
20
+ end
18
21
 
19
22
  end
20
23
 
@@ -33,9 +33,7 @@
33
33
  %input{:type=>"hidden", :name=>"subject", :value=> email_subject}
34
34
  %input{:type=>"hidden", :id=>"rs-base-message", :value=> email_message}
35
35
  #recaptcha-container.captcha-container
36
- = recaptcha_tags :public_key => Rails.configuration.captcha_public_key, :display => {:theme => 'clean'}
37
- #recaptcha_image
38
- #recaptcha_response_field{:name => 'recaptcha_response_field'}
36
+ = recaptcha_tags
39
37
  %input{:type=>"hidden", :name=>"submit_url", :value=> email_action_url}
40
38
  %input.button.primary-button{:id => "rad_email_submit", :type=>:button ,:value=>"Submit"}
41
39
  .loader
@@ -1,5 +1,5 @@
1
1
  module TrustyRadSocialExtension
2
- VERSION = "2.2.4"
2
+ VERSION = "2.2.5"
3
3
  SUMMARY = "Rad Social for Trusty CMS"
4
4
  DESCRIPTION = "Makes Trusty CMS better by adding rad_social!"
5
5
  URL = "http://example.com/rad_social"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty-rad-social-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Sipple, Brittany Martin, Danielle Greaves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-06 00:00:00.000000000 Z
11
+ date: 2016-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: recaptcha
@@ -94,7 +94,6 @@ files:
94
94
  - app/assets/javascripts/lib/rad_social/rad_email_validator.js
95
95
  - app/assets/javascripts/lib/rad_social/rad_widget.js
96
96
  - app/assets/stylesheets/rad_social/rad_screen.scss
97
- - app/controllers/rad_captcha_filter.rb
98
97
  - app/controllers/social_mailer_controller.rb
99
98
  - app/helpers/rad_social_helper.rb
100
99
  - app/models/rad_social_mailer.rb
@@ -1,26 +0,0 @@
1
- require 'recaptcha'
2
-
3
- class RadCaptchaFilter
4
-
5
- def initialize controller
6
- @controller = controller
7
- end
8
-
9
- def self.before controller
10
- RadCaptchaFilter.new(controller).verify
11
- end
12
-
13
- def verify
14
- unless verify_captcha
15
- @controller.send :head, :bad_request, :ErrorMsg => "The security code that you entered does not match the one in the image. Please enter the security code again."
16
- end
17
- end
18
-
19
- private
20
-
21
- def verify_captcha
22
- @controller.extend Recaptcha::Verify
23
- @controller.verify_recaptcha(:private_key => Rails.configuration.captcha_private_key)
24
- end
25
-
26
- end