Studioforty9_Recaptcha - Version 1.5.0

Version Notes

Tested on Magento versions: 1.7.0.2, 1.8.0.0, 1.8.1.0, 1.9.0.1, 1.9.1.0 and 1.9.2.4. See https://travis-ci.org/StudioForty9/Recaptcha for more.

Download this release

Release Info

Developer StudioForty9
Extension Studioforty9_Recaptcha
Version 1.5.0
Comparing to
See all releases


Code changes from version 1.3.0 to 1.5.0

Files changed (28) hide show
  1. app/code/community/Studioforty9/Recaptcha/Block/Autorender.php +0 -75
  2. app/code/community/Studioforty9/Recaptcha/Block/Explicit.php +24 -15
  3. app/code/community/Studioforty9/Recaptcha/Helper/Data.php +43 -81
  4. app/code/community/Studioforty9/Recaptcha/Helper/Redirect.php +123 -0
  5. app/code/community/Studioforty9/Recaptcha/Helper/Request.php +6 -5
  6. app/code/community/Studioforty9/Recaptcha/Helper/Response.php +5 -2
  7. app/code/community/Studioforty9/Recaptcha/Model/Observer.php +79 -55
  8. app/code/community/Studioforty9/Recaptcha/Model/Routes.php +107 -0
  9. app/code/community/Studioforty9/Recaptcha/Model/Source/Routes.php +44 -0
  10. app/code/community/Studioforty9/Recaptcha/Model/Source/Size.php +36 -0
  11. app/code/community/Studioforty9/Recaptcha/Model/Source/Theme.php +3 -14
  12. app/code/community/Studioforty9/Recaptcha/Model/Source/Type.php +36 -0
  13. app/code/community/Studioforty9/Recaptcha/data/studioforty9_recaptcha_setup/data-upgrade-1.2.0-1.5.0.php +12 -0
  14. app/code/community/Studioforty9/Recaptcha/etc/config.xml +38 -13
  15. app/code/community/Studioforty9/Recaptcha/etc/system.xml +41 -38
  16. app/design/frontend/base/default/layout/studioforty9_recaptcha.xml +20 -2
  17. app/design/frontend/base/default/template/studioforty9/recaptcha/autorender.phtml +0 -21
  18. app/design/frontend/base/default/template/studioforty9/recaptcha/explicit.phtml +11 -9
  19. app/design/frontend/base/default/template/studioforty9/recaptcha/samples/base/contacts/form.phtml +0 -61
  20. app/design/frontend/base/default/template/studioforty9/recaptcha/samples/base/persistent/customer/form/register.phtml +0 -180
  21. app/design/frontend/base/default/template/studioforty9/recaptcha/samples/base/review/form.phtml +0 -120
  22. app/design/frontend/base/default/template/studioforty9/recaptcha/samples/base/sendfriend/send.phtml +0 -131
  23. app/design/frontend/base/default/template/studioforty9/recaptcha/samples/rwd/contacts/form.phtml +0 -74
  24. app/design/frontend/base/default/template/studioforty9/recaptcha/samples/rwd/customer/form/register.phtml +0 -189
  25. app/design/frontend/base/default/template/studioforty9/recaptcha/samples/rwd/review/form.phtml +0 -166
  26. app/design/frontend/base/default/template/studioforty9/recaptcha/samples/rwd/sendfriend/send.phtml +0 -144
  27. app/etc/modules/Studioforty9_Recaptcha.xml +1 -1
  28. package.xml +6 -6
app/code/community/Studioforty9/Recaptcha/Block/Autorender.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
- /**
3
- * Studioforty9_Recaptcha
4
- *
5
- * @category Studioforty9
6
- * @package Studioforty9_Recaptcha
7
- * @author StudioForty9 <info@studioforty9.com>
8
- * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
- * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
- * @link https://github.com/studioforty9/recaptcha
12
- */
13
-
14
- /**
15
- * Studioforty9_Recaptcha_Block_Autorender
16
- *
17
- * @category Studioforty9
18
- * @package Studioforty9_Recaptcha
19
- * @subpackage Block
20
- */
21
- class Studioforty9_Recaptcha_Block_Autorender extends Mage_Core_Block_Template
22
- {
23
- /**
24
- * Get the reCAPTACHA javascript code.
25
- *
26
- * @return string
27
- */
28
- public function getRecaptchaScript()
29
- {
30
- if (! Mage::helper('studioforty9_recaptcha')->isEnabled()) {
31
- return '';
32
- }
33
-
34
- return '<script src="https://www.google.com/recaptcha/api.js"></script>';
35
- }
36
-
37
- /**
38
- * Get the reCAPTCHA html code.
39
- *
40
- * @return string
41
- */
42
- public function getRecaptchaHtml()
43
- {
44
- /** @var Studioforty9_Recaptcha_Helper_Data $helper */
45
- $helper = Mage::helper('studioforty9_recaptcha');
46
-
47
- if (! $helper->isEnabled()) {
48
- return '';
49
- }
50
-
51
- $html = sprintf(
52
- '<div class="g-recaptcha" data-theme="%s" data-sitekey="%s"></div>',
53
- $helper->getTheme(),
54
- $helper->getSiteKey()
55
- );
56
-
57
- return $html;
58
- }
59
-
60
- /**
61
- * Determine if the module configuration settings allow displaying
62
- * the widget in the current context.
63
- *
64
- * @param string $route
65
- * @return bool
66
- */
67
- public function isAllowed($route)
68
- {
69
- if ($this->hasData('allow') && $this->getData('allow')) {
70
- return true;
71
- }
72
-
73
- return Mage::helper('studioforty9_recaptcha')->isAllowed($route);
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Studioforty9/Recaptcha/Block/Explicit.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
@@ -67,10 +67,11 @@ class Studioforty9_Recaptcha_Block_Explicit extends Mage_Core_Block_Template
67
  'uk_UA' => 'uk',
68
  'vi_VN' => 'vi'
69
  );
70
-
71
  /**
72
  * Get the reCAPTACHA javascript code.
73
  *
 
74
  * @return string
75
  */
76
  public function getRecaptchaScript()
@@ -100,9 +101,21 @@ class Studioforty9_Recaptcha_Block_Explicit extends Mage_Core_Block_Template
100
  );
101
  }
102
 
 
 
 
 
 
 
 
 
 
 
 
103
  /**
104
  * Get the recaptcha theme setting.
105
  *
 
106
  * @return string
107
  */
108
  public function getTheme()
@@ -111,28 +124,24 @@ class Studioforty9_Recaptcha_Block_Explicit extends Mage_Core_Block_Template
111
  }
112
 
113
  /**
114
- * Get the recaptcha site key.
115
  *
 
116
  * @return string
117
  */
118
- public function getSiteKey()
119
  {
120
- return Mage::helper('studioforty9_recaptcha')->getSiteKey();
121
  }
122
 
123
  /**
124
- * Determine if the module configuration settings allow displaying
125
- * the widget in the current context.
126
  *
127
- * @param string $route
128
- * @return bool
129
  */
130
- public function isAllowed($route)
131
  {
132
- if ($this->hasData('allow') && $this->getData('allow')) {
133
- return true;
134
- }
135
-
136
- return Mage::helper('studioforty9_recaptcha')->isAllowed($route);
137
  }
138
  }
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
67
  'uk_UA' => 'uk',
68
  'vi_VN' => 'vi'
69
  );
70
+
71
  /**
72
  * Get the reCAPTACHA javascript code.
73
  *
74
+ * @param string $id
75
  * @return string
76
  */
77
  public function getRecaptchaScript()
101
  );
102
  }
103
 
104
+ /**
105
+ * Get the recaptcha site key.
106
+ *
107
+ * @codeCoverageIgnore
108
+ * @return string
109
+ */
110
+ public function getSiteKey()
111
+ {
112
+ return Mage::helper('studioforty9_recaptcha')->getSiteKey();
113
+ }
114
+
115
  /**
116
  * Get the recaptcha theme setting.
117
  *
118
+ * @codeCoverageIgnore
119
  * @return string
120
  */
121
  public function getTheme()
124
  }
125
 
126
  /**
127
+ * Get the recaptcha type setting.
128
  *
129
+ * @codeCoverageIgnore
130
  * @return string
131
  */
132
+ public function getType()
133
  {
134
+ return Mage::helper('studioforty9_recaptcha')->getType();
135
  }
136
 
137
  /**
138
+ * Get the recaptcha size setting.
 
139
  *
140
+ * @codeCoverageIgnore
141
+ * @return string
142
  */
143
+ public function getSize()
144
  {
145
+ return Mage::helper('studioforty9_recaptcha')->getSize();
 
 
 
 
146
  }
147
  }
app/code/community/Studioforty9/Recaptcha/Helper/Data.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
@@ -26,13 +26,12 @@ class Studioforty9_Recaptcha_Helper_Data extends Mage_Core_Helper_Abstract
26
  * @var string
27
  */
28
  const MODULE_ENABLED = 'google/recaptcha/enabled';
29
- const MODULE_ENABLED_CONTACTS = 'google/recaptcha/enabled_contacts';
30
- const MODULE_ENABLED_REVIEWS = 'google/recaptcha/enabled_reviews';
31
- const MODULE_ENABLED_SENDFRIEND = 'google/recaptcha/enabled_sendfriend';
32
- const MODULE_ENABLED_CUSTOMER_REG = 'google/recaptcha/enabled_customer_registration';
33
  const MODULE_KEY_SITE = 'google/recaptcha/site_key';
34
  const MODULE_KEY_SECRET = 'google/recaptcha/secret_key';
35
  const MODULE_KEY_THEME = 'google/recaptcha/theme';
 
 
 
36
  /**#@-*/
37
 
38
  /**
@@ -47,137 +46,100 @@ class Studioforty9_Recaptcha_Helper_Data extends Mage_Core_Helper_Abstract
47
  }
48
 
49
  /**
50
- * Is the recaptcha enabled on the contacts form.
51
- *
52
- * @codeCoverageIgnore
53
- * @return bool
54
- */
55
- public function isContactsEnabled()
56
- {
57
- return Mage::getStoreConfigFlag(self::MODULE_ENABLED_CONTACTS);
58
- }
59
-
60
- /**
61
- * Is the recaptcha enabled on the product review form.
62
  *
63
  * @codeCoverageIgnore
64
- * @return bool
65
  */
66
- public function isReviewsEnabled()
67
  {
68
- return Mage::getStoreConfigFlag(self::MODULE_ENABLED_REVIEWS);
69
  }
70
 
71
  /**
72
- * Is the recaptcha enabled on the product send to friend form.
73
  *
74
  * @codeCoverageIgnore
75
- * @return bool
76
  */
77
- public function isSendFriendEnabled()
78
  {
79
- return Mage::getStoreConfigFlag(self::MODULE_ENABLED_SENDFRIEND);
80
  }
81
 
82
  /**
83
- * Is the recaptcha enabled on the customer registration form.
84
  *
85
  * @codeCoverageIgnore
86
- * @return bool
87
  */
88
- public function isCustomerRegistrationEnabled()
89
  {
90
- return Mage::getStoreConfigFlag(self::MODULE_ENABLED_CUSTOMER_REG);
91
  }
92
 
93
  /**
94
- * The recaptcha site key.
95
  *
96
  * @codeCoverageIgnore
97
  * @return string
98
  */
99
- public function getSiteKey()
100
  {
101
- return Mage::getStoreConfig(self::MODULE_KEY_SITE);
102
  }
103
 
104
  /**
105
- * The recaptcha secret key.
106
  *
107
  * @codeCoverageIgnore
108
  * @return string
109
  */
110
- public function getSecretKey()
111
  {
112
- return Mage::getStoreConfig(self::MODULE_KEY_SECRET);
113
  }
114
 
115
  /**
116
- * The recaptcha widget theme.
117
  *
118
  * @codeCoverageIgnore
119
  * @return string
120
  */
121
- public function getTheme()
122
  {
123
- return Mage::getStoreConfig(self::MODULE_KEY_THEME);
 
 
 
124
  }
125
 
126
  /**
127
- * Get the redirect URL.
128
- * - no visitor_data or last_url stored in core/session
129
- * return the base_url
130
- * - no visitor_data but last_url is stored in core/session
131
- * return the last_url
132
- * - visitor_data exists but request_uri does not, but last_url is stored in core/session
133
- * return the last_url
134
- * - request_uri exists
135
- * return the request_uri
136
  *
137
- * @todo Unit Test this method.
138
- * @return string
 
139
  */
140
- public function getRedirectUrl()
141
  {
142
- /** @var Mage_Core_Model_Session $_session */
143
- $_session = Mage::getSingleton('core/session');
144
-
145
- if (! $_session->hasVisitorData() && !$_session->hasLastUrl()) {
146
- return Mage::getBaseUrl();
147
- }
148
-
149
- if (! $_session->hasVisitorData() && $_session->hasLastUrl()) {
150
- return $_session->getLastUrl();
151
- }
152
-
153
- $visitorData = $_session->getVisitorData();
154
- if (! array_key_exists('request_uri', $visitorData) && $_session->hasLastUrl()) {
155
- return $_session->getLastUrl();
156
  }
157
 
158
- return $visitorData['request_uri'];
159
  }
160
-
161
  /**
162
- * Is the module allowed to run.
163
  *
164
- * @todo Unit Test this method.
165
- * @param string $route
166
  * @return bool
167
  */
168
- public function isAllowed($route)
169
  {
170
- if (! Mage::getConfig()->getModuleConfig("Studioforty9_Recaptcha")->is('active', 'true')) {
171
- return false;
172
- }
173
-
174
- $acl = array(
175
- 'contacts' => $this->isContactsEnabled(),
176
- 'review' => $this->isReviewsEnabled(),
177
- 'customer' => $this->isCustomerRegistrationEnabled(),
178
- 'sendfriend' => $this->isSendFriendEnabled()
179
- );
180
-
181
- return ($this->isEnabled() && array_key_exists($route, $acl) && $acl[$route] === true);
182
  }
183
  }
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
26
  * @var string
27
  */
