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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a3f9f4d11eddf7fad8a75c449636689dfba66d9
|
4
|
+
data.tar.gz: 890ca8262059c87e8ce840f624d2f9285ad834f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d3887b0ccfdaf7a5d2b4b4695b46ca116c30daaba4c060f20e3c3d471484855284d3583deeea240f36bc99c77cbdda9bf8383756e3367d82eb3e4b53aa50d5d
|
7
|
+
data.tar.gz: 6765c3c4ea955032c549810a9568e8c0b5e6bfb03c89bee30d55d833e07ecef7cc5d5d4ba31add1a958a66b31d74aa42fc3044098085b1d88ca683ed4df6ef22
|
data/Gemfile.lock
CHANGED
@@ -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
|
-
|
17
|
-
|
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
|
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
|
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
|
+
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-
|
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
|