Version Notes
Bugs from 1.0.0 were fixed.
Download this release
Release Info
Developer | Magento Core Team |
Extension | Fontis_Recaptcha |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.1.0
- app/code/community/Fontis/Recaptcha/controllers/AccountController.php +6 -4
- app/code/community/Fontis/Recaptcha/controllers/ContactsController.php +15 -7
- app/code/community/Fontis/Recaptcha/controllers/ProductController.php +16 -6
- app/code/community/Fontis/Recaptcha/etc/config.xml +3 -6
- app/code/community/Fontis/Recaptcha/etc/config.xml~ +108 -0
- app/code/community/Fontis/Recaptcha/etc/system.xml +10 -2
- app/design/frontend/default/default/layout/fontis_recaptcha.xml +42 -1
- app/design/frontend/default/default/template/fontis/recaptcha/form.phtml +7 -2
- app/design/frontend/default/default/template/fontis/recaptcha/send.phtml +8 -3
- app/etc/modules/Fontis_Recaptcha.xml +1 -1
- package.xml +7 -7
app/code/community/Fontis/Recaptcha/controllers/AccountController.php
CHANGED
@@ -105,12 +105,14 @@ class Fontis_Recaptcha_AccountController extends Mage_Customer_AccountController
|
|
105 |
}
|
106 |
$this->_redirectError(Mage::getUrl('*/*/create', array('_secure'=>true)));
|
107 |
}else{ // if recaptcha response is incorrect, reload the page
|
108 |
-
|
109 |
-
|
|
|
|
|
110 |
}
|
111 |
} else { // if recaptcha is not enabled, use core function alone
|
112 |
-
parent::
|
113 |
}
|
114 |
}
|
115 |
}
|
116 |
-
?>
|
105 |
}
|
106 |
$this->_redirectError(Mage::getUrl('*/*/create', array('_secure'=>true)));
|
107 |
}else{ // if recaptcha response is incorrect, reload the page
|
108 |
+
$this->_getSession()->addError($this->__('Your reCAPTCHA entry is incorrect. Please try again.'));
|
109 |
+
$this->_getSession()->setCustomerFormData($this->getRequest()->getPost());
|
110 |
+
$this->_redirectReferer();
|
111 |
+
return;
|
112 |
}
|
113 |
} else { // if recaptcha is not enabled, use core function alone
|
114 |
+
parent::createPostAction();
|
115 |
}
|
116 |
}
|
117 |
}
|
118 |
+
?>
|
app/code/community/Fontis/Recaptcha/controllers/ContactsController.php
CHANGED
@@ -22,10 +22,16 @@
|
|
22 |
include_once "Mage/Contacts/controllers/IndexController.php";
|
23 |
|
24 |
class Fontis_Recaptcha_ContactsController extends Mage_Contacts_IndexController
|
25 |
-
{
|
|
|
26 |
public function postAction()
|
27 |
{
|
28 |
-
if (Mage::getStoreConfig("
|
|
|
|
|
|
|
|
|
|
|
29 |
// get private key from system configuration
|
30 |
$privatekey = Mage::getStoreConfig("admin/recaptcha/private_key");
|
31 |
// check response
|
@@ -34,8 +40,9 @@ class Fontis_Recaptcha_ContactsController extends Mage_Contacts_IndexController
|
|
34 |
$_POST["recaptcha_challenge_field"],
|
35 |
$_POST["recaptcha_response_field"]
|
36 |
);
|
|
|
|
|
37 |
if ($resp == true) { // if recaptcha response is correct, follow core functionality
|
38 |
-
$post = $this->getRequest()->getPost();
|
39 |
if ( $post ) {
|
40 |
$translate = Mage::getSingleton('core/translate');
|
41 |
/* @var $translate Mage_Core_Model_Translate */
|
@@ -75,7 +82,7 @@ class Fontis_Recaptcha_ContactsController extends Mage_Contacts_IndexController
|
|
75 |
return;
|
76 |
} catch (Exception $e) {
|
77 |
$translate->setTranslateInline(true);
|
78 |
-
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));
|
79 |
$this->_redirect('*/*/');
|
80 |
return;
|
81 |
}
|
@@ -83,12 +90,13 @@ class Fontis_Recaptcha_ContactsController extends Mage_Contacts_IndexController
|
|
83 |
$this->_redirect('*/*/');
|
84 |
}
|
85 |
}else{ // if recaptcha response is incorrect, reload the page
|
86 |
-
|
|
|
87 |
return;
|
88 |
}
|
89 |
} else { // if recaptcha is not enabled, use core function alone
|
90 |
-
parent::
|
91 |
}
|
92 |
}
|
93 |
}
|
94 |
-
?>
|
22 |
include_once "Mage/Contacts/controllers/IndexController.php";
|
23 |
|
24 |
class Fontis_Recaptcha_ContactsController extends Mage_Contacts_IndexController
|
25 |
+
{
|
26 |
+
|
27 |
public function postAction()
|
28 |
{
|
29 |
+
if (Mage::getStoreConfig("admin/recaptcha/when_loggedin"))
|
30 |
+
$logged_out = !(Mage::getSingleton('customer/session')->isLoggedIn());
|
31 |
+
else
|
32 |
+
$logged_out = true;
|
33 |
+
|
34 |
+
if (Mage::getStoreConfig("contacts/recaptcha/enabled") && $logged_out) { // check that recaptcha is actually enabled
|
35 |
// get private key from system configuration
|
36 |
$privatekey = Mage::getStoreConfig("admin/recaptcha/private_key");
|
37 |
// check response
|
40 |
$_POST["recaptcha_challenge_field"],
|
41 |
$_POST["recaptcha_response_field"]
|
42 |
);
|
43 |
+
$post = $this->getRequest()->getPost();
|
44 |
+
|
45 |
if ($resp == true) { // if recaptcha response is correct, follow core functionality
|
|
|
46 |
if ( $post ) {
|
47 |
$translate = Mage::getSingleton('core/translate');
|
48 |
/* @var $translate Mage_Core_Model_Translate */
|
82 |
return;
|
83 |
} catch (Exception $e) {
|
84 |
$translate->setTranslateInline(true);
|
85 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later.'));
|
86 |
$this->_redirect('*/*/');
|
87 |
return;
|
88 |
}
|
90 |
$this->_redirect('*/*/');
|
91 |
}
|
92 |
}else{ // if recaptcha response is incorrect, reload the page
|
93 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Your reCAPTCHA entry is incorrect. Please try again.'));
|
94 |
+
$this->_redirect('contacts/');
|
95 |
return;
|
96 |
}
|
97 |
} else { // if recaptcha is not enabled, use core function alone
|
98 |
+
parent::postAction();
|
99 |
}
|
100 |
}
|
101 |
}
|
102 |
+
?>
|
app/code/community/Fontis/Recaptcha/controllers/ProductController.php
CHANGED
@@ -24,8 +24,13 @@ include_once "Mage/Sendfriend/controllers/ProductController.php";
|
|
24 |
class Fontis_Recaptcha_ProductController extends Mage_Sendfriend_ProductController
|
25 |
{
|
26 |
public function sendmailAction()
|
27 |
-
{
|
28 |
-
if (Mage::getStoreConfig("
|
|
|
|
|
|
|
|
|
|
|
29 |
// get private key from system configuration
|
30 |
$privatekey = Mage::getStoreConfig("admin/recaptcha/private_key");
|
31 |
// check response
|
@@ -34,10 +39,13 @@ class Fontis_Recaptcha_ProductController extends Mage_Sendfriend_ProductControll
|
|
34 |
$_POST["recaptcha_challenge_field"],
|
35 |
$_POST["recaptcha_response_field"]
|
36 |
);
|
|
|
|
|
|
|
|
|
|
|
37 |
if ($resp == true) { // if recaptcha response is correct, follow core functionality
|
38 |
-
|
39 |
-
$sendToFriendModel = $this->_initSendToFriendModel();
|
40 |
-
$data = $this->getRequest()->getPost();
|
41 |
if (!$product || !$product->isVisibleInCatalog() || !$data) {
|
42 |
$this->_forward('noRoute');
|
43 |
return;
|
@@ -76,6 +84,8 @@ class Fontis_Recaptcha_ProductController extends Mage_Sendfriend_ProductControll
|
|
76 |
}
|
77 |
$this->_redirectError(Mage::getURL('*/*/send',array('id'=>$product->getId())));
|
78 |
} else { // if recaptcha response is incorrect, reload the page
|
|
|
|
|
79 |
$this->_redirectReferer();
|
80 |
return;
|
81 |
}
|
@@ -84,4 +94,4 @@ class Fontis_Recaptcha_ProductController extends Mage_Sendfriend_ProductControll
|
|
84 |
}
|
85 |
}
|
86 |
}
|
87 |
-
?>
|
24 |
class Fontis_Recaptcha_ProductController extends Mage_Sendfriend_ProductController
|
25 |
{
|
26 |
public function sendmailAction()
|
27 |
+
{
|
28 |
+
if (Mage::getStoreConfig("admin/recaptcha/when_loggedin"))
|
29 |
+
$logged_out = !(Mage::getSingleton('customer/session')->isLoggedIn());
|
30 |
+
else
|
31 |
+
$logged_out = true;
|
32 |
+
|
33 |
+
if (Mage::getStoreConfig("sendfriend/recaptcha/enabled") && $logged_out) { // check that recaptcha is actually enabled
|
34 |
// get private key from system configuration
|
35 |
$privatekey = Mage::getStoreConfig("admin/recaptcha/private_key");
|
36 |
// check response
|
39 |
$_POST["recaptcha_challenge_field"],
|
40 |
$_POST["recaptcha_response_field"]
|
41 |
);
|
42 |
+
|
43 |
+
$product = $this->_initProduct();
|
44 |
+
$sendToFriendModel = $this->_initSendToFriendModel();
|
45 |
+
$data = $this->getRequest()->getPost();
|
46 |
+
|
47 |
if ($resp == true) { // if recaptcha response is correct, follow core functionality
|
48 |
+
|
|
|
|
|
49 |
if (!$product || !$product->isVisibleInCatalog() || !$data) {
|
50 |
$this->_forward('noRoute');
|
51 |
return;
|
84 |
}
|
85 |
$this->_redirectError(Mage::getURL('*/*/send',array('id'=>$product->getId())));
|
86 |
} else { // if recaptcha response is incorrect, reload the page
|
87 |
+
Mage::getSingleton('catalog/session')->addError($this->__('Your reCAPTCHA entry is incorrect. Please try again.'));
|
88 |
+
Mage::getSingleton('catalog/session')->setFormData($data);
|
89 |
$this->_redirectReferer();
|
90 |
return;
|
91 |
}
|
94 |
}
|
95 |
}
|
96 |
}
|
97 |
+
?>
|
app/code/community/Fontis/Recaptcha/etc/config.xml
CHANGED
@@ -24,7 +24,7 @@
|
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Fontis_Recaptcha>
|
27 |
-
<version>1.
|
28 |
</Fontis_Recaptcha>
|
29 |
</modules>
|
30 |
<global>
|
@@ -44,11 +44,7 @@
|
|
44 |
<customer>
|
45 |
<rewrite>
|
46 |
<account>
|
47 |
-
|
48 |
-
<create>
|
49 |
-
<to>recaptcha/account/create</to>
|
50 |
-
</create>
|
51 |
-
</actions>
|
52 |
</account>
|
53 |
</rewrite>
|
54 |
</customer>
|
@@ -90,6 +86,7 @@
|
|
90 |
<public_key></public_key>
|
91 |
<private_key></private_key>
|
92 |
<recaptcha_theme>clean</recaptcha_theme>
|
|
|
93 |
</recaptcha>
|
94 |
</admin>
|
95 |
<sendfriend>
|
24 |
<config>
|
25 |
<modules>
|
26 |
<Fontis_Recaptcha>
|
27 |
+
<version>1.1.0</version>
|
28 |
</Fontis_Recaptcha>
|
29 |
</modules>
|
30 |
<global>
|
44 |
<customer>
|
45 |
<rewrite>
|
46 |
<account>
|
47 |
+
<to>recaptcha/account</to>
|
|
|
|
|
|
|
|
|
48 |
</account>
|
49 |
</rewrite>
|
50 |
</customer>
|
86 |
<public_key></public_key>
|
87 |
<private_key></private_key>
|
88 |
<recaptcha_theme>clean</recaptcha_theme>
|
89 |
+
<when_loggedin>1</when_loggedin>
|
90 |
</recaptcha>
|
91 |
</admin>
|
92 |
<sendfriend>
|
app/code/community/Fontis/Recaptcha/etc/config.xml~
ADDED
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<!--
|
3 |
+
/**
|
4 |
+
* Fontis Recaptcha Extension
|
5 |
+
*
|
6 |
+
* NOTICE OF LICENSE
|
7 |
+
*
|
8 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
9 |
+
* that is bundled with this package in the file LICENSE.txt.
|
10 |
+
* It is also available through the world-wide-web at this URL:
|
11 |
+
* http://opensource.org/licenses/osl-3.0.php
|
12 |
+
* If you did not receive a copy of the license and are unable to
|
13 |
+
* obtain it through the world-wide-web, please send an email
|
14 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
15 |
+
*
|
16 |
+
* @category Fontis
|
17 |
+
* @package Fontis_Recaptcha
|
18 |
+
* @author Denis Margetic
|
19 |
+
* @author Chris Norton
|
20 |
+
* @copyright Copyright (c) 2009 Fontis Pty. Ltd. (http://www.fontis.com.au)
|
21 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
22 |
+
*/
|
23 |
+
-->
|
24 |
+
<config>
|
25 |
+
<modules>
|
26 |
+
<Fontis_Recaptcha>
|
27 |
+
<version>1.0.0</version>
|
28 |
+
</Fontis_Recaptcha>
|
29 |
+
</modules>
|
30 |
+
<global>
|
31 |
+
<models>
|
32 |
+
<fontis_recaptcha>
|
33 |
+
<class>Fontis_Recaptcha_Model</class>
|
34 |
+
</fontis_recaptcha>
|
35 |
+
</models>
|
36 |
+
<routers>
|
37 |
+
<sendfriend>
|
38 |
+
<rewrite>
|
39 |
+
<product>
|
40 |
+
<to>recaptcha/product</to>
|
41 |
+
</product>
|
42 |
+
</rewrite>
|
43 |
+
</sendfriend>
|
44 |
+
<customer>
|
45 |
+
<rewrite>
|
46 |
+
<account>
|
47 |
+
<to>recaptcha/account</to>
|
48 |
+
</account>
|
49 |
+
</rewrite>
|
50 |
+
</customer>
|
51 |
+
<contacts>
|
52 |
+
<rewrite>
|
53 |
+
<index>
|
54 |
+
<to>recaptcha/contacts</to>
|
55 |
+
</index>
|
56 |
+
</rewrite>
|
57 |
+
</contacts>
|
58 |
+
</routers>
|
59 |
+
<helpers>
|
60 |
+
<recaptcha>
|
61 |
+
<class>Fontis_Recaptcha_Helper</class>
|
62 |
+
</recaptcha>
|
63 |
+
</helpers>
|
64 |
+
</global>
|
65 |
+
<frontend>
|
66 |
+
<routers>
|
67 |
+
<recaptcha>
|
68 |
+
<use>standard</use>
|
69 |
+
<args>
|
70 |
+
<module>Fontis_Recaptcha</module>
|
71 |
+
<frontName>recaptcha</frontName>
|
72 |
+
</args>
|
73 |
+
</recaptcha>
|
74 |
+
</routers>
|
75 |
+
<layout>
|
76 |
+
<updates>
|
77 |
+
<recaptcha module="Fontis_Recaptcha">
|
78 |
+
<file>fontis_recaptcha.xml</file>
|
79 |
+
</recaptcha>
|
80 |
+
</updates>
|
81 |
+
</layout>
|
82 |
+
</frontend>
|
83 |
+
<default>
|
84 |
+
<admin>
|
85 |
+
<recaptcha>
|
86 |
+
<public_key></public_key>
|
87 |
+
<private_key></private_key>
|
88 |
+
<recaptcha_theme>clean</recaptcha_theme>
|
89 |
+
<when_loggedin>1</when_loggedin>
|
90 |
+
</recaptcha>
|
91 |
+
</admin>
|
92 |
+
<sendfriend>
|
93 |
+
<recaptcha>
|
94 |
+
<enabled>1</enabled>
|
95 |
+
</recaptcha>
|
96 |
+
</sendfriend>
|
97 |
+
<contacts>
|
98 |
+
<recaptcha>
|
99 |
+
<enabled>1</enabled>
|
100 |
+
</recaptcha>
|
101 |
+
</contacts>
|
102 |
+
<customer>
|
103 |
+
<recaptcha>
|
104 |
+
<enabled>1</enabled>
|
105 |
+
</recaptcha>
|
106 |
+
</customer>
|
107 |
+
</default>
|
108 |
+
</config>
|
app/code/community/Fontis/Recaptcha/etc/system.xml
CHANGED
@@ -36,14 +36,14 @@
|
|
36 |
<public_key translate="label">
|
37 |
<label>Public Key</label>
|
38 |
<frontend_type>text</frontend_type>
|
39 |
-
<sort_order>
|
40 |
<show_in_default>1</show_in_default>
|
41 |
<show_in_website>1</show_in_website>
|
42 |
</public_key>
|
43 |
<private_key translate="label">
|
44 |
<label>Private Key</label>
|
45 |
<frontend_type>text</frontend_type>
|
46 |
-
<sort_order>
|
47 |
<show_in_default>1</show_in_default>
|
48 |
<show_in_website>1</show_in_website>
|
49 |
</private_key>
|
@@ -55,6 +55,14 @@
|
|
55 |
<show_in_default>1</show_in_default>
|
56 |
<show_in_website>1</show_in_website>
|
57 |
</recaptcha_theme>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
</fields>
|
59 |
</recaptcha>
|
60 |
</groups>
|
36 |
<public_key translate="label">
|
37 |
<label>Public Key</label>
|
38 |
<frontend_type>text</frontend_type>
|
39 |
+
<sort_order>10</sort_order>
|
40 |
<show_in_default>1</show_in_default>
|
41 |
<show_in_website>1</show_in_website>
|
42 |
</public_key>
|
43 |
<private_key translate="label">
|
44 |
<label>Private Key</label>
|
45 |
<frontend_type>text</frontend_type>
|
46 |
+
<sort_order>11</sort_order>
|
47 |
<show_in_default>1</show_in_default>
|
48 |
<show_in_website>1</show_in_website>
|
49 |
</private_key>
|
55 |
<show_in_default>1</show_in_default>
|
56 |
<show_in_website>1</show_in_website>
|
57 |
</recaptcha_theme>
|
58 |
+
<when_loggedin translate="label">
|
59 |
+
<label>Disable When Authenticated</label>
|
60 |
+
<frontend_type>select</frontend_type>
|
61 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
62 |
+
<sort_order>2</sort_order>
|
63 |
+
<show_in_default>1</show_in_default>
|
64 |
+
<show_in_website>1</show_in_website>
|
65 |
+
</when_loggedin>
|
66 |
</fields>
|
67 |
</recaptcha>
|
68 |
</groups>
|
app/design/frontend/default/default/layout/fontis_recaptcha.xml
CHANGED
@@ -51,5 +51,46 @@
|
|
51 |
<reference name="content">
|
52 |
<block type="customer/form_register" name="customer_form_register" template="fontis/recaptcha/register.phtml"/>
|
53 |
</reference>
|
54 |
-
</recaptcha_account_create>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
</layout>
|
|
|
|
|
|
|
|
|
|
|
|
51 |
<reference name="content">
|
52 |
<block type="customer/form_register" name="customer_form_register" template="fontis/recaptcha/register.phtml"/>
|
53 |
</reference>
|
54 |
+
</recaptcha_account_create>
|
55 |
+
|
56 |
+
<!-- As Magento won't properly rewrite a single action in the controller, below handles update unchanged actions back to defaults -->
|
57 |
+
<recaptcha_account_login>
|
58 |
+
<update handle="customer_account_login"/>
|
59 |
+
</recaptcha_account_login>
|
60 |
+
<recaptcha_account_forgotpassword>
|
61 |
+
<update handle="customer_account_forgotpassword"/>
|
62 |
+
</recaptcha_account_forgotpassword>
|
63 |
+
<recaptcha_logged_in>
|
64 |
+
<update handle="customer_logged_in"/>
|
65 |
+
</recaptcha_logged_in>
|
66 |
+
<recaptcha_logged_out>
|
67 |
+
<update handle="customer_logged_out"/>
|
68 |
+
</recaptcha_logged_out>
|
69 |
+
<recaptcha_account_logoutsuccess>
|
70 |
+
<update handle="customer_account_logoutsuccess"/>
|
71 |
+
</recaptcha_account_logoutsuccess>
|
72 |
+
<recaptcha_account_confirmation>
|
73 |
+
<update handle="customer_account_confirmation"/>
|
74 |
+
</recaptcha_account_confirmation>
|
75 |
+
<recaptcha_account_edit>
|
76 |
+
<update handle="customer_account_edit"/>
|
77 |
+
</recaptcha_account_edit>
|
78 |
+
<recaptcha_account>
|
79 |
+
<update handle="customer_account"/>
|
80 |
+
</recaptcha_account>
|
81 |
+
<recaptcha_account_index>
|
82 |
+
<update handle="customer_account_index"/>
|
83 |
+
</recaptcha_account_index>
|
84 |
+
<recaptcha_address_index>
|
85 |
+
<update handle="customer_address_index"/>
|
86 |
+
</recaptcha_address_index>
|
87 |
+
<recaptcha_address_form>
|
88 |
+
<update handle="customer_address_form"/>
|
89 |
+
</recaptcha_address_form>
|
90 |
</layout>
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
|
app/design/frontend/default/default/template/fontis/recaptcha/form.phtml
CHANGED
@@ -56,8 +56,13 @@
|
|
56 |
</ul>
|
57 |
</fieldset>
|
58 |
|
59 |
-
<?php // recaptcha
|
60 |
-
if (Mage::getStoreConfig("
|
|
|
|
|
|
|
|
|
|
|
61 |
// set the recaptcha theme based on preferences
|
62 |
echo '<script> var RecaptchaOptions = { theme : \'';
|
63 |
echo Mage::getStoreConfig("admin/recaptcha/recaptcha_theme");
|
56 |
</ul>
|
57 |
</fieldset>
|
58 |
|
59 |
+
<?php // recaptcha
|
60 |
+
if (Mage::getStoreConfig("admin/recaptcha/when_loggedin"))
|
61 |
+
$logged_out = !(Mage::getSingleton('customer/session')->isLoggedIn());
|
62 |
+
else
|
63 |
+
$logged_out = true;
|
64 |
+
|
65 |
+
if (Mage::getStoreConfig("contacts/recaptcha/enabled") && $logged_out) {
|
66 |
// set the recaptcha theme based on preferences
|
67 |
echo '<script> var RecaptchaOptions = { theme : \'';
|
68 |
echo Mage::getStoreConfig("admin/recaptcha/recaptcha_theme");
|
app/design/frontend/default/default/template/fontis/recaptcha/send.phtml
CHANGED
@@ -96,7 +96,7 @@
|
|
96 |
<li>
|
97 |
<div class="left">
|
98 |
<label for="recipients_name"><?php echo $this->__('Name:') ?> <span class="required">*</span></label><br/>
|
99 |
-
<div style="width:250px"><input name="recipients[name][]"
|
100 |
</div>
|
101 |
<div class="right">
|
102 |
<label for="recipients_email"><?php echo $this->__('Email Address:') ?> <span class="required">*</span></label><br/>
|
@@ -120,8 +120,13 @@
|
|
120 |
|
121 |
</div>
|
122 |
|
123 |
-
<?php // recaptcha
|
124 |
-
if (Mage::getStoreConfig("
|
|
|
|
|
|
|
|
|
|
|
125 |
// set the recaptcha theme based on preferences
|
126 |
echo '<script> var RecaptchaOptions = { theme : \'';
|
127 |
echo Mage::getStoreConfig("admin/recaptcha/recaptcha_theme");
|
96 |
<li>
|
97 |
<div class="left">
|
98 |
<label for="recipients_name"><?php echo $this->__('Name:') ?> <span class="required">*</span></label><br/>
|
99 |
+
<div style="width:250px"><input name="recipients[name][]" type="text" class="input-text required-entry" id="recipients_name" style="width:250px;" /></div><br /><br />
|
100 |
</div>
|
101 |
<div class="right">
|
102 |
<label for="recipients_email"><?php echo $this->__('Email Address:') ?> <span class="required">*</span></label><br/>
|
120 |
|
121 |
</div>
|
122 |
|
123 |
+
<?php // recaptcha
|
124 |
+
if (Mage::getStoreConfig("admin/recaptcha/when_loggedin"))
|
125 |
+
$logged_out = !(Mage::getSingleton('customer/session')->isLoggedIn());
|
126 |
+
else
|
127 |
+
$logged_out = true;
|
128 |
+
|
129 |
+
if (Mage::getStoreConfig("sendfriend/recaptcha/enabled") && $logged_out) {
|
130 |
// set the recaptcha theme based on preferences
|
131 |
echo '<script> var RecaptchaOptions = { theme : \'';
|
132 |
echo Mage::getStoreConfig("admin/recaptcha/recaptcha_theme");
|
app/etc/modules/Fontis_Recaptcha.xml
CHANGED
@@ -28,4 +28,4 @@
|
|
28 |
<codePool>community</codePool>
|
29 |
</Fontis_Recaptcha>
|
30 |
</modules>
|
31 |
-
</config>
|
28 |
<codePool>community</codePool>
|
29 |
</Fontis_Recaptcha>
|
30 |
</modules>
|
31 |
+
</config>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fontis_Recaptcha</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Adds reCAPTCHA to
|
10 |
-
<description>Adds reCAPTCHA to
|
11 |
-
<notes>
|
12 |
<authors><author><name>Chris Norton</name><user>auto-converted</user><email>chris.norton@fontis.com.au</email></author></authors>
|
13 |
-
<date>2009-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magecommunity"><dir name="Fontis"><dir name="Recaptcha"><dir name="controllers"><file name="AccountController.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Fontis_Recaptcha</name>
|
4 |
+
<version>1.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Adds reCAPTCHA to "Send Email to a Friend", "Contact Us" and "Account Creation" pages.</summary>
|
10 |
+
<description>Adds reCAPTCHA to "Send Email to a Friend", "Contact Us" and "Account Creation" pages. Allows for reCAPTCHA to be disabled for logged in customers</description>
|
11 |
+
<notes>Bugs from 1.0.0 were fixed.</notes>
|
12 |
<authors><author><name>Chris Norton</name><user>auto-converted</user><email>chris.norton@fontis.com.au</email></author></authors>
|
13 |
+
<date>2009-05-03</date>
|
14 |
+
<time>23:35:31</time>
|
15 |
+
<contents><target name="magecommunity"><dir name="Fontis"><dir name="Recaptcha"><dir name="controllers"><file name="AccountController.php" hash="fae316312304c109f0cd174bf6f53538"/><file name="ContactsController.php" hash="7f4dc296ac8764fc7e416e3cfd0e163c"/><file name="ProductController.php" hash="944478251b8b753b433eb32c3d01228d"/></dir><dir name="etc"><file name="config.xml" hash="509b955b8288e56f615781772550a97b"/><file name="config.xml~" hash="c8712062ce6c681e173c3e0a5cf47fb4"/><file name="system.xml" hash="29d0a2917cc62ec7ef371946c496972c"/></dir><dir name="Helper"><file name="Data.php" hash="d73a2b15052d0a20c8224ddb1b56b4b7"/></dir><dir name="Model"><dir name="Source"><file name="Recaptchatheme.php" hash="362f8164db8e42e114d868b6fe01c83d"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="fontis_recaptcha.xml" hash="ba5829e56bd28a218e86761290f04c82"/></dir><dir name="template"><dir name="fontis"><dir name="recaptcha"><file name="form.phtml" hash="6ef3ce431a9390bdf2b1d12666fac3f7"/><file name="register.phtml" hash="e731fb6b8ab7b7b2e54d715c1b42393f"/><file name="send.phtml" hash="f2efbe80513c0711c7ded37c40e77e13"/></dir></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Fontis_Recaptcha.xml" hash="a08a1a2730c4345fb78e78c7b1176ffd"/></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|