28
  const MODULE_ENABLED = 'google/recaptcha/enabled';
 
 
 
 
29
  const MODULE_KEY_SITE = 'google/recaptcha/site_key';
30
  const MODULE_KEY_SECRET = 'google/recaptcha/secret_key';
31
  const MODULE_KEY_THEME = 'google/recaptcha/theme';
32
+ const MODULE_KEY_SIZE = 'google/recaptcha/size';
33
+ const MODULE_KEY_TYPE = 'google/recaptcha/type';
34
+ const MODULE_KEY_ROUTES = 'google/recaptcha/enabled_routes';
35
  /**#@-*/
36
 
37
  /**
46
  }
47
 
48
  /**
49
+ * The recaptcha site key.
 
 
 
 
 
 
 
 
 
 
 
50
  *
51
  * @codeCoverageIgnore
52
+ * @return string
53
  */
54
+ public function getSiteKey()
55
  {
56
+ return Mage::getStoreConfig(self::MODULE_KEY_SITE);
57
  }
58
 
59
  /**
60
+ * The recaptcha secret key.
61
  *
62
  * @codeCoverageIgnore
63
+ * @return string
64
  */
65
+ public function getSecretKey()
66
  {
67
+ return Mage::getStoreConfig(self::MODULE_KEY_SECRET);
68
  }
69
 
70
  /**
71
+ * The recaptcha widget theme.
72
  *
73
  * @codeCoverageIgnore
74
+ * @return string
75
  */
76
+ public function getTheme()
77
  {
78
+ return Mage::getStoreConfig(self::MODULE_KEY_THEME);
79
  }
80
 
81
  /**
82
+ * The recaptcha widget type.
83
  *
84
  * @codeCoverageIgnore
85
  * @return string
86
  */
87
+ public function getType()
88
  {
89
+ return Mage::getStoreConfig(self::MODULE_KEY_TYPE);
90
  }
91
 
92
  /**
93
+ * The recaptcha widget size.
94
  *
95
  * @codeCoverageIgnore
96
  * @return string
97
  */
98
+ public function getSize()
99
  {
100
+ return Mage::getStoreConfig(self::MODULE_KEY_SIZE);
101
  }
102
 
103
  /**
104
+ * The enabled routes.
105
  *
106
  * @codeCoverageIgnore
107
  * @return string
108
  */
109
+ public function getEnabledRoutes()
110
  {
111
+ $routes = explode(',', Mage::getStoreConfig(self::MODULE_KEY_ROUTES));
112
+ array_map('strtolower', $routes);
113
+
114
+ return $routes;
115
  }
116
 
117
  /**
118
+ * Is the module allowed to run.
 
 
 
 
 
 
 
 
119
  *
120
+ * @codeCoverageIgnore
121
+ * @param string $route
122
+ * @return bool
123
  */
124
+ public function isAllowed($route)
125
  {
126
+ if (! $this->isModuleActive() || ! $this->isEnabled()) {
127
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
128
  }
129
 
130
+ return in_array(strtolower($route), $this->getEnabledRoutes());
131
  }
132
+
133
  /**
134
+ * Is the module active.
135
  *
136
+ * @codeCoverageIgnore
 
137
  * @return bool
138
  */
139
+ public function isModuleActive()
140
  {
141
+ return Mage::getConfig()
142
+ ->getModuleConfig("Studioforty9_Recaptcha")
143
+ ->is('active', 'true');
 
 
 
 
 
 
 
 
 
144
  }
145
  }
app/code/community/Studioforty9/Recaptcha/Helper/Redirect.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Studioforty9_Recaptcha
4
+ *
5
+ * @category Studioforty9
6
+ * @package Studioforty9_Recaptcha
7
+ * @author StudioForty9 <info@studioforty9.com>
8
+ * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
+ * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
+ * @link https://github.com/studioforty9/recaptcha
12
+ */
13
+
14
+ /**
15
+ * Studioforty9_Recaptcha_Helper_Redirect
16
+ *
17
+ * @category Studioforty9
18
+ * @package Studioforty9_Recaptcha
19
+ * @subpackage Helper
20
+ * @author StudioForty9 <info@studioforty9.com>
21
+ */
22
+ class Studioforty9_Recaptcha_Helper_Redirect extends Mage_Core_Helper_Abstract
23
+ {
24
+ /** @var Mage_Core_Model_Session $_session */
25
+ protected $_session;
26
+
27
+ /**
28
+ * Set the session object.
29
+ *
30
+ * @param Mage_Core_Model_Session $$session
31
+ * @return self
32
+ */
33
+ public function setSession(Mage_Core_Model_Session_Abstract $session)
34
+ {
35
+ $this->_session = $session;
36
+
37
+ return $this;
38
+ }
39
+
40
+ /**
41
+ * Get the session object.
42
+ *
43
+ * @return Mage_Core_Model_Session
44
+ */
45
+ public function getSession()
46
+ {
47
+ if (is_null($this->_session)) {
48
+ $this->_session = Mage::getSingleton('core/session');
49
+ }
50
+
51
+ return $this->_session;
52
+ }
53
+
54
+ /**
55
+ * Get the redirect URL.
56
+ *
57
+ * @return string
58
+ */
59
+ public function getUrl()
60
+ {
61
+ $referer = $this->_getRefererUrl();
62
+
63
+ if (! empty($referer)) {
64
+ return $referer;
65
+ }
66
+
67
+ if ($this->_session->hasLastUrl()) {
68
+ return $this->_session->getLastUrl();
69
+ }
70
+
71
+ return $this->getRequestUri();
72
+ }
73
+
74
+ /**
75
+ * Identify referer url via all accepted methods:
76
+ * - HTTP_REFERER
77
+ * - Regular
78
+ * - base64-encoded request param
79
+ *
80
+ * @return string
81
+ */
82
+ protected function _getRefererUrl()
83
+ {
84
+ $request = Mage::app()->getRequest();
85
+
86
+ $refererUrl = $request->getServer('HTTP_REFERER');
87
+ if ($url = $request->getParam(Mage_Core_Controller_Front_Action::PARAM_NAME_REFERER_URL)) {
88
+ $refererUrl = $url;
89
+ }
90
+ if ($url = $request->getParam(Mage_Core_Controller_Front_Action::PARAM_NAME_BASE64_URL)) {
91
+ $refererUrl = Mage::helper('core')->urlDecode($url);
92
+ }
93
+ if ($url = $request->getParam(Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED)) {
94
+ $refererUrl = Mage::helper('core')->urlDecode($url);
95
+ }
96
+
97
+ return $refererUrl;
98
+ }
99
+
100
+ /**
101
+ * Get the request URI.
102
+ *
103
+ * @param array $visitorData
104
+ * @return bool
105
+ */
106
+ protected function getRequestUri()
107
+ {
108
+ $visitorData = $this->_session->getData('visitor_data');
109
+
110
+ return ($this->hasRequestUri($visitorData)) ? $visitorData['request_uri'] : Mage::getBaseUrl();
111
+ }
112
+
113
+ /**
114
+ * Does the request have a valid request URI.
115
+ *
116
+ * @param array $visitorData
117
+ * @return bool
118
+ */
119
+ protected function hasRequestUri($visitorData)
120
+ {
121
+ return is_array($visitorData) && array_key_exists('request_uri', $visitorData);
122
+ }
123
+ }
app/code/community/Studioforty9/Recaptcha/Helper/Request.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
@@ -39,18 +39,19 @@ class Studioforty9_Recaptcha_Helper_Request extends Mage_Core_Helper_Abstract
39
  public function setHttpClient(Varien_Http_Client $client)
40
  {
41
  $this->_client = $client;
 
42
  return $this;
43
  }
44
 
45
  /**
46
  * Get the Http Client to use for the request to reCAPTCHA
47
  *
48
- * @return Varien_Http_Client
49
  */
50
  public function getHttpClient()
51
  {
52
  if (is_null($this->_client)) {
53
- $this->_client = new Varien_Http_Client();
54
  }
55
 
56
  $this->_client->setUri(self::REQUEST_URL);
@@ -77,14 +78,14 @@ class Studioforty9_Recaptcha_Helper_Request extends Mage_Core_Helper_Abstract
77
 
78
  try {
79
  $response = $client->request('GET');
80
- $body = $response->decodeGzip($response->getRawBody());
81
  $data = Mage::helper('core')->jsonDecode($body);
82
  if (array_key_exists('error-codes', $data)) {
83
  $errors = $data['error-codes'];
84
  }
85
  } catch (Exception $e) {
86
- $data = array('success' => false);
87
  Mage::logException($e);
 
88
  }
89
 
90
  return new Studioforty9_Recaptcha_Helper_Response($data['success'], $errors);
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
39
  public function setHttpClient(Varien_Http_Client $client)
40
  {
41
  $this->_client = $client;
42
+
43
  return $this;
44
  }
45
 
46
  /**
47
  * Get the Http Client to use for the request to reCAPTCHA
48
  *
49
+ * @return Zend_Http_Client
50
  */
51
  public function getHttpClient()
52
  {
53
  if (is_null($this->_client)) {
54
+ $this->_client = new Zend_Http_Client();
55
  }
56
 
57
  $this->_client->setUri(self::REQUEST_URL);
78
 
79
  try {
80
  $response = $client->request('GET');
81
+ $body = $response->getBody();
82
  $data = Mage::helper('core')->jsonDecode($body);
83
  if (array_key_exists('error-codes', $data)) {
84
  $errors = $data['error-codes'];
85
  }
86
  } catch (Exception $e) {
 
87
  Mage::logException($e);
88
+ $data = array('success' => false);
89
  }
90
 
91
  return new Studioforty9_Recaptcha_Helper_Response($data['success'], $errors);
app/code/community/Studioforty9/Recaptcha/Helper/Response.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
@@ -69,6 +69,7 @@ class Studioforty9_Recaptcha_Helper_Response extends Mage_Core_Helper_Abstract
69
  public function setSuccess($success)
70
  {
71
  $this->_success = $success;
 
72
  return $this;
73
  }
74
 
@@ -82,6 +83,7 @@ class Studioforty9_Recaptcha_Helper_Response extends Mage_Core_Helper_Abstract
82
  public function setErrorCodes($errorCodes)
83
  {
84
  $this->_errorCodes = $errorCodes;
 
85
  return $this;
86
  }
87
 
@@ -112,7 +114,7 @@ class Studioforty9_Recaptcha_Helper_Response extends Mage_Core_Helper_Abstract
112
  */
113
  public function hasErrors()
114
  {
115
- return !empty($this->_errorCodes);
116
  }
117
 
118
  /**
@@ -149,6 +151,7 @@ class Studioforty9_Recaptcha_Helper_Response extends Mage_Core_Helper_Abstract
149
  /**
150
  * Log the error to file.
151
  *
 
152
  * @return bool
153
  */
154
  public function log()
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
69
  public function setSuccess($success)
70
  {
71
  $this->_success = $success;
72
+
73
  return $this;
74
  }
75
 
83
  public function setErrorCodes($errorCodes)
84
  {
85
  $this->_errorCodes = $errorCodes;
86
+
87
  return $this;
88
  }
89
 
114
  */
115
  public function hasErrors()
116
  {
117
+ return ! empty($this->_errorCodes);
118
  }
119
 
120
  /**
151
  /**
152
  * Log the error to file.
153
  *
154
+ * @codeCoverageIgnore
155
  * @return bool
156
  */
157
  public function log()
app/code/community/Studioforty9/Recaptcha/Model/Observer.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
@@ -22,74 +22,98 @@
22
  class Studioforty9_Recaptcha_Model_Observer
23
  {
24
  /**
25
- * @var Studioforty9_Recaptcha_Helper_Data
26
- */
27
- protected $_helper;
28
-
29
- /**
30
- * Set the module data helper.
31
- */
32
- public function __construct()
33
- {
34
- $this->_helper = Mage::helper('studioforty9_recaptcha');
35
- }
36
-
37
- /**
38
- * Get the module data helper
39
- *
40
- * @return Studioforty9_Recaptcha_Helper_Data
41
- */
42
- public function getHelper()
43
- {
44
- return $this->_helper;
45
- }
46
-
47
- /**
48
- * Run the event on the pre dispatch observer for:
49
- * - controller_action_predispatch_index_post
50
- * - controller_action_predispatch_review_product_post
51
  *
52
- * @param Varien_Event_Observer $observer The observer from the controller
53
- * @return Varien_Event_Observer|Mage_Core_Controller_Front_Action
54
  */
55
  public function onPostPreDispatch(Varien_Event_Observer $observer)
56
- {
57
- if (! $this->getHelper()->isEnabled()) {
58
- return $observer;
59
- }
60
  /** @var Mage_Core_Controller_Front_Action $controller */
61
  $controller = $observer->getEvent()->getControllerAction();
62
-
63
- if (! $this->getHelper()->isAllowed($controller->getRequest()->getRouteName())) {
64
- return $observer;
65
- }
66
-
67
- /** @var Studioforty9_Recaptcha_Helper_Request $request */
68
- $request = Mage::helper('studioforty9_recaptcha/request');
69
  /** @var Studioforty9_Recaptcha_Helper_Response $response */
70
- $response = $request->verify();
71
-
72
- if ($response->isSuccess()) {
73
- return $observer;
74
- }
75
-
76
  Mage::getSingleton('core/session')->addError(
77
- $response->__(
78
  'There was an error with the recaptcha code, please try again.'
79
  )
80
  );
81
-
82
- if ($response->hasErrors()) {
83
- $response->log();
84
- }
85
-
86
  $flag = Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH;
87
- $redirectUrl = $this->getHelper()->getRedirectUrl();
88
 
89
- $controller->getResponse()->setRedirect($redirectUrl)->sendResponse();
90
  $controller->getRequest()->setDispatched(true);
91
  $controller->setFlag('', $flag, true);
92
-
 
 
 
 
 
 
 
 
 
93
  return $controller;
94
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  }
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
22
  class Studioforty9_Recaptcha_Model_Observer
23
  {
24
  /**
25
+ * Run the event on the pre dispatch observer for a controller action
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  *
27
+ * @param Varien_Event_Observer $observer The dispatched observer
28
+ * @return Mage_Core_Controller_Front_Action
29
  */
30
  public function onPostPreDispatch(Varien_Event_Observer $observer)
31
+ {
32
+ if (! Mage::helper('studioforty9_recaptcha')->isEnabled()) return;
33
+
 
34
  /** @var Mage_Core_Controller_Front_Action $controller */
35
  $controller = $observer->getEvent()->getControllerAction();
36
+ if (! $controller->getRequest()->isPost()) return;
37
+
38
+ $route = $controller->getFullActionName();
39
+ if (! Mage::helper('studioforty9_recaptcha')->isAllowed($route)) return;
40
+
 
 
41
  /** @var Studioforty9_Recaptcha_Helper_Response $response */
42
+ $response = Mage::helper('studioforty9_recaptcha/request')->verify();
43
+ if ($response->isSuccess()) return;
44
+
45
+ /** reCAPTCHA Verification Failed **/
46
+
 
47
  Mage::getSingleton('core/session')->addError(
48
+ Mage::helper('studioforty9_recaptcha')->__(
49
  'There was an error with the recaptcha code, please try again.'
50
  )
51
  );
52
+
 
 
 
 
53
  $flag = Mage_Core_Controller_Varien_Action::FLAG_NO_DISPATCH;
54
+ $redirectUrl = Mage::helper('studioforty9_recaptcha/redirect')->getUrl();
55
 
 
56
  $controller->getRequest()->setDispatched(true);
57
  $controller->setFlag('', $flag, true);
58
+ $controller->getResponse()->setRedirect($redirectUrl);
59
+
60
+ $payload = array(
61
+ 'controller_action' => $controller,
62
+ 'recaptcha_response' => $response
63
+ );
64
+
65
+ Mage::dispatchEvent('studioforty9_recaptcha_failed', $payload);
66
+ Mage::dispatchEvent('studioforty9_recaptcha_failed_' . $route, $payload);
67
+
68
  return $controller;
69
  }
70
+
71
+ /**
72
+ * Run additional logic on a failed recaptcha verification for the review form.
73
+ *
74
+ * @param Varien_Event_Observer $observer The dispatched observer
75
+ * @return Mage_Core_Controller_Front_Action
76
+ */
77
+ public function onFailedRecaptchaProductReview(Varien_Event_Observer $observer)
78
+ {
79
+ $data = $observer->getEvent()->getControllerAction()->getRequest()->getPost();
80
+ Mage::getSingleton('review/session')->setFormData($data);
81
+ }
82
+
83
+ /**
84
+ * Run additional logic on a failed recaptcha verification for the customer registration form.
85
+ *
86
+ * @param Varien_Event_Observer $observer The dispatched observer
87
+ * @return Mage_Core_Controller_Front_Action
88
+ */
89
+ public function onFailedRecaptchaCustomerRegistration(Varien_Event_Observer $observer)
90
+ {
91
+ $data = $observer->getEvent()->getControllerAction()->getRequest()->getPost();
92
+ Mage::getSingleton('customer/session')->setCustomerFormData($data);
93
+ }
94
+
95
+ /**
96
+ * Run additional logic on a failed recaptcha verification for the send to friend form.
97
+ *
98
+ * @param Varien_Event_Observer $observer The dispatched observer
99
+ * @return Mage_Core_Controller_Front_Action
100
+ */
101
+ public function onFailedRecaptchaSendFriend(Varien_Event_Observer $observer)
102
+ {
103
+ $data = $observer->getEvent()->getControllerAction()->getRequest()->getPost();
104
+ Mage::getSingleton('catalog/session')->setSendfriendFormData($data);
105
+ }
106
+
107
+ /**
108
+ * Run additional logic on a failed recaptcha verification for the forgot password form.
109
+ *
110
+ * @param Varien_Event_Observer $observer The dispatched observer
111
+ * @return Mage_Core_Controller_Front_Action
112
+ */
113
+ public function onFailedRecaptchaLogin(Varien_Event_Observer $observer)
114
+ {
115
+ $data = $observer->getEvent()->getControllerAction()->getRequest()->getPost('login');
116
+ $login = isset($data['username']) ? $data['username'] : null;
117
+ Mage::getSingleton('customer/session')->setUsername($login);
118
+ }
119
  }
app/code/community/Studioforty9/Recaptcha/Model/Routes.php ADDED
@@ -0,0 +1,107 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Studioforty9_Recaptcha
4
+ *
5
+ * @category Studioforty9
6
+ * @package Studioforty9_Recaptcha
7
+ * @author StudioForty9 <info@studioforty9.com>
8
+ * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
+ * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
+ * @link https://github.com/studioforty9/recaptcha
12
+ */
13
+
14
+ /**
15
+ * Studioforty9_Recaptcha_Model_Routes
16
+ *
17
+ * @category Studioforty9
18
+ * @package Studioforty9_Recaptcha
19
+ * @subpackage Model
20
+ * @author StudioForty9 <info@studioforty9.com>
21
+ */
22
+ class Studioforty9_Recaptcha_Model_Routes implements Countable
23
+ {
24
+ /** @var array */
25
+ protected $routes = array();
26
+
27
+ /**
28
+ * Add a route.
29
+ *
30
+ * @param string $route
31
+ * @param string $label
32
+ * @return self
33
+ */
34
+ public function add($route, $label)
35
+ {
36
+ $this->routes[$route] = array(
37
+ 'value' => $route,
38
+ 'label' => $label,
39
+ );
40
+
41
+ return $this;
42
+ }
43
+
44
+ /**
45
+ * Remove a route.
46
+ *
47
+ * @param string $route
48
+ * @return self
49
+ */
50
+ public function remove($route)
51
+ {
52
+ if (array_key_exists($route, $this->routes)) {
53
+ unset($this->routes[$route]);
54
+ }
55
+
56
+ return $this;
57
+ }
58
+
59
+ /**
60
+ * Find a route.
61
+ *
62
+ * @param string $route
63
+ * @return array
64
+ */
65
+ public function find($route)
66
+ {
67
+ if (! isset($this->routes[$route])) {
68
+ throw new Exception(
69
+ "$route could not be found or was not allocated."
70
+ );
71
+ }
72
+
73
+ return $this->routes[$route];
74
+ }
75
+
76
+ /**
77
+ * Clear all routes.
78
+ *
79
+ * @return self
80
+ */
81
+ public function clear()
82
+ {
83
+ $this->routes = array();
84
+
85
+ return $this;
86
+ }
87
+
88
+ /**
89
+ * Count the number routes.
90
+ *
91
+ * @return int
92
+ */
93
+ public function count()
94
+ {
95
+ return count($this->routes);
96
+ }
97
+
98
+ /**
99
+ * Cast the object to an array.
100
+ *
101
+ * @return aray
102
+ */
103
+ public function toArray()
104
+ {
105
+ return array_values($this->routes);
106
+ }
107
+ }
app/code/community/Studioforty9/Recaptcha/Model/Source/Routes.php ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Studioforty9_Recaptcha
4
+ *
5
+ * @category Studioforty9
6
+ * @package Studioforty9_Recaptcha
7
+ * @author StudioForty9 <info@studioforty9.com>
8
+ * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
+ * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
+ * @link https://github.com/studioforty9/recaptcha
12
+ */
13
+
14
+ /**
15
+ * Studioforty9_Recaptcha_Model_Source_Theme
16
+ *
17
+ * @category Studioforty9
18
+ * @package Studioforty9_Recaptcha
19
+ * @subpackage Model
20
+ * @author StudioForty9 <info@studioforty9.com>
21
+ */
22
+ class Studioforty9_Recaptcha_Model_Source_Routes
23
+ {
24
+ /**
25
+ * Return the options for setting the theme.
26
+ *
27
+ * @return array
28
+ */
29
+ public function toOptionArray()
30
+ {
31
+ $routes = new Studioforty9_Recaptcha_Model_Routes();
32
+
33
+ $routes->add('contacts_index_post', Mage::helper('studioforty9_recaptcha')->__('Contact Form'));
34
+ $routes->add('review_product_post', Mage::helper('studioforty9_recaptcha')->__('Product Review Form'));
35
+ $routes->add('customer_account_createpost', Mage::helper('studioforty9_recaptcha')->__('Account Registration Form'));
36
+ $routes->add('sendfriend_product_sendmail', Mage::helper('studioforty9_recaptcha')->__('Send to Friend Form'));
37
+ $routes->add('customer_account_loginpost', Mage::helper('studioforty9_recaptcha')->__('Login Form'));
38
+ $routes->add('customer_account_forgotpasswordpost', Mage::helper('studioforty9_recaptcha')->__('Forgot Password Form'));
39
+
40
+ Mage::dispatchEvent('studioforty9_recaptcha_routes', array('routes' => $routes));
41
+
42
+ return $routes->toArray();
43
+ }
44
+ }
app/code/community/Studioforty9/Recaptcha/Model/Source/Size.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Studioforty9_Recaptcha
4
+ *
5
+ * @category Studioforty9
6
+ * @package Studioforty9_Recaptcha
7
+ * @author StudioForty9 <info@studioforty9.com>
8
+ * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
+ * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
+ * @link https://github.com/studioforty9/recaptcha
12
+ */
13
+
14
+ /**
15
+ * Studioforty9_Recaptcha_Model_Source_Size
16
+ *
17
+ * @category Studioforty9
18
+ * @package Studioforty9_Recaptcha
19
+ * @subpackage Model
20
+ * @author StudioForty9 <info@studioforty9.com>
21
+ */
22
+ class Studioforty9_Recaptcha_Model_Source_Size
23
+ {
24
+ /**
25
+ * Return the options for setting the size.
26
+ *
27
+ * @return array
28
+ */
29
+ public function toOptionArray()
30
+ {
31
+ return array(
32
+ 'normal' => Mage::helper('studioforty9_recaptcha')->__('Normal'),
33
+ 'compact' => Mage::helper('studioforty9_recaptcha')->__('Compact')
34
+ );
35
+ }
36
+ }
app/code/community/Studioforty9/Recaptcha/Model/Source/Theme.php CHANGED
@@ -7,7 +7,7 @@
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
@@ -29,19 +29,8 @@ class Studioforty9_Recaptcha_Model_Source_Theme
29
  public function toOptionArray()
30
  {
31
  return array(
32
- 'light' => $this->_getDataHelper()->__('Light'),
33
- 'dark' => $this->_getDataHelper()->__('Dark')
34
  );
35
  }
36
-
37
- /**
38
- * Fetch the data helper for the module.
39
- *
40
- * @codeCoverageIgnore
41
- * @return Studioforty9_Recaptcha_Helper_Data
42
- */
43
- protected function _getDataHelper()
44
- {
45
- return Mage::helper('studioforty9_recaptcha');
46
- }
47
  }
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  */
13
 
29
  public function toOptionArray()
30
  {
31
  return array(
32
+ 'light' => Mage::helper('studioforty9_recaptcha')->__('Light'),
33
+ 'dark' => Mage::helper('studioforty9_recaptcha')->__('Dark')
34
  );
35
  }
 
 
 
 
 
 
 
 
 
 
 
36
  }
app/code/community/Studioforty9/Recaptcha/Model/Source/Type.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Studioforty9_Recaptcha
4
+ *
5
+ * @category Studioforty9
6
+ * @package Studioforty9_Recaptcha
7
+ * @author StudioForty9 <info@studioforty9.com>
8
+ * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
+ * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
+ * @link https://github.com/studioforty9/recaptcha
12
+ */
13
+
14
+ /**
15
+ * Studioforty9_Recaptcha_Model_Source_Type
16
+ *
17
+ * @category Studioforty9
18
+ * @package Studioforty9_Recaptcha
19
+ * @subpackage Model
20
+ * @author StudioForty9 <info@studioforty9.com>
21
+ */
22
+ class Studioforty9_Recaptcha_Model_Source_Type
23
+ {
24
+ /**
25
+ * Return the options for setting the type.
26
+ *
27
+ * @return array
28
+ */
29
+ public function toOptionArray()
30
+ {
31
+ return array(
32
+ 'image' => Mage::helper('studioforty9_recaptcha')->__('Image'),
33
+ 'audio' => Mage::helper('studioforty9_recaptcha')->__('Audio')
34
+ );
35
+ }
36
+ }
app/code/community/Studioforty9/Recaptcha/data/studioforty9_recaptcha_setup/data-upgrade-1.2.0-1.5.0.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $collection = \Mage::getModel('core/config_data')->getCollection()->addFieldToFilter('path', array('in' => array(
4
+ 'google/recaptcha/enabled_contacts',
5
+ 'google/recaptcha/enabled_reviews',
6
+ 'google/recaptcha/enabled_sendfriend',
7
+ 'google/recaptcha/enabled_customer_registration',
8
+ )));
9
+
10
+ foreach ($collection as $model) {
11
+ $model->delete();
12
+ }
app/code/community/Studioforty9/Recaptcha/etc/config.xml CHANGED
@@ -8,14 +8,14 @@
8
  * @author StudioForty9 <info@studioforty9.com>
9
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
10
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
11
- * @version 1.2.0
12
  * @link https://github.com/studioforty9/recaptcha
13
  */
14
  -->
15
  <config>
16
  <modules>
17
  <Studioforty9_Recaptcha>
18
- <version>1.2.0</version>
19
  </Studioforty9_Recaptcha>
20
  </modules>
21
  <global>
@@ -34,6 +34,14 @@
34
  <class>Studioforty9_Recaptcha_Model</class>
35
  </studioforty9_recaptcha>
36
  </models>
 
 
 
 
 
 
 
 
37
  </global>
38
  <frontend>
39
  <layout>
@@ -53,38 +61,54 @@
53
  </modules>
54
  </translate>
55
  <events>
56
- <controller_action_predispatch_contacts_index_post>
57
  <observers>
58
  <studioforty9_recaptcha>
59
  <class>studioforty9_recaptcha/observer</class>
60
  <method>onPostPreDispatch</method>
61
  </studioforty9_recaptcha>
62
  </observers>
63
- </controller_action_predispatch_contacts_index_post>
64
- <controller_action_predispatch_review_product_post>
65
  <observers>
66
  <studioforty9_recaptcha>
67
  <class>studioforty9_recaptcha/observer</class>
68
- <method>onPostPreDispatch</method>
69
  </studioforty9_recaptcha>
70
  </observers>
71
- </controller_action_predispatch_review_product_post>
72
- <controller_action_predispatch_customer_account_createpost>
73
  <observers>
74
  <studioforty9_recaptcha>
75
  <class>studioforty9_recaptcha/observer</class>
76
- <method>onPostPreDispatch</method>
77
  </studioforty9_recaptcha>
78
  </observers>
79
- </controller_action_predispatch_customer_account_createpost>
80
- <controller_action_predispatch_sendfriend_product_sendmail>
81
  <observers>
82
  <studioforty9_recaptcha>
83
  <class>studioforty9_recaptcha/observer</class>
84
- <method>onPostPreDispatch</method>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  </studioforty9_recaptcha>
86
  </observers>
87
- </controller_action_predispatch_sendfriend_product_sendmail>
88
  </events>
89
  </frontend>
90
  <adminhtml>
@@ -123,6 +147,7 @@
123
  <site_key></site_key>
124
  <secret_key></secret_key>
125
  <theme>light</theme>
 
126
  </recaptcha>
127
  </google>
128
  </default>
8
  * @author StudioForty9 <info@studioforty9.com>
9
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
10
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
11
+ * @version 1.5.0
12
  * @link https://github.com/studioforty9/recaptcha
13
  */
14
  -->
15
  <config>
16
  <modules>
17
  <Studioforty9_Recaptcha>
18
+ <version>1.5.0</version>
19
  </Studioforty9_Recaptcha>
20
  </modules>
21
  <global>
34
  <class>Studioforty9_Recaptcha_Model</class>
35
  </studioforty9_recaptcha>
36
  </models>
37
+ <resources>
38
+ <studioforty9_recaptcha_setup>
39
+ <setup>
40
+ <module>Studioforty9_Recaptcha</module>
41
+ <class>Mage_Core_Model_Resource_Setup</class>
42
+ </setup>
43
+ </studioforty9_recaptcha_setup>
44
+ </resources>
45
  </global>
46
  <frontend>
47
  <layout>
61
  </modules>
62
  </translate>
63
  <events>
64
+ <controller_action_predispatch>
65
  <observers>
66
  <studioforty9_recaptcha>
67
  <class>studioforty9_recaptcha/observer</class>
68
  <method>onPostPreDispatch</method>
69
  </studioforty9_recaptcha>
70
  </observers>
71
+ </controller_action_predispatch>
72
+ <studioforty9_recaptcha_failed_review_product_post>
73
  <observers>
74
  <studioforty9_recaptcha>
75
  <class>studioforty9_recaptcha/observer</class>
76
+ <method>onFailedRecaptchaProductReview</method>
77
  </studioforty9_recaptcha>
78
  </observers>
79
+ </studioforty9_recaptcha_failed_review_product_post>
80
+ <studioforty9_recaptcha_failed_customer_account_createpost>
81
  <observers>
82
  <studioforty9_recaptcha>
83
  <class>studioforty9_recaptcha/observer</class>
84
+ <method>onFailedRecaptchaCustomerRegistration</method>
85
  </studioforty9_recaptcha>
86
  </observers>
87
+ </studioforty9_recaptcha_failed_customer_account_createpost>
88
+ <studioforty9_recaptcha_failed_sendfriend_product_sendmail>
89
  <observers>
90
  <studioforty9_recaptcha>
91
  <class>studioforty9_recaptcha/observer</class>
92
+ <method>onFailedRecaptchaSendFriend</method>
93
+ </studioforty9_recaptcha>
94
+ </observers>
95
+ </studioforty9_recaptcha_failed_sendfriend_product_sendmail>
96
+ <studioforty9_recaptcha_failed_customer_account_loginPost>
97
+ <observers>
98
+ <studioforty9_recaptcha>
99
+ <class>studioforty9_recaptcha/observer</class>
100
+ <method>onFailedRecaptchaLogin</method>
101
+ </studioforty9_recaptcha>
102
+ </observers>
103
+ </studioforty9_recaptcha_failed_customer_account_loginPost>
104
+ <studioforty9_recaptcha_failed_customer_account_forgotpasswordpost>
105
+ <observers>
106
+ <studioforty9_recaptcha>
107
+ <class>studioforty9_recaptcha/observer</class>
108
+ <method>onFailedRecaptchaForgotPassword</method>
109
  </studioforty9_recaptcha>
110
  </observers>
111
+ </studioforty9_recaptcha_failed_customer_account_forgotpasswordpost>
112
  </events>
113
  </frontend>
114
  <adminhtml>
147
  <site_key></site_key>
148
  <secret_key></secret_key>
149
  <theme>light</theme>
150
+ <enabled_routes><![CDATA[]]></enabled_routes>
151
  </recaptcha>
152
  </google>
153
  </default>
app/code/community/Studioforty9/Recaptcha/etc/system.xml CHANGED
@@ -8,7 +8,7 @@
8
  * @author StudioForty9 <info@studioforty9.com>
9
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
10
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
11
- * @version 1.2.0
12
  * @link https://github.com/studioforty9/recaptcha
13
  */
14
  -->
@@ -17,7 +17,7 @@
17
  <google>
18
  <groups>
19
  <recaptcha translate="label title" module="studioforty9_recaptcha">
20
- <label>Google ReCaptcha</label>
21
  <frontend_type>text</frontend_type>
22
  <sort_order>1000</sort_order>
23
  <show_in_default>1</show_in_default>
@@ -33,42 +33,6 @@
33
  <show_in_website>1</show_in_website>
34
  <show_in_store>1</show_in_store>
35
  </enabled>
36
- <enabled_contacts translate="label">
37
- <label>Enabled on Contact Form</label>
38
- <frontend_type>select</frontend_type>
39
- <source_model>adminhtml/system_config_source_yesno</source_model>
40
- <sort_order>11</sort_order>
41
- <show_in_default>1</show_in_default>
42
- <show_in_website>1</show_in_website>
43
- <show_in_store>1</show_in_store>
44
- </enabled_contacts>
45
- <enabled_reviews translate="label">
46
- <label>Enabled on Product Review Form</label>
47
- <frontend_type>select</frontend_type>
48
- <source_model>adminhtml/system_config_source_yesno</source_model>
49
- <sort_order>12</sort_order>
50
- <show_in_default>1</show_in_default>
51
- <show_in_website>1</show_in_website>
52
- <show_in_store>1</show_in_store>
53
- </enabled_reviews>
54
- <enabled_sendfriend translate="label">
55
- <label>Enabled on Product Send to Friend Form</label>
56
- <frontend_type>select</frontend_type>
57
- <source_model>adminhtml/system_config_source_yesno</source_model>
58
- <sort_order>13</sort_order>
59
- <show_in_default>1</show_in_default>
60
- <show_in_website>1</show_in_website>
61
- <show_in_store>1</show_in_store>
62
- </enabled_sendfriend>
63
- <enabled_customer_registration translate="label">
64
- <label>Enabled on Customer Registration Form</label>
65
- <frontend_type>select</frontend_type>
66
- <source_model>adminhtml/system_config_source_yesno</source_model>
67
- <sort_order>14</sort_order>
68
- <show_in_default>1</show_in_default>
69
- <show_in_website>1</show_in_website>
70
- <show_in_store>1</show_in_store>
71
- </enabled_customer_registration>
72
  <site_key translate="label">
73
  <label>Site Key</label>
74
  <frontend_type>text</frontend_type>
@@ -76,6 +40,8 @@
76
  <show_in_default>1</show_in_default>
77
  <show_in_website>1</show_in_website>
78
  <show_in_store>1</show_in_store>
 
 
79
  </site_key>
80
  <secret_key translate="label">
81
  <label>Secret Key</label>
@@ -84,6 +50,8 @@
84
  <show_in_default>1</show_in_default>
85
  <show_in_website>1</show_in_website>
86
  <show_in_store>1</show_in_store>
 
 
87
  </secret_key>
88
  <theme translate="label">
89
  <label>Theme</label>
@@ -93,7 +61,42 @@
93
  <show_in_default>1</show_in_default>
94
  <show_in_website>1</show_in_website>
95
  <show_in_store>1</show_in_store>
 
 
96
  </theme>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  </fields>
98
  </recaptcha>
99
  </groups>
8
  * @author StudioForty9 <info@studioforty9.com>
9
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
10
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
11
+ * @version 1.5.0
12
  * @link https://github.com/studioforty9/recaptcha
13
  */
14
  -->
17
  <google>
18
  <groups>
19
  <recaptcha translate="label title" module="studioforty9_recaptcha">
20
+ <label>Google reCAPTCHA</label>
21
  <frontend_type>text</frontend_type>
22
  <sort_order>1000</sort_order>
23
  <show_in_default>1</show_in_default>
33
  <show_in_website>1</show_in_website>
34
  <show_in_store>1</show_in_store>
35
  </enabled>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  <site_key translate="label">
37
  <label>Site Key</label>
38
  <frontend_type>text</frontend_type>
40
  <show_in_default>1</show_in_default>
41
  <show_in_website>1</show_in_website>
42
  <show_in_store>1</show_in_store>
43
+ <comment><![CDATA[<a href="https://www.google.com/recaptcha/admin" target="_blank">Create a site key</a>]]></comment>
44
+ <depends><enabled>1</enabled></depends>
45
  </site_key>
46
  <secret_key translate="label">
47
  <label>Secret Key</label>
50
  <show_in_default>1</show_in_default>
51
  <show_in_website>1</show_in_website>
52
  <show_in_store>1</show_in_store>
53
+ <comment><![CDATA[<a href="https://www.google.com/recaptcha/admin" target="_blank">Create a secret key</a>]]></comment>
54
+ <depends><enabled>1</enabled></depends>
55
  </secret_key>
56
  <theme translate="label">
57
  <label>Theme</label>
61
  <show_in_default>1</show_in_default>
62
  <show_in_website>1</show_in_website>
63
  <show_in_store>1</show_in_store>
64
+ <comment><![CDATA[See the Google reCAPTCHA Documentation <a href="https://developers.google.com/recaptcha/docs/display#render_param" target="_blank">for more</a>]]></comment>
65
+ <depends><enabled>1</enabled></depends>
66
  </theme>
67
+ <type translate="label">
68
+ <label>Type</label>
69
+ <frontend_type>select</frontend_type>
70
+ <source_model>studioforty9_recaptcha/source_type</source_model>
71
+ <sort_order>41</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ <comment><![CDATA[See the Google reCAPTCHA Documentation <a href="https://developers.google.com/recaptcha/docs/display#render_param" target="_blank">for more</a>]]></comment>
76
+ <depends><enabled>1</enabled></depends>
77
+ </type>
78
+ <size translate="label">
79
+ <label>Size</label>
80
+ <frontend_type>select</frontend_type>
81
+ <source_model>studioforty9_recaptcha/source_size</source_model>
82
+ <sort_order>42</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ <comment><![CDATA[See the Google reCAPTCHA Documentation <a href="https://developers.google.com/recaptcha/docs/display#render_param" target="_blank">for more</a>]]></comment>
87
+ <depends><enabled>1</enabled></depends>
88
+ </size>
89
+ <enabled_routes translate="label hint">
90
+ <label>Enabled Routes</label>
91
+ <frontend_type>multiselect</frontend_type>
92
+ <source_model>studioforty9_recaptcha/source_routes</source_model>
93
+ <sort_order>50</sort_order>
94
+ <show_in_default>1</show_in_default>
95
+ <show_in_website>1</show_in_website>
96
+ <show_in_store>1</show_in_store>
97
+ <comment><![CDATA[Hold Ctrl/Command and click to select<br/>Hold Shift and click to select a range<br/>Routes to allow reCAPTCHA verification - <a href="https://recaptcha.readme.io/v1.5/docs/troubleshooting#understanding-configuration-routes" target="_blank">read docs</a>]]></comment>
98
+ <depends><enabled>1</enabled></depends>
99
+ </enabled_routes>
100
  </fields>
101
  </recaptcha>
102
  </groups>
app/design/frontend/base/default/layout/studioforty9_recaptcha.xml CHANGED
@@ -8,7 +8,7 @@
8
  * @author StudioForty9 <info@studioforty9.com>
9
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
10
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
11
- * @version 1.2.0
12
  * @link https://github.com/studioforty9/recaptcha
13
  */
14
  -->
@@ -26,9 +26,27 @@
26
  </reference>
27
  </review_product_list>
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  <customer_account_create>
30
  <reference name="customer_form_register">
31
- <block type="studioforty9_recaptcha/explicit" name="studioforty9.recaptcha.explicit" template="studioforty9/recaptcha/explicit.phtml"/>
 
 
32
  </reference>
33
  </customer_account_create>
34
 
8
  * @author StudioForty9 <info@studioforty9.com>
9
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
10
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
11
+ * @version 1.5.0
12
  * @link https://github.com/studioforty9/recaptcha
13
  */
14
  -->
26
  </reference>
27
  </review_product_list>
28
 
29
+ <customer_account_login>
30
+ <reference name="customer_form_login">
31
+ <block type="core/text_list" name="form.additional.info">
32
+ <block type="studioforty9_recaptcha/explicit" name="studioforty9.recaptcha.explicit" template="studioforty9/recaptcha/explicit.phtml"/>
33
+ </block>
34
+ </reference>
35
+ </customer_account_login>
36
+
37
+ <customer_account_forgotpassword>
38
+ <reference name="forgotPassword">
39
+ <block type="core/text_list" name="form.additional.info">
40
+ <block type="studioforty9_recaptcha/explicit" name="studioforty9.recaptcha.explicit" template="studioforty9/recaptcha/explicit.phtml"/>
41
+ </block>
42
+ </reference>
43
+ </customer_account_forgotpassword>
44
+
45
  <customer_account_create>
46
  <reference name="customer_form_register">
47
+ <block type="core/text_list" name="form.additional.info">
48
+ <block type="studioforty9_recaptcha/explicit" name="studioforty9.recaptcha.explicit" template="studioforty9/recaptcha/explicit.phtml"/>
49
+ </block>
50
  </reference>
51
  </customer_account_create>
52
 
app/design/frontend/base/default/template/studioforty9/recaptcha/autorender.phtml DELETED
@@ -1,21 +0,0 @@
1
- <?php
2
- /**
3
- * Studioforty9_Recaptcha
4
- *
5
- * @category Studioforty9
6
- * @package Studioforty9_Recaptcha
7
- * @author StudioForty9 <info@studioforty9.com>
8
- * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
- * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
- * @link https://github.com/studioforty9/recaptcha
12
- * @see Studioforty9_Recaptcha_Block_Autorender
13
- */
14
- ?>
15
- <?php if ($this->isAllowed($this->getRequest()->getRouteName())): ?>
16
- <div class="recaptcha">
17
- <?php echo $this->getRecaptchaHtml(); ?>
18
- <?php echo $this->getRecaptchaScript(); ?>
19
-
20
- </div>
21
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/studioforty9/recaptcha/explicit.phtml CHANGED
@@ -7,24 +7,27 @@
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  * @see Studioforty9_Recaptcha_Block_Explicit
13
  */
 
 
14
  ?>
15
- <?php if ($this->isAllowed($this->getRequest()->getRouteName())): ?>
16
- <div class="recaptcha" style="overflow:hidden;position:relative;">
17
- <input type="checkbox" id="recaptcha-verification-1" name="recaptcha-verification-1" value="" class="hide required-entry" style="visibility:hidden;position:absolute;left:-1000000px" />
18
- <div id="recaptcha-1"></div>
19
  <script type="text/javascript">
20
  var onloadCallback = function() {
21
- grecaptcha.render('recaptcha-1', {
22
  'sitekey': "<?php echo $this->getSiteKey(); ?>",
23
  'theme': "<?php echo $this->getTheme(); ?>",
 
 
24
  'callback': function(response) {
25
  if (response.length > 0) {
26
- $('recaptcha-verification-1').writeAttribute('value', 'checked');
27
- $('recaptcha-verification-1').checked = true;
28
  }
29
  }
30
  });
@@ -32,4 +35,3 @@
32
  </script>
33
  <?php echo $this->getRecaptchaScript(); ?>
34
  </div>
35
- <?php endif; ?>
7
  * @author StudioForty9 <info@studioforty9.com>
8
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
+ * @version 1.5.0
11
  * @link https://github.com/studioforty9/recaptcha
12
  * @see Studioforty9_Recaptcha_Block_Explicit
13
  */
14
+
15
+ $id = $this->getRecaptchaId();
16
  ?>
17
+ <div class="recaptcha" style="overflow:hidden;position:relative;margin-bottom:10px;">
18
+ <input type="checkbox" id="cb-<?php echo $id ?>" name="cb-<?php echo $id ?>" value="" class="hide required-entry" style="visibility:hidden; position:absolute; left:-1000000px" />
19
+ <div id="el-<?php echo $id ?>"></div>
 
20
  <script type="text/javascript">
21
  var onloadCallback = function() {
22
+ grecaptcha.render('el-<?php echo $id ?>', {
23
  'sitekey': "<?php echo $this->getSiteKey(); ?>",
24
  'theme': "<?php echo $this->getTheme(); ?>",
25
+ 'type': "<?php echo $this->getType(); ?>",
26
+ 'size': "<?php echo $this->getSize(); ?>",
27
  'callback': function(response) {
28
  if (response.length > 0) {
29
+ $('cb-<?php echo $id ?>').writeAttribute('value', 'checked');
30
+ $('cb-<?php echo $id ?>').checked = true;
31
  }
32
  }
33
  });
35
  </script>
36
  <?php echo $this->getRecaptchaScript(); ?>
37
  </div>
 
app/design/frontend/base/default/template/studioforty9/recaptcha/samples/base/contacts/form.phtml DELETED
@@ -1,61 +0,0 @@
1
- <?php
2
- /**
3
- * Studioforty9_Recaptcha
4
- *
5
- * @category Studioforty9
6
- * @package Studioforty9_Recaptcha
7
- * @author StudioForty9 <info@studioforty9.com>
8
- * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
- * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
- * @link https://github.com/studioforty9/recaptcha
12
- */
13
- ?>
14
- <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
15
- <div class="page-title">
16
- <h1><?php echo Mage::helper('contacts')->__('Contact Us') ?></h1>
17
- </div>
18
- <form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post">
19
- <div class="fieldset">
20
- <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
21
- <ul class="form-list">
22
- <li class="fields">
23
- <div class="field">
24
- <label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
25
- <div class="input-box">
26
- <input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
27
- </div>
28
- </div>
29
- <div class="field">
30
- <label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
31
- <div class="input-box">
32
- <input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->htmlEscape($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="text" />
33
- </div>
34
- </div>
35
- </li>
36
- <li>
37
- <label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
38
- <div class="input-box">
39
- <input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="text" />
40
- </div>
41
- </li>
42
- <li class="wide">
43
- <label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment') ?></label>
44
- <div class="input-box">
45
- <textarea name="comment" id="comment" title="<?php echo Mage::helper('contacts')->__('Comment') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
46
- </div>
47
- </li>
48
- </ul>
49
- </div>
50
- <?php echo $this->getChildHtml('studioforty9.recaptcha.explicit'); ?>
51
- <div class="buttons-set">
52
- <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
53
- <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
54
- <button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
55
- </div>
56
- </form>
57
- <script type="text/javascript">
58
- //<![CDATA[
59
- var contactForm = new VarienForm('contactForm', true);
60
- //]]>
61
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/studioforty9/recaptcha/samples/base/persistent/customer/form/register.phtml DELETED
@@ -1,180 +0,0 @@
1
- <?php
2
- /**
3
- * Studioforty9_Recaptcha
4
- *
5
- * @category Studioforty9
6
- * @package Studioforty9_Recaptcha
7
- * @author StudioForty9 <info@studioforty9.com>
8
- * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
- * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
- * @link https://github.com/studioforty9/recaptcha
12
- */
13
- ?>
14
- <?php
15
- /**
16
- * Create account form template
17
- *
18
- * @see app/design/frontend/base/default/template/customer/form/register.phtml
19
- */
20
- /** @var $this Mage_Customer_Block_Form_Register */
21
- ?>
22
- <div class="account-create">
23
- <div class="page-title">
24
- <h1><?php echo $this->__('Create an Account') ?></h1>
25
- </div>
26
- <?php echo $this->getChildHtml('form_fields_before')?>
27
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
28
- <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate">
29
- <div class="fieldset">
30
- <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
31
- <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
32
- <h2 class="legend"><?php echo $this->__('Personal Information') ?></h2>
33
- <ul class="form-list">
34
- <li class="fields">
35
- <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
36
- </li>
37
- <li>
38
- <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
39
- <div class="input-box">
40
- <input type="text" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
41
- </div>
42
- </li>
43
- <?php if ($this->isNewsletterEnabled()): ?>
44
- <li class="control">
45
- <div class="input-box">
46
- <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
47
- </div>
48
- <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
49
- </li>
50
- <?php endif ?>
51
- <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
52
- <?php if ($_dob->isEnabled()): ?>
53
- <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
54
- <?php endif ?>
55
- <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
56
- <?php if ($_taxvat->isEnabled()): ?>
57
- <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
58
- <?php endif ?>
59
- <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
60
- <?php if ($_gender->isEnabled()): ?>
61
- <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
62
- <?php endif ?>
63
- </ul>
64
- </div>
65
- <?php if($this->getShowAddressFields()): ?>
66
- <div class="fieldset">
67
- <input type="hidden" name="create_address" value="1" />
68
- <h2 class="legend"><?php echo $this->__('Address Information') ?></h2>
69
- <ul class="form-list">
70
- <li class="fields">
71
- <div class="field">
72
- <label for="company"><?php echo $this->__('Company') ?></label>
73
- <div class="input-box">
74
- <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
75
- </div>
76
- </div>
77
- <div class="field">
78
- <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
79
- <div class="input-box">
80
- <input type="text" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" />
81
- </div>
82
- </div>
83
- </li>
84
- <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
85
- <li class="wide">
86
- <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
87
- <div class="input-box">
88
- <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(1)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
89
- </div>
90
- </li>
91
- <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
92
- <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
93
- <li class="wide">
94
- <div class="input-box">
95
- <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
96
- </div>
97
- </li>
98
- <?php endfor; ?>
99
- <li class="fields">
100
- <div class="field">
101
- <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
102
- <div class="input-box">
103
- <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
104
- </div>
105
- </div>
106
- <div class="field">
107
- <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
108
- <div class="input-box">
109
- <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
110
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
111
- </select>
112
- <script type="text/javascript">
113
- //<![CDATA[
114
- $('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
115
- //]]>
116
- </script>
117
- <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
118
- </div>
119
- </div>
120
- </li>
121
- <li class="fields">
122
- <div class="field">
123
- <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
124
- <div class="input-box">
125
- <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
126
- </div>
127
- </div>
128
- <div class="field">
129
- <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
130
- <div class="input-box">
131
- <?php echo $this->getCountryHtmlSelect() ?>
132
- </div>
133
- </div>
134
- </li>
135
- </ul>
136
- <input type="hidden" name="default_billing" value="1" />
137
- <input type="hidden" name="default_shipping" value="1" />
138
- </div>
139
- <?php endif; ?>
140
- <div class="fieldset">
141
- <h2 class="legend"><?php echo $this->__('Login Information') ?></h2>
142
- <ul class="form-list">
143
- <li class="fields">
144
- <div class="field">
145
- <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
146
- <div class="input-box">
147
- <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
148
- </div>
149
- </div>
150
- <div class="field">
151
- <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
152
- <div class="input-box">
153
- <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
154
- </div>
155
- </div>
156
- </li>
157
- <?php echo $this->getChildHtml('form.additional.info'); ?>
158
- <?php echo $this->getChildHtml('persistent.remember.me'); ?>
159
- </ul>
160
- <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
161
- </div>
162
- <?php echo $this->getChildHtml('studioforty9.recaptcha.explicit'); ?>
163
- <div class="buttons-set">
164
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
165
- <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
166
- <button type="submit" title="<?php echo $this->__('Submit') ?>" class="button"><span><span><?php echo $this->__('Submit') ?></span></span></button>
167
- </div>
168
- <?php if (Mage::helper('checkout')->isContextCheckout()): ?>
169
- <input name="context" type="hidden" value="checkout" />
170
- <?php endif; ?>
171
- </form>
172
- <script type="text/javascript">
173
- //<![CDATA[
174
- var dataForm = new VarienForm('form-validate', true);
175
- <?php if($this->getShowAddressFields()): ?>
176
- new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
177
- <?php endif; ?>
178
- //]]>
179
- </script>
180
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/studioforty9/recaptcha/samples/base/review/form.phtml DELETED
@@ -1,120 +0,0 @@
1
- <?php
2
- /**
3
- * Studioforty9_Recaptcha
4
- *
5
- * @category Studioforty9
6
- * @package Studioforty9_Recaptcha
7
- * @author StudioForty9 <info@studioforty9.com>
8
- * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
- * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
- * @link https://github.com/studioforty9/recaptcha
12
- */
13
- ?>
14
- <div class="form-add">
15
- <h2><?php echo $this->__('Write Your Own Review') ?></h2>
16
- <?php if ($this->getAllowWriteReviewFlag()): ?>
17
- <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
18
- <fieldset>
19
- <?php echo $this->getChildHtml('form_fields_before')?>
20
- <h3><?php echo $this->__("You're reviewing:"); ?> <span><?php echo $this->htmlEscape($this->getProductInfo()->getName()) ?></span></h3>
21
- <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
22
- <h4><?php echo $this->__('How do you rate this product?') ?> <em class="required">*</em></h4>
23
- <span id="input-message-box"></span>
24
- <table class="data-table" id="product-review-table">
25
- <col />
26
- <col width="1" />
27
- <col width="1" />
28
- <col width="1" />
29
- <col width="1" />
30
- <col width="1" />
31
- <thead>
32
- <tr>
33
- <th>&nbsp;</th>
34
- <th><span class="nobr"><?php echo $this->__('1 star') ?></span></th>
35
- <th><span class="nobr"><?php echo $this->__('2 stars') ?></span></th>
36
- <th><span class="nobr"><?php echo $this->__('3 stars') ?></span></th>
37
- <th><span class="nobr"><?php echo $this->__('4 stars') ?></span></th>
38
- <th><span class="nobr"><?php echo $this->__('5 stars') ?></span></th>
39
- </tr>
40
- </thead>
41
- <tbody>
42
- <?php foreach ($this->getRatings() as $_rating): ?>
43
- <tr>
44
- <th><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></th>
45
- <?php foreach ($_rating->getOptions() as $_option): ?>
46
- <td class="value"><input type="radio" name="ratings[<?php echo $_rating->getId() ?>]" id="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>" value="<?php echo $_option->getId() ?>" class="radio" /></td>
47
- <?php endforeach; ?>
48
- </tr>
49
- <?php endforeach; ?>
50
- </tbody>
51
- </table>
52
- <input type="hidden" name="validate_rating" class="validate-rating" value="" />
53
- <script type="text/javascript">decorateTable('product-review-table')</script>
54
- <?php endif; ?>
55
- <ul class="form-list">
56
- <li>
57
- <label for="nickname_field" class="required"><em>*</em><?php echo $this->__('Nickname') ?></label>
58
- <div class="input-box">
59
- <input type="text" name="nickname" id="nickname_field" class="input-text required-entry" value="<?php echo $this->htmlEscape($data->getNickname()) ?>" />
60
- </div>
61
- </li>
62
- <li>
63
- <label for="summary_field" class="required"><em>*</em><?php echo $this->__('Summary of Your Review') ?></label>
64
- <div class="input-box">
65
- <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php echo $this->htmlEscape($data->getTitle()) ?>" />
66
- </div>
67
- </li>
68
- <li>
69
- <label for="review_field" class="required"><em>*</em><?php echo $this->__('Review') ?></label>
70
- <div class="input-box">
71
- <textarea name="detail" id="review_field" cols="5" rows="3" class="required-entry"><?php echo $this->htmlEscape($data->getDetail()) ?></textarea>
72
- </div>
73
- </li>
74
- </ul>
75
- </fieldset>
76
- <?php echo $this->getChildHtml('studioforty9.recaptcha.explicit'); ?>
77
- <div class="buttons-set">
78
- <button type="submit" title="<?php echo $this->__('Submit Review') ?>" class="button"><span><span><?php echo $this->__('Submit Review') ?></span></span></button>
79
- </div>
80
- </form>
81
- <script type="text/javascript">
82
- //<![CDATA[
83
- var dataForm = new VarienForm('review-form');
84
- Validation.addAllThese(
85
- [
86
- ['validate-rating', '<?php echo $this->__('Please select one of each of the ratings above') ?>', function(v) {
87
- var trs = $('product-review-table').select('tr');
88
- var inputs;
89
- var error = 1;
90
-
91
- for( var j=0; j < trs.length; j++ ) {
92
- var tr = trs[j];
93
- if( j > 0 ) {
94
- inputs = tr.select('input');
95
-
96
- for( i in inputs ) {
97
- if( inputs[i].checked == true ) {
98
- error = 0;
99
- }
100
- }
101
-
102
- if( error == 1 ) {
103
- return false;
104
- } else {
105
- error = 1;
106
- }
107
- }
108
- }
109
- return true;
110
- }]
111
- ]
112
- );
113
- //]]>
114
- </script>
115
- <?php else: ?>
116
- <p class="review-nologged" id="review-form">
117
- <?php echo $this->__('Only registered users can write reviews. Please, <a href="%s">log in</a> or <a href="%s">register</a>', $this->getLoginLink(), Mage::helper('customer')->getRegisterUrl()) ?>
118
- </p>
119
- <?php endif ?>
120
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/studioforty9/recaptcha/samples/base/sendfriend/send.phtml DELETED
@@ -1,131 +0,0 @@
1
- <?php
2
- /**
3
- * Studioforty9_Recaptcha
4
- *
5
- * @category Studioforty9
6
- * @package Studioforty9_Recaptcha
7
- * @author StudioForty9 <info@studioforty9.com>
8
- * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
9
- * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
10
- * @version 1.2.0
11
- * @link https://github.com/studioforty9/recaptcha
12
- */
13
- /* @var $this Mage_Sendfriend_Block_Send */
14
- /**
15
- * Send to friend form
16
- *
17
- * @see Mage_Sendfriend_Block_Send
18
- */
19
- ?>
20
- <script type="text/javascript">
21
- //<![CDATA[
22
- i=0;
23
- var recipCount = 1;
24
- var maxRecip = <?php echo $this->getMaxRecipients() ?>;
25
- function remove_recipient(i){
26
- $('recipients_name'+i).up(2).remove();
27
- recipCount--;
28
- if(recipCount<maxRecip && maxRecip != 0) {
29
- $('add_recipient_button').show();
30
- $('max_recipient_message').hide();
31
- }
32
- return false;
33
- }
34
-
35
- function add_recipient(){
36
- ul = $('recipients_options');
37
- var li_mail = Element.extend(document.createElement("LI"));
38
- li_mail.addClassName('fields additional-row');
39
- li_mail.innerHTML = '<p><a href="delete_email" title="<?php echo $this->__('Remove Email') ?>" onclick="remove_recipient('+i+'); return false" class="btn-remove"><?php echo $this->__('Remove Email') ?>"<\/a><\/p>'
40
- li_mail.innerHTML += '<div class="field"><label for="recipients_name'+i+'" class="required"><em>*<\/em><?php echo $this->__('Name:') ?><\/label><div class="input-box"><input name="recipients[name][]" type="text" class="input-text required-entry" id="recipients_name'+i+'" /><\/div>';
41
- li_mail.innerHTML += '<div class="field"><label for="recipients_email'+i+'" class="required"><em>*<\/em><?php echo $this->__('Email Address:') ?><\/label><div class="input-box"><input name="recipients[email][]" value="" title="<?php echo $this->__('Email Address') ?>" id="recipients_email'+i+'" type="text" class="input-text required-entry validate-email" /><\/div><\/div>';
42
- i++;
43
- recipCount++;
44
- if(recipCount>=maxRecip && maxRecip != 0) {
45
- $('add_recipient_button').hide();
46
- $('max_recipient_message').show();
47
- }
48
-
49
- ul.appendChild(li_mail);
50
- }
51
- //]]>
52
- </script>
53
-
54
- <div class="send-friend">
55
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
56
- <div class="page-title">
57
- <h1><?php echo $this->__('Email to a Friend') ?></h1>
58
- </div>
59
- <form action="<?php echo $this->getSendUrl() ?>" method="post" id="product_sendtofriend_form">
60
- <div class="fieldset">
61
- <?php echo $this->getBlockHtml('formkey')?>
62
- <h2 class="legend"><?php echo $this->__('Sender:') ?></h2>
63
- <ul class="form-list" id="sender_options">
64
- <li class="fields">
65
- <div class="field">
66
- <label for="sender_name" class="required"><em>*</em><?php echo $this->__('Name:') ?></label>
67
- <div class="input-box">
68
- <input name="sender[name]" value="<?php echo $this->htmlEscape($this->getUserName()) ?>" title="<?php echo $this->__('Name') ?>" id="sender_name" type="text" class="input-text required-entry" />
69
- </div>
70
- </div>
71
- <div class="field">
72
- <label for="sender_email" class="required"><em>*</em><?php echo $this->__('Email:') ?></label>
73
- <div class="input-box">
74
- <input name="sender[email]" value="<?php echo $this->htmlEscape($this->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" id="sender_email" type="text" class="input-text required-entry validate-email" />
75
- </div>
76
- </div>
77
- </li>
78
- <li class="wide">
79
- <label for="sender_message" class="required"><em>*</em><?php echo $this->__('Message:') ?></label>
80
- <div class="input-box">
81
- <textarea name="sender[message]" class="input-text required-entry" id="sender_message" cols="3" rows="3"><?php echo $this->htmlEscape($this->getMessage())?></textarea>
82
- </div>
83
- </li>
84
- </ul>
85
- </div>
86
- <div class="fieldset">
87
- <h2 class="legend"><?php echo $this->__('Recipient:') ?></h2>
88
- <ul class="form-list" id="recipients_options">
89
- <li class="fields">
90
- <div class="field">
91
- <label for="recipients_name" class="required"><em>*</em><?php echo $this->__('Name:') ?></label>
92
- <div class="input-box">
93
- <input name="recipients[name][]" type="text" class="input-text required-entry" id="recipients_name" />
94
- </div>
95
- </div>
96
- <div class="field">
97
- <label for="recipients_email" class="required"><em>*</em><?php echo $this->__('Email Address:') ?></label>
98
- <div class="input-box">
99
- <input name="recipients[email][]" value="" title="<?php echo $this->__('Email Address') ?>" id="recipients_email" type="text" class="input-text required-entry validate-email" />
100
- </div>
101
- </div>
102
- </li>
103
- </ul>
104
- </div>
105
- <?php echo $this->getChildHtml('studioforty9.recaptcha.explicit'); ?>
106
- <div class="buttons-set">
107
- <p class="back-link"><a href="#" onclick="history.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
108
- <button type="submit" class="button<?php if (!$this->canSend()):?> disabled<?php endif ?>"<?php if (!$this->canSend()):?> disabled="disabled"<?php endif ?>><span><span><?php echo $this->__('Send Email') ?></span></span></button>
109
- <div id="max_recipient_message" style="display:none;">
110
- <?php if ($this->getMaxRecipients()): ?>
111
- <p class="limit"><?php echo $this->__('Maximum %d email addresses allowed.', $this->getMaxRecipients()) ?></p>
112
- <?php endif; ?>
113
- </div>
114
- <?php if (1 < $this->getMaxRecipients()): ?>
115
- <p id="add_recipient_button">
116
- <button type="button" onclick="add_recipient();" class="button"><span><span><?php echo $this->__('Add Recipient') ?></span></span></button>
117
- </p>
118
- <?php endif; ?>
119
- </div>
120
- </form>
121
- <script type="text/javascript">
122
- //<![CDATA[
123
- var productSendtofriendForm = new VarienForm('product_sendtofriend_form');
124
- productSendtofriendForm.submit = function() {
125
- if(this.validator.validate()) {
126
- this.form.submit();
127
- }
128
- }.bind(productSendtofriendForm);
129
- //]]>
130
- </script>
131
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/studioforty9/recaptcha/samples/rwd/contacts/form.phtml DELETED
@@ -1,74 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package rwd_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div>
28
- <div class="page-title">
29
- <h1><?php echo Mage::helper('contacts')->__('Contact Us') ?></h1>
30
- </div>
31
- <form action="<?php echo $this->getFormAction(); ?>" id="contactForm" method="post" class="scaffold-form">
32
- <div class="fieldset">
33
- <h2 class="legend"><?php echo Mage::helper('contacts')->__('Contact Information') ?></h2>
34
- <p class="required"><?php echo Mage::helper('contacts')->__('* Required Fields') ?></p>
35
- <ul class="form-list">
36
- <li class="fields">
37
- <div class="field">
38
- <label for="name" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Name') ?></label>
39
- <div class="input-box">
40
- <input name="name" id="name" title="<?php echo Mage::helper('contacts')->__('Name') ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserName()) ?>" class="input-text required-entry" type="text" />
41
- </div>
42
- </div>
43
- <div class="field">
44
- <label for="email" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Email') ?></label>
45
- <div class="input-box">
46
- <input name="email" id="email" title="<?php echo Mage::helper('contacts')->__('Email') ?>" value="<?php echo $this->escapeHtml($this->helper('contacts')->getUserEmail()) ?>" class="input-text required-entry validate-email" type="email" autocapitalize="off" autocorrect="off" spellcheck="false" />
47
- </div>
48
- </div>
49
- </li>
50
- <li>
51
- <label for="telephone"><?php echo Mage::helper('contacts')->__('Telephone') ?></label>
52
- <div class="input-box">
53
- <input name="telephone" id="telephone" title="<?php echo Mage::helper('contacts')->__('Telephone') ?>" value="" class="input-text" type="tel" />
54
- </div>
55
- </li>
56
- <li class="wide">
57
- <label for="comment" class="required"><em>*</em><?php echo Mage::helper('contacts')->__('Comment') ?></label>
58
- <div class="input-box">
59
- <textarea name="comment" id="comment" title="<?php echo Mage::helper('contacts')->__('Comment') ?>" class="required-entry input-text" cols="5" rows="3"></textarea>
60
- </div>
61
- </li>
62
- </ul>
63
- </div>
64
- <?php echo $this->getChildHtml('studioforty9.recaptcha.explicit'); ?>
65
- <div class="buttons-set">
66
- <input type="text" name="hideit" id="hideit" value="" style="display:none !important;" />
67
- <button type="submit" title="<?php echo Mage::helper('contacts')->__('Submit') ?>" class="button"><span><span><?php echo Mage::helper('contacts')->__('Submit') ?></span></span></button>
68
- </div>
69
- </form>
70
- <script type="text/javascript">
71
- //<![CDATA[
72
- var contactForm = new VarienForm('contactForm', true);
73
- //]]>
74
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/studioforty9/recaptcha/samples/rwd/customer/form/register.phtml DELETED
@@ -1,189 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package rwd_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <?php
28
- /**
29
- * Create account form template
30
- *
31
- * @see app/design/frontend/base/default/template/customer/form/register.phtml
32
- */
33
- /** @var $this Mage_Customer_Block_Form_Register */
34
- ?>
35
- <div class="account-create">
36
- <div class="page-title">
37
- <h1><?php echo $this->__('Create an Account') ?></h1>
38
- </div>
39
- <?php echo $this->getChildHtml('form_fields_before')?>
40
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
41
- <form action="<?php echo $this->getPostActionUrl() ?>" method="post" id="form-validate" class="scaffold-form" enctype="multipart/form-data">
42
- <div class="fieldset">
43
- <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
44
- <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
45
- <p class="form-instructions"><?php echo $this->__('Please enter the following information to create your account.') ?></p>
46
- <p class="required"><?php echo $this->__('* Required Fields') ?></p>
47
- <ul class="form-list">
48
- <li class="fields">
49
- <?php echo $this->getLayout()->createBlock('customer/widget_name')->setObject($this->getFormData())->setForceUseCustomerAttributes(true)->toHtml() ?>
50
- </li>
51
- <li>
52
- <label for="email_address" class="required"><em>*</em><?php echo $this->__('Email Address') ?></label>
53
- <div class="input-box">
54
- <input type="email" autocapitalize="off" autocorrect="off" spellcheck="false" name="email" id="email_address" value="<?php echo $this->escapeHtml($this->getFormData()->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" class="input-text validate-email required-entry" />
55
- </div>
56
- </li>
57
- <?php $_dob = $this->getLayout()->createBlock('customer/widget_dob') ?>
58
- <?php if ($_dob->isEnabled()): ?>
59
- <li><?php echo $_dob->setDate($this->getFormData()->getDob())->toHtml() ?></li>
60
- <?php endif ?>
61
- <?php $_taxvat = $this->getLayout()->createBlock('customer/widget_taxvat') ?>
62
- <?php if ($_taxvat->isEnabled()): ?>
63
- <li><?php echo $_taxvat->setTaxvat($this->getFormData()->getTaxvat())->toHtml() ?></li>
64
- <?php endif ?>
65
- <?php $_gender = $this->getLayout()->createBlock('customer/widget_gender') ?>
66
- <?php if ($_gender->isEnabled()): ?>
67
- <li><?php echo $_gender->setGender($this->getFormData()->getGender())->toHtml() ?></li>
68
- <?php endif ?>
69
-
70
- <?php if($this->getShowAddressFields()): ?>
71
- <li class="hidden">
72
- <input type="hidden" name="create_address" value="1" />
73
- </li>
74
- <li class="fields">
75
- <div class="field">
76
- <label for="company"><?php echo $this->__('Company') ?></label>
77
- <div class="input-box">
78
- <input type="text" name="company" id="company" value="<?php echo $this->escapeHtml($this->getFormData()->getCompany()) ?>" title="<?php echo $this->__('Company') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('company') ?>" />
79
- </div>
80
- </div>
81
- <div class="field">
82
- <label for="telephone" class="required"><em>*</em><?php echo $this->__('Telephone') ?></label>
83
- <div class="input-box">
84
- <input type="tel" name="telephone" id="telephone" value="<?php echo $this->escapeHtml($this->getFormData()->getTelephone()) ?>" title="<?php echo $this->__('Telephone') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>" />
85
- </div>
86
- </div>
87
- </li>
88
- <?php $_streetValidationClass = $this->helper('customer/address')->getAttributeValidationClass('street'); ?>
89
- <li class="wide">
90
- <label for="street_1" class="required"><em>*</em><?php echo $this->__('Street Address') ?></label>
91
- <div class="input-box">
92
- <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet(0)) ?>" title="<?php echo $this->__('Street Address') ?>" id="street_1" class="input-text <?php echo $_streetValidationClass ?>" />
93
- </div>
94
- </li>
95
- <?php $_streetValidationClass = trim(str_replace('required-entry', '', $_streetValidationClass)); ?>
96
- <?php for ($_i = 2, $_n = $this->helper('customer/address')->getStreetLines(); $_i <= $_n; $_i++): ?>
97
- <li class="wide">
98
- <label for="billing:street<?php echo $_i ?>"><?php echo $this->__('Street Address %s', $_i) ?></label>
99
- <div class="input-box">
100
- <input type="text" name="street[]" value="<?php echo $this->escapeHtml($this->getFormData()->getStreet($_i - 1)) ?>" title="<?php echo $this->__('Street Address %s', $_i) ?>" id="street_<?php echo $_i ?>" class="input-text <?php echo $_streetValidationClass ?>" />
101
- </div>
102
- </li>
103
- <?php endfor; ?>
104
- <li class="fields">
105
- <div class="field">
106
- <label for="city" class="required"><em>*</em><?php echo $this->__('City') ?></label>
107
- <div class="input-box">
108
- <input type="text" name="city" value="<?php echo $this->escapeHtml($this->getFormData()->getCity()) ?>" title="<?php echo $this->__('City') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('city') ?>" id="city" />
109
- </div>
110
- </div>
111
- <div class="field">
112
- <label for="region_id" class="required"><em>*</em><?php echo $this->__('State/Province') ?></label>
113
- <div class="input-box">
114
- <select id="region_id" name="region_id" title="<?php echo $this->__('State/Province') ?>" class="validate-select" style="display:none;">
115
- <option value=""><?php echo $this->__('Please select region, state or province') ?></option>
116
- </select>
117
- <script type="text/javascript">
118
- //<![CDATA[
119
- $('region_id').setAttribute('defaultValue', "<?php echo $this->getFormData()->getRegionId() ?>");
120
- //]]>
121
- </script>
122
- <input type="text" id="region" name="region" value="<?php echo $this->escapeHtml($this->getRegion()) ?>" title="<?php echo $this->__('State/Province') ?>" class="input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('region') ?>" style="display:none;" />
123
- </div>
124
- </div>
125
- </li>
126
- <li class="fields">
127
- <div class="field">
128
- <label for="zip" class="required"><em>*</em><?php echo $this->__('Zip/Postal Code') ?></label>
129
- <div class="input-box">
130
- <input type="text" name="postcode" value="<?php echo $this->escapeHtml($this->getFormData()->getPostcode()) ?>" title="<?php echo $this->__('Zip/Postal Code') ?>" id="zip" class="input-text validate-zip-international <?php echo $this->helper('customer/address')->getAttributeValidationClass('postcode') ?>" />
131
- </div>
132
- </div>
133
- <div class="field">
134
- <label for="country" class="required"><em>*</em><?php echo $this->__('Country') ?></label>
135
- <div class="input-box">
136
- <?php echo $this->getCountryHtmlSelect() ?>
137
- </div>
138
- </div>
139
- </li>
140
- <li class="hidden">
141
- <input type="hidden" name="default_billing" value="1" />
142
- <input type="hidden" name="default_shipping" value="1" />
143
- </li>
144
- <?php endif; ?>
145
- <li class="fields">
146
- <div class="field">
147
- <label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
148
- <div class="input-box">
149
- <input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
150
- </div>
151
- </div>
152
- <div class="field">
153
- <label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
154
- <div class="input-box">
155
- <input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
156
- </div>
157
- </div>
158
- </li>
159
- <?php echo $this->getChildHtml('form.additional.info'); ?>
160
- <?php if ($this->isNewsletterEnabled()): ?>
161
- <li class="control">
162
- <div class="input-box">
163
- <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
164
- </div>
165
- <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
166
- </li>
167
- <?php endif ?>
168
- <?php echo $this->getChildHtml('persistent.remember.me'); ?>
169
- </ul>
170
- <?php echo $this->getChildHtml('persistent.remember.me.tooltip'); ?>
171
- </div>
172
- <?php echo $this->getChildHtml('studioforty9.recaptcha.explicit'); ?>
173
- <div class="buttons-set">
174
- <p class="back-link"><a href="<?php echo $this->escapeUrl($this->getBackUrl()) ?>" class="back-link"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
175
- <button type="submit" title="<?php echo $this->__('Register') ?>" class="button"><span><span><?php echo $this->__('Register') ?></span></span></button>
176
- </div>
177
- <?php if (Mage::helper('checkout')->isContextCheckout()): ?>
178
- <input name="context" type="hidden" value="checkout" />
179
- <?php endif; ?>
180
- </form>
181
- <script type="text/javascript">
182
- //<![CDATA[
183
- var dataForm = new VarienForm('form-validate', true);
184
- <?php if($this->getShowAddressFields()): ?>
185
- new RegionUpdater('country', 'region', 'region_id', <?php echo $this->helper('directory')->getRegionJson() ?>, undefined, 'zip');
186
- <?php endif; ?>
187
- //]]>
188
- </script>
189
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/studioforty9/recaptcha/samples/rwd/review/form.phtml DELETED
@@ -1,166 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package rwd_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- ?>
27
- <div class="form-add">
28
- <h2><?php echo $this->__('Write Your Own Review') ?></h2>
29
- <?php if ($this->getAllowWriteReviewFlag()): ?>
30
- <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
31
- <?php echo $this->getBlockHtml('formkey'); ?>
32
- <?php echo $this->getChildHtml('form_fields_before')?>
33
- <h3><?php echo $this->__("You're reviewing:"); ?>
34
- <span><?php echo $this->escapeHtml($this->getProductInfo()->getName()) ?></span>
35
- </h3>
36
-
37
- <div class="fieldset">
38
- <?php if( $this->getRatings() && $this->getRatings()->getSize()): ?>
39
- <h4><?php echo $this->__('How do you rate this product?') ?> <em class="required">*</em></h4>
40
- <span id="input-message-box"></span>
41
- <table class="data-table review-summary-table ratings" id="product-review-table">
42
- <col width="1" />
43
- <col />
44
- <col />
45
- <col />
46
- <col />
47
- <col />
48
- <thead>
49
- <tr>
50
- <th>&nbsp;</th>
51
- <th>
52
- <div class="rating-box">
53
- <span class="rating-number">1</span>
54
- <span class="rating nobr" style="width:20%;"><?php echo $this->__('1 star') ?></span>
55
- </div>
56
- </th>
57
- <th>
58
- <div class="rating-box">
59
- <span class="rating-number">2</span>
60
- <span class="rating nobr" style="width:40%;"><?php echo $this->__('2 star') ?></span>
61
- </div>
62
- </th>
63
- <th>
64
- <div class="rating-box">
65
- <span class="rating-number">3</span>
66
- <span class="rating nobr" style="width:60%;"><?php echo $this->__('3 star') ?></span>
67
- </div>
68
- </th>
69
- <th>
70
- <div class="rating-box">
71
- <span class="rating-number">4</span>
72
- <span class="rating nobr" style="width:80%;"><?php echo $this->__('4 star') ?></span>
73
- </div>
74
- </th>
75
- <th>
76
- <div class="rating-box">
77
- <span class="rating-number">5</span>
78
- <span class="rating nobr" style="width:100%;"><?php echo $this->__('5 star') ?></span>
79
- </div>
80
- </th>
81
- </tr>
82
- </thead>
83
- <tbody>
84
- <?php foreach ($this->getRatings() as $_rating): ?>
85
- <tr>
86
- <th><?php echo $this->escapeHtml($_rating->getRatingCode()) ?></th>
87
- <?php foreach ($_rating->getOptions() as $_option): ?>
88
- <td class="value"><label for="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>"><input type="radio" name="ratings[<?php echo $_rating->getId() ?>]" id="<?php echo $this->escapeHtml($_rating->getRatingCode()) ?>_<?php echo $_option->getValue() ?>" value="<?php echo $_option->getId() ?>" class="radio" /></label></td>
89
- <?php endforeach; ?>
90
- </tr>
91
- <?php endforeach; ?>
92
- </tbody>
93
- </table>
94
- <input type="hidden" name="validate_rating" class="validate-rating" value="" />
95
- <script type="text/javascript">decorateTable('product-review-table')</script>
96
- <?php endif; ?>
97
-
98
- <ul class="form-list">
99
- <li>
100
- <label for="review_field" class="required"><em>*</em><?php echo $this->__('Let us know your thoughts') ?></label>
101
- <div class="input-box">
102
- <textarea name="detail" id="review_field" cols="5" rows="3" class="required-entry"><?php echo $this->escapeHtml($data->getDetail()) ?></textarea>
103
- </div>
104
- </li>
105
-
106
- <li class="inline-label">
107
- <label for="summary_field" class="required"><em>*</em><?php echo $this->__('Summary of Your Review') ?></label>
108
- <div class="input-box">
109
- <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getTitle()) ?>" />
110
- </div>
111
- </li>
112
-
113
- <li class="inline-label">
114
- <label for="nickname_field" class="required"><em>*</em><?php echo $this->__("What's your nickname?") ?></label>
115
- <div class="input-box">
116
- <input type="text" name="nickname" id="nickname_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getNickname()) ?>" />
117
- </div>
118
- </li>
119
-
120
- </ul>
121
- </div>
122
- <?php echo $this->getChildHtml('studioforty9.recaptcha.explicit'); ?>
123
- <div class="buttons-set">
124
- <button type="submit" title="<?php echo $this->__('Submit Review') ?>" class="button"><span><span><?php echo $this->__('Submit Review') ?></span></span></button>
125
- </div>
126
- </form>
127
- <script type="text/javascript">
128
- //<![CDATA[
129
- var dataForm = new VarienForm('review-form');
130
- Validation.addAllThese(
131
- [
132
- ['validate-rating', '<?php echo $this->__('Please select one of each of the ratings above') ?>', function(v) {
133
- var trs = $('product-review-table').select('tr');
134
- var inputs;
135
- var error = 1;
136
-
137
- for( var j=0; j < trs.length; j++ ) {
138
- var tr = trs[j];
139
- if( j > 0 ) {
140
- inputs = tr.select('input');
141
-
142
- for( i in inputs ) {
143
- if( inputs[i].checked == true ) {
144
- error = 0;
145
- }
146
- }
147
-
148
- if( error == 1 ) {
149
- return false;
150
- } else {
151
- error = 1;
152
- }
153
- }
154
- }
155
- return true;
156
- }]
157
- ]
158
- );
159
- //]]>
160
- </script>
161
- <?php else: ?>
162
- <p class="review-nologged" id="review-form">
163
- <?php echo $this->__('Only registered users can write reviews. Please, <a href="%s">log in</a> or <a href="%s">register</a>', $this->getLoginLink(), Mage::helper('customer')->getRegisterUrl()) ?>
164
- </p>
165
- <?php endif ?>
166
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/design/frontend/base/default/template/studioforty9/recaptcha/samples/rwd/sendfriend/send.phtml DELETED
@@ -1,144 +0,0 @@
1
- <?php
2
- /**
3
- * Magento
4
- *
5
- * NOTICE OF LICENSE
6
- *
7
- * This source file is subject to the Academic Free License (AFL 3.0)
8
- * that is bundled with this package in the file LICENSE_AFL.txt.
9
- * It is also available through the world-wide-web at this URL:
10
- * http://opensource.org/licenses/afl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@magentocommerce.com so we can send you a copy immediately.
14
- *
15
- * DISCLAIMER
16
- *
17
- * Do not edit or add to this file if you wish to upgrade Magento to newer
18
- * versions in the future. If you wish to customize Magento for your
19
- * needs please refer to http://www.magentocommerce.com for more information.
20
- *
21
- * @category design
22
- * @package rwd_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
- * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
- */
26
- /* @var $this Mage_Sendfriend_Block_Send */
27
- /**
28
- * Send to friend form
29
- *
30
- * @see Mage_Sendfriend_Block_Send
31
- */
32
- ?>
33
- <script type="text/javascript">
34
- //<![CDATA[
35
- i=0;
36
- var recipCount = 1;
37
- var maxRecip = <?php echo $this->getMaxRecipients() ?>;
38
- function remove_recipient(i){
39
- $('recipients_name'+i).up(2).remove();
40
- recipCount--;
41
- if(recipCount<maxRecip && maxRecip != 0) {
42
- $('add_recipient_button').show();
43
- $('max_recipient_message').hide();
44
- }
45
- return false;
46
- }
47
-
48
- function add_recipient(){
49
- ul = $('recipients_options');
50
- var li_mail = Element.extend(document.createElement("LI"));
51
- li_mail.addClassName('fields additional-row');
52
- li_mail.innerHTML = '<p><a href="delete_email" title="<?php echo $this->jsQuoteEscape($this->__('Remove Email')) ?>" onclick="remove_recipient('+i+'); return false" class="btn-remove"><?php echo $this->jsQuoteEscape($this->__('Remove Email')) ?>"<\/a><\/p>'
53
- li_mail.innerHTML += '<div class="field"><label for="recipients_name'+i+'" class="required"><em>*<\/em><?php echo $this->jsQuoteEscape($this->__('Name:')) ?><\/label><div class="input-box"><input name="recipients[name][]" type="text" class="input-text required-entry" id="recipients_name'+i+'" /><\/div>';
54
- li_mail.innerHTML += '<div class="field"><label for="recipients_email'+i+'" class="required"><em>*<\/em><?php echo $this->jsQuoteEscape($this->__('Email Address:')) ?><\/label><div class="input-box"><input name="recipients[email][]" value="" title="<?php echo $this->jsQuoteEscape($this->__('Email Address')) ?>" id="recipients_email'+i+'" type="text" class="input-text required-entry validate-email" /><\/div><\/div>';
55
- i++;
56
- recipCount++;
57
- if(recipCount>=maxRecip && maxRecip != 0) {
58
- $('add_recipient_button').hide();
59
- $('max_recipient_message').show();
60
- }
61
-
62
- ul.appendChild(li_mail);
63
- }
64
- //]]>
65
- </script>
66
-
67
- <div class="send-friend">
68
- <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
69
- <div class="page-title">
70
- <h1><?php echo $this->__('Email to a Friend') ?></h1>
71
- </div>
72
- <form action="<?php echo $this->getSendUrl() ?>" method="post" id="product_sendtofriend_form">
73
- <div class="fieldset">
74
- <?php echo $this->getBlockHtml('formkey')?>
75
- <h2 class="legend"><?php echo $this->__('Sender:') ?></h2>
76
- <ul class="form-list" id="sender_options">
77
- <li class="fields">
78
- <div class="field">
79
- <label for="sender_name" class="required"><em>*</em><?php echo $this->__('Name:') ?></label>
80
- <div class="input-box">
81
- <input name="sender[name]" value="<?php echo $this->escapeHtml($this->getUserName()) ?>" title="<?php echo $this->__('Name') ?>" id="sender_name" type="text" class="input-text required-entry" />
82
- </div>
83
- </div>
84
- <div class="field">
85
- <label for="sender_email" class="required"><em>*</em><?php echo $this->__('Email:') ?></label>
86
- <div class="input-box">
87
- <input name="sender[email]" value="<?php echo $this->escapeHtml($this->getEmail()) ?>" title="<?php echo $this->__('Email Address') ?>" id="sender_email" type="email" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-email" />
88
- </div>
89
- </div>
90
- </li>
91
- <li class="wide">
92
- <label for="sender_message" class="required"><em>*</em><?php echo $this->__('Message:') ?></label>
93
- <div class="input-box">
94
- <textarea name="sender[message]" class="input-text required-entry" id="sender_message" cols="3" rows="3"><?php echo $this->escapeHtml($this->getMessage())?></textarea>
95
- </div>
96
- </li>
97
- </ul>
98
- </div>
99
- <div class="fieldset">
100
- <h2 class="legend"><?php echo $this->__('Recipient:') ?></h2>
101
- <ul class="form-list" id="recipients_options">
102
- <li class="fields">
103
- <div class="field">
104
- <label for="recipients_name" class="required"><em>*</em><?php echo $this->__('Name:') ?></label>
105
- <div class="input-box">
106
- <input name="recipients[name][]" type="text" class="input-text required-entry" id="recipients_name" />
107
- </div>
108
- </div>
109
- <div class="field">
110
- <label for="recipients_email" class="required"><em>*</em><?php echo $this->__('Email Address:') ?></label>
111
- <div class="input-box">
112
- <input name="recipients[email][]" value="" title="<?php echo $this->__('Email Address') ?>" id="recipients_email" type="email" autocapitalize="off" autocorrect="off" spellcheck="false" class="input-text required-entry validate-email" />
113
- </div>
114
- </div>
115
- </li>
116
- </ul>
117
- </div>
118
- <?php echo $this->getChildHtml('studioforty9.recaptcha.explicit'); ?>
119
- <div class="buttons-set">
120
- <p class="back-link"><a href="#" onclick="history.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
121
- <button type="submit" class="button<?php if (!$this->canSend()):?> disabled<?php endif ?>"<?php if (!$this->canSend()):?> disabled="disabled"<?php endif ?>><span><span><?php echo $this->__('Send Email') ?></span></span></button>
122
- <div id="max_recipient_message" style="display:none;">
123
- <?php if ($this->getMaxRecipients()): ?>
124
- <p class="limit"><?php echo $this->__('Maximum %d email addresses allowed.', $this->getMaxRecipients()) ?></p>
125
- <?php endif; ?>
126
- </div>
127
- <?php if (1 < $this->getMaxRecipients()): ?>
128
- <p id="add_recipient_button">
129
- <button type="button" onclick="add_recipient();" class="button"><span><span><?php echo $this->__('Add Recipient') ?></span></span></button>
130
- </p>
131
- <?php endif; ?>
132
- </div>
133
- </form>
134
- <script type="text/javascript">
135
- //<![CDATA[
136
- var productSendtofriendForm = new VarienForm('product_sendtofriend_form');
137
- productSendtofriendForm.submit = function() {
138
- if(this.validator.validate()) {
139
- this.form.submit();
140
- }
141
- }.bind(productSendtofriendForm);
142
- //]]>
143
- </script>
144
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/etc/modules/Studioforty9_Recaptcha.xml CHANGED
@@ -8,7 +8,7 @@
8
  * @author StudioForty9 <info@studioforty9.com>
9
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
10
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
11
- * @version 1.2.0
12
  * @link https://github.com/studioforty9/recaptcha
13
  */
14
  -->
8
  * @author StudioForty9 <info@studioforty9.com>
9
  * @copyright 2015 StudioForty9 (http://www.studioforty9.com)
10
  * @license https://github.com/studioforty9/recaptcha/blob/master/LICENCE BSD
11
+ * @version 1.5.0
12
  * @link https://github.com/studioforty9/recaptcha
13
  */
14
  -->
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Studioforty9_Recaptcha</name>
4
- <version>1.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/BSD-3-Clause">BSDL</license>
7
  <channel>community</channel>
@@ -36,11 +36,11 @@
36
  &lt;li&gt;Under 'Adding reCAPTCHA to your site' you should see 'Keys', specifically your 'Site Key' and 'Secret Key', copy and paste both keys into their respective configuration fields under 'System -&amp;gt; Configuration -&amp;gt; Sales -&amp;gt; Google API -&amp;gt; Google ReCaptcha'.&lt;/li&gt;&#xD;
37
  &lt;li&gt;&lt;a href="https://drive.google.com/file/d/0B3hRj4-KZpxMRkJEZ0JFeGNRM2c/view?usp=sharing"&gt;Follow the instructions here.&lt;/a&gt;&lt;/li&gt;&#xD;
38
  &lt;/ol&gt;</description>
39
- <notes>Tested on Magento versions: 1.7.0.2, 1.8.0.0, 1.8.1.0, 1.9.0.1 and 1.9.1.0. See https://travis-ci.org/StudioForty9/Recaptcha for more.</notes>
40
  <authors><author><name>StudioForty9</name><user>SF9</user><email>info@studioforty9.com</email></author><author><name>Eoghan O'Brien</name><user>eoghanobrien</user><email>eoghan@studioforty9.com</email></author></authors>
41
- <date>2015-11-23</date>
42
- <time>17:25:31</time>
43
- <contents><target name="magecommunity"><dir name="Studioforty9"><dir name="Recaptcha"><dir name="Block"><file name="Autorender.php" hash="3df0dfcfb1ba0f0b3f5d32e31f3cc518"/><file name="Explicit.php" hash="649ff1a9de638588bf572db9b9512f18"/></dir><dir name="Helper"><file name="Data.php" hash="763de6e020251c35daa38c071ec96df9"/><file name="Request.php" hash="e6b95473f655f4d257c4190aa0d4c47f"/><file name="Response.php" hash="0f1eddc9990edeb4888b7539c5b8d593"/></dir><dir name="Model"><file name="Observer.php" hash="13950565f0d6aa220795b3d428ce5775"/><dir name="Source"><file name="Theme.php" hash="56ae66ec779f3cc00b6924f949ac4622"/></dir></dir><dir name="etc"><file name="config.xml" hash="ac7337edd5b3d6a20f15b439ffe3aea5"/><file name="system.xml" hash="2be67850cc9a964bb09d1cbadc26bd59"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="studioforty9_recaptcha.xml" hash="f8ae24e28f183c843e6cec09ad7019c6"/></dir><dir name="template"><dir name="studioforty9"><dir name="recaptcha"><file name="autorender.phtml" hash="4f616a52fe671f9f6346347427f7b35b"/><file name="explicit.phtml" hash="b30f113ba2a141d6e0bc8a5eb351bfe0"/><dir name="samples"><dir name="base"><dir name="contacts"><file name="form.phtml" hash="d5b584b9863a06fe7adab490584b7e89"/></dir><dir name="persistent"><dir name="customer"><dir name="form"><file name="register.phtml" hash="2d899bd409bad8762b29fee173133858"/></dir></dir></dir><dir name="review"><file name="form.phtml" hash="7be198faa94a0f2b9b1f859f0605adaf"/></dir><dir name="sendfriend"><file name="send.phtml" hash="80d86c444318d2ba30912619653044fb"/></dir></dir><dir name="rwd"><dir name="contacts"><file name="form.phtml" hash="5e32e7445434930b51a86747ecebf553"/></dir><dir name="customer"><dir name="form"><file name="register.phtml" hash="13fa3ff4732b01ebabb382da4b710c21"/></dir></dir><dir name="review"><file name="form.phtml" hash="e4df65a5b3022d8a80f11647c7475cfa"/></dir><dir name="sendfriend"><file name="send.phtml" hash="3adf035329dc6c6cf01a7712cd707760"/></dir></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Studioforty9_Recaptcha.csv" hash="6387abc316e524840fa3b1fcc49dc25d"/></dir></target><target name="mageetc"><dir name="modules"><file name="Studioforty9_Recaptcha.xml" hash="4ea774e9a930bddc77ab8d408b81e008"/></dir></target></contents>
44
  <compatible/>
45
- <dependencies><required><php><min>5.3.0</min><max>5.5.99</max></php></required></dependencies>
46
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Studioforty9_Recaptcha</name>
4
+ <version>1.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/BSD-3-Clause">BSDL</license>
7
  <channel>community</channel>
36
  &lt;li&gt;Under 'Adding reCAPTCHA to your site' you should see 'Keys', specifically your 'Site Key' and 'Secret Key', copy and paste both keys into their respective configuration fields under 'System -&amp;gt; Configuration -&amp;gt; Sales -&amp;gt; Google API -&amp;gt; Google ReCaptcha'.&lt;/li&gt;&#xD;
37
  &lt;li&gt;&lt;a href="https://drive.google.com/file/d/0B3hRj4-KZpxMRkJEZ0JFeGNRM2c/view?usp=sharing"&gt;Follow the instructions here.&lt;/a&gt;&lt;/li&gt;&#xD;
38
  &lt;/ol&gt;</description>
39
+ <notes>Tested on Magento versions: 1.7.0.2, 1.8.0.0, 1.8.1.0, 1.9.0.1, 1.9.1.0 and 1.9.2.4. See https://travis-ci.org/StudioForty9/Recaptcha for more.</notes>
40
  <authors><author><name>StudioForty9</name><user>SF9</user><email>info@studioforty9.com</email></author><author><name>Eoghan O'Brien</name><user>eoghanobrien</user><email>eoghan@studioforty9.com</email></author></authors>
41
+ <date>2016-05-18</date>
42
+ <time>01:53:46</time>
43
+ <contents><target name="magecommunity"><dir name="Studioforty9"><dir name="Recaptcha"><dir name="Block"><file name="Explicit.php" hash="5375c366f26cf59f9f6115a0bb2ec652"/></dir><dir name="Helper"><file name="Data.php" hash="da52d3d7828f04e5c7e6db81567a2bbe"/><file name="Redirect.php" hash="3a0dfe2a79bf395ba45edbca0ca16c55"/><file name="Request.php" hash="083e432d3b69f118e31e202d5d6bf529"/><file name="Response.php" hash="acc03647d3919ffaa4aa0f45e336bf94"/></dir><dir name="Model"><file name="Observer.php" hash="8425348550d576749457a8a5b21f2777"/><file name="Routes.php" hash="09a7359d55f75d8031d3ef29103c900a"/><dir name="Source"><file name="Routes.php" hash="13d8dbd74b117203da1d7ca385f82b01"/><file name="Size.php" hash="dc1b9c0190fde703bd4ffd45c7bd87fa"/><file name="Theme.php" hash="5f8d4d6be9ba357072e5173d0c50d8ec"/><file name="Type.php" hash="aa36c2f38ce52abefad917dcc5d035ef"/></dir></dir><dir name="data"><dir name="studioforty9_recaptcha_setup"><file name="data-upgrade-1.2.0-1.5.0.php" hash="bbda9e75bb6044cddaec70331c8895b3"/></dir></dir><dir name="etc"><file name="config.xml" hash="114abb74ba67a68fb89b561194388c4f"/><file name="system.xml" hash="f33c38c12c4394045d2d61327663d0fe"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="studioforty9_recaptcha.xml" hash="21c5dea497e5a7e57e96e021baae1267"/></dir><dir name="template"><dir name="studioforty9"><dir name="recaptcha"><file name="explicit.phtml" hash="82981eae34dd665ab3554182e7662e01"/></dir></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Studioforty9_Recaptcha.csv" hash="6387abc316e524840fa3b1fcc49dc25d"/></dir></target><target name="mageetc"><dir name="modules"><file name="Studioforty9_Recaptcha.xml" hash="60fdb87cce48c569c234971b230010a0"/></dir></target></contents>
44
  <compatible/>
45
+ <dependencies><required><php><min>5.3.0</min><max>7.9.99</max></php></required></dependencies>
46
  </package>