Version Notes
Stable release - Magento now has an easy, free of charge, anti-spam extension.
- spam stopped in the contact form
- spam stopped in the product reviews pages
Download this release
Release Info
Developer | Jim Gilbert |
Extension | moogento_nomorespam |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.2
- app/code/local/Moogento/NoMoreSpam/Block/Adminhtml/System/Config/Fieldset/Hint.php +0 -102
- app/code/local/Moogento/NoMoreSpam/Block/Nomorespam.php +0 -41
- app/code/local/Moogento/NoMoreSpam/Helper/Data.php +0 -93
- app/code/local/Moogento/NoMoreSpam/Model/NoMoreSpam.php +0 -34
- app/code/local/Moogento/NoMoreSpam/Model/Status.php +0 -39
- app/code/local/Moogento/NoMoreSpam/controllers/IndexController.php +0 -118
- app/code/local/Moogento/NoMoreSpam/controllers/Review/ProductController.php +0 -115
- app/code/local/Moogento/NoMoreSpam/etc/adminhtml.xml +0 -48
- app/code/local/Moogento/NoMoreSpam/etc/config.xml +0 -138
- app/code/local/Moogento/NoMoreSpam/etc/system.xml +0 -101
- app/design/adminhtml/default/default/layout/moogento/nomorespam.xml +0 -1
- app/design/frontend/default/default/layout/moogento/nomorespam.xml +2 -8
- app/design/frontend/default/default/template/nomorespam/nomorespam_contact.phtml +4 -4
- app/design/frontend/default/default/template/nomorespam/nomorespam_review.phtml +4 -4
- package.xml +8 -6
- skin/adminhtml/default/default/moogento/nomorespam/nomorespam.css +33 -5
app/code/local/Moogento/NoMoreSpam/Block/Adminhtml/System/Config/Fieldset/Hint.php
DELETED
@@ -1,102 +0,0 @@
|
|
1 |
-
<?php /**
|
2 |
-
* Moogento
|
3 |
-
*
|
4 |
-
* SOFTWARE LICENSE
|
5 |
-
*
|
6 |
-
* This source file is covered by the Moogento End User License Agreement
|
7 |
-
* that is bundled with this extension in the file License.html
|
8 |
-
* It is also available online here:
|
9 |
-
* http://www.moogento.com/License.html
|
10 |
-
*
|
11 |
-
* NOTICE
|
12 |
-
*
|
13 |
-
* If you customize this file please remember that it will be overwrtitten
|
14 |
-
* with any future upgrade installs.
|
15 |
-
* If you'd like to add a feature which is not in this software, get in touch
|
16 |
-
* at www.moogento.com for a quote.
|
17 |
-
*
|
18 |
-
* ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
19 |
-
* File Hint.php
|
20 |
-
* @category Moogento
|
21 |
-
* @package noMoreSpam
|
22 |
-
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
-
* @license http://www.moogento.com/License.html
|
24 |
-
*/ ?>
|
25 |
-
<?php
|
26 |
-
|
27 |
-
class Moogento_NoMoreSpam_Block_Adminhtml_System_Config_Fieldset_Hint
|
28 |
-
extends Mage_Adminhtml_Block_Abstract
|
29 |
-
implements Varien_Data_Form_Element_Renderer_Interface {
|
30 |
-
|
31 |
-
protected $_template = 'moogento/nomorespam/system/config/fieldset/hint.phtml';
|
32 |
-
const ROUTE = 'no_more_spam';
|
33 |
-
const PATH = 'Moogento_NoMoreSpam';
|
34 |
-
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Render fieldset html
|
38 |
-
*
|
39 |
-
* @param Varien_Data_Form_Element_Abstract $element
|
40 |
-
* @return string
|
41 |
-
*/
|
42 |
-
public function render(Varien_Data_Form_Element_Abstract $element) {
|
43 |
-
return $this->toHtml();
|
44 |
-
}
|
45 |
-
|
46 |
-
public function checkMooLicense($input) {
|
47 |
-
$key_return = "aHR0cDovL2JpdC5seS80a2I3N3Y=";
|
48 |
-
return $key_return;
|
49 |
-
}
|
50 |
-
|
51 |
-
public function getMooVersion($e) {
|
52 |
-
return (string)Mage::getConfig()->getNode('modules/'.$e.'/version');
|
53 |
-
}
|
54 |
-
|
55 |
-
public function getMooo() {
|
56 |
-
$e = strtolower(substr(self::PATH, strpos(self::PATH, '_')+1,1));
|
57 |
-
$l = trim(Mage::getModel('core/config_data')->load(self::ROUTE.'/mood'.'etails/'.'lic'.'ense','path')->getValue());
|
58 |
-
$s = '';
|
59 |
-
if(isset($_SERVER['HTTP_HOST']))$s = $_SERVER['HTTP_HOST'];
|
60 |
-
return '.z'.strtr(base64_encode("$l~$e~$s"), '+/=', '-_,');
|
61 |
-
}
|
62 |
-
|
63 |
-
public function getInfoHtml()
|
64 |
-
{
|
65 |
-
try {
|
66 |
-
$zend_cache_backend = new Zend_Cache_Backend();
|
67 |
-
$cache = Zend_Cache::factory('Core', 'File', array('lifetime' => 86400), array('cache_dir' => $zend_cache_backend->getTmpDir()));
|
68 |
-
} catch (Exception $e) {
|
69 |
-
return null;
|
70 |
-
}
|
71 |
-
|
72 |
-
$dataModelName = @current($this->getGroup()->data_model);
|
73 |
-
$zend_cache_key = strtolower('moo_' . self::PATH . '_' . str_replace('.','',$this->getMooVersion(self::PATH)));
|
74 |
-
$cache_content = $cache->load($zend_cache_key);
|
75 |
-
$cache_content = false;
|
76 |
-
if ($cache_content !== false && $cache_content !== '') {
|
77 |
-
$return_html = $cache_content;
|
78 |
-
} else {
|
79 |
-
//return $zend_cache_key.':'.$dataModelName;
|
80 |
-
$dataModelName = 'nomorespam/adminhtml_system_config_backend_import_name';
|
81 |
-
try {
|
82 |
-
$dataModel = Mage::getSingleton($dataModelName);
|
83 |
-
$dataModel->afterLoad();
|
84 |
-
// Check for news updates
|
85 |
-
// http://www.moogento.com/media/info/
|
86 |
-
$zend_client = new Zend_Http_Client('ht' . 'tps://w' . 'ww.' . 'mo' . 'oge' . 'nto' . '.' . 'co' . 'm/med' . 'ia' .'/in' .'fo/te'.'xt.t'.'xt', array('timeout' => 8));
|
87 |
-
$zend_client->setParameterGet('x', $dataModel->getValue());
|
88 |
-
$response = $zend_client->request('GET');
|
89 |
-
$return_html = $response->getBody();
|
90 |
-
$cache->save($return_html, $zend_cache_key);
|
91 |
-
} catch (Exception $e) {
|
92 |
-
return null;
|
93 |
-
}
|
94 |
-
}
|
95 |
-
if(strpos($return_html,'has been an error') !== false) {
|
96 |
-
return null;
|
97 |
-
}
|
98 |
-
|
99 |
-
return $return_html;
|
100 |
-
}
|
101 |
-
}
|
102 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/Block/Nomorespam.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php /**
|
2 |
-
* Moogento
|
3 |
-
*
|
4 |
-
* SOFTWARE LICENSE
|
5 |
-
*
|
6 |
-
* This source file is covered by the Moogento End User License Agreement
|
7 |
-
* that is bundled with this extension in the file License.html
|
8 |
-
* It is also available online here:
|
9 |
-
* http://www.moogento.com/License.html
|
10 |
-
*
|
11 |
-
* NOTICE
|
12 |
-
*
|
13 |
-
* If you customize this file please remember that it will be overwrtitten
|
14 |
-
* with any future upgrade installs.
|
15 |
-
* If you'd like to add a feature which is not in this software, get in touch
|
16 |
-
* at www.moogento.com for a quote.
|
17 |
-
*
|
18 |
-
* ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
19 |
-
* File Nomorespam.php
|
20 |
-
* @category Moogento
|
21 |
-
* @package noMoreSpam
|
22 |
-
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
-
* @license http://www.moogento.com/License.html
|
24 |
-
*/ ?>
|
25 |
-
<?php
|
26 |
-
class Moogento_NoMoreSpam_Block_Nomorespam extends Mage_Core_Block_Template
|
27 |
-
{
|
28 |
-
public function _prepareLayout()
|
29 |
-
{
|
30 |
-
return parent::_prepareLayout();
|
31 |
-
}
|
32 |
-
|
33 |
-
public function getNoMoreSpam()
|
34 |
-
{
|
35 |
-
if (!$this->hasData('nomorespam')) {
|
36 |
-
$this->setData('nomorespam', Mage::registry('nomorespam'));
|
37 |
-
}
|
38 |
-
return $this->getData('nomorespam');
|
39 |
-
|
40 |
-
}
|
41 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/Helper/Data.php
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
<?php /**
|
2 |
-
* Moogento
|
3 |
-
*
|
4 |
-
* SOFTWARE LICENSE
|
5 |
-
*
|
6 |
-
* This source file is covered by the Moogento End User License Agreement
|
7 |
-
* that is bundled with this extension in the file License.html
|
8 |
-
* It is also available online here:
|
9 |
-
* http://www.moogento.com/License.html
|
10 |
-
*
|
11 |
-
* NOTICE
|
12 |
-
*
|
13 |
-
* If you customize this file please remember that it will be overwrtitten
|
14 |
-
* with any future upgrade installs.
|
15 |
-
* If you'd like to add a feature which is not in this software, get in touch
|
16 |
-
* at www.moogento.com for a quote.
|
17 |
-
*
|
18 |
-
* ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
19 |
-
* File Data.php
|
20 |
-
* @category Moogento
|
21 |
-
* @package noMoreSpam
|
22 |
-
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
-
* @license http://www.moogento.com/License.html
|
24 |
-
*/ ?>
|
25 |
-
<?php
|
26 |
-
|
27 |
-
class Moogento_NoMoreSpam_Helper_Data extends Mage_Core_Helper_Abstract
|
28 |
-
{
|
29 |
-
private function _crypto_rand_secure($min, $max) {
|
30 |
-
$range = $max - $min;
|
31 |
-
if ($range < 0) return $min; // not so random...
|
32 |
-
$log = log($range, 2);
|
33 |
-
$bytes = (int) ($log / 8) + 1; // length in bytes
|
34 |
-
$bits = (int) $log + 1; // length in bits
|
35 |
-
$filter = (int) (1 << $bits) - 1; // set all lower bits to 1
|
36 |
-
do {
|
37 |
-
$rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes)));
|
38 |
-
$rnd = $rnd & $filter; // discard irrelevant bits
|
39 |
-
} while ($rnd >= $range);
|
40 |
-
return $min + $rnd;
|
41 |
-
}
|
42 |
-
|
43 |
-
private function _getToken($length=32){
|
44 |
-
$token = "";
|
45 |
-
$codeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
46 |
-
$codeAlphabet.= "abcdefghijklmnopqrstuvwxyz";
|
47 |
-
$codeAlphabet.= "0123456789";
|
48 |
-
for($i=0;$i<$length;$i++){
|
49 |
-
$token .= $codeAlphabet[$this->_crypto_rand_secure(0,strlen($codeAlphabet))];
|
50 |
-
}
|
51 |
-
return $token;
|
52 |
-
}
|
53 |
-
private function _getGenerateText(){ //salt1
|
54 |
-
$generate_text = mage::getStoreConfig("no_more_spam/no_spam/generate_text");
|
55 |
-
if($generate_text==''){
|
56 |
-
$generate_text = $this->_getToken(6);
|
57 |
-
Mage::getModel('core/config')->saveConfig("no_more_spam/no_spam/generate_text", $generate_text );
|
58 |
-
}
|
59 |
-
return $generate_text;
|
60 |
-
}
|
61 |
-
private function _getRandomText(){ //salt2
|
62 |
-
$random_text = mage::getStoreConfig("no_more_spam/no_spam/random_text");
|
63 |
-
if($random_text==''){
|
64 |
-
$random_text = $this->_getToken(6);
|
65 |
-
Mage::getModel('core/config')->saveConfig("no_more_spam/no_spam/random_text", $random_text );
|
66 |
-
}
|
67 |
-
return $random_text;
|
68 |
-
}
|
69 |
-
public function createId(){
|
70 |
-
$prefix = "nms";
|
71 |
-
$salt1 = $this->_getGenerateText();
|
72 |
-
$id = $prefix . "_" . $salt1;
|
73 |
-
return $id;
|
74 |
-
}
|
75 |
-
public function createNameInput1(){
|
76 |
-
$prefix = "nms_rd";
|
77 |
-
$salt1 = $this->_getGenerateText();
|
78 |
-
$name = $prefix . "_" . $salt1;
|
79 |
-
return $name;
|
80 |
-
}
|
81 |
-
public function createNameInput2(){
|
82 |
-
$prefix = "nms_em";
|
83 |
-
$salt2 = $this->_getRandomText();
|
84 |
-
$name = $prefix . "_" . $salt2;
|
85 |
-
return $name;
|
86 |
-
}
|
87 |
-
public function createvalue(){
|
88 |
-
$salt1 = $this->_getGenerateText();
|
89 |
-
$salt2 = $this->_getRandomText();
|
90 |
-
$hash_result = hash("sha256", $salt2 . $salt1);
|
91 |
-
return $hash_result;
|
92 |
-
}
|
93 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/Model/NoMoreSpam.php
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<?php /**
|
2 |
-
* Moogento
|
3 |
-
*
|
4 |
-
* SOFTWARE LICENSE
|
5 |
-
*
|
6 |
-
* This source file is covered by the Moogento End User License Agreement
|
7 |
-
* that is bundled with this extension in the file License.html
|
8 |
-
* It is also available online here:
|
9 |
-
* http://www.moogento.com/License.html
|
10 |
-
*
|
11 |
-
* NOTICE
|
12 |
-
*
|
13 |
-
* If you customize this file please remember that it will be overwrtitten
|
14 |
-
* with any future upgrade installs.
|
15 |
-
* If you'd like to add a feature which is not in this software, get in touch
|
16 |
-
* at www.moogento.com for a quote.
|
17 |
-
*
|
18 |
-
* ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
19 |
-
* File NoMoreSpam.php
|
20 |
-
* @category Moogento
|
21 |
-
* @package noMoreSpam
|
22 |
-
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
-
* @license http://www.moogento.com/License.html
|
24 |
-
*/ ?>
|
25 |
-
<?php
|
26 |
-
|
27 |
-
class Moogento_NoMoreSpam_Model_NoMoreSpam extends Mage_Core_Model_Abstract
|
28 |
-
{
|
29 |
-
public function _construct()
|
30 |
-
{
|
31 |
-
parent::_construct();
|
32 |
-
$this->_init('nomorespam/nomorespam');
|
33 |
-
}
|
34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/Model/Status.php
DELETED
@@ -1,39 +0,0 @@
|
|
1 |
-
<?php /**
|
2 |
-
* Moogento
|
3 |
-
*
|
4 |
-
* SOFTWARE LICENSE
|
5 |
-
*
|
6 |
-
* This source file is covered by the Moogento End User License Agreement
|
7 |
-
* that is bundled with this extension in the file License.html
|
8 |
-
* It is also available online here:
|
9 |
-
* http://www.moogento.com/License.html
|
10 |
-
*
|
11 |
-
* NOTICE
|
12 |
-
*
|
13 |
-
* If you customize this file please remember that it will be overwrtitten
|
14 |
-
* with any future upgrade installs.
|
15 |
-
* If you'd like to add a feature which is not in this software, get in touch
|
16 |
-
* at www.moogento.com for a quote.
|
17 |
-
*
|
18 |
-
* ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
19 |
-
* File Status.php
|
20 |
-
* @category Moogento
|
21 |
-
* @package noMoreSpam
|
22 |
-
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
-
* @license http://www.moogento.com/License.html
|
24 |
-
*/ ?>
|
25 |
-
<?php
|
26 |
-
|
27 |
-
class Moogento_NoMoreSpam_Model_Status extends Varien_Object
|
28 |
-
{
|
29 |
-
const STATUS_ENABLED = 1;
|
30 |
-
const STATUS_DISABLED = 2;
|
31 |
-
|
32 |
-
static public function getOptionArray()
|
33 |
-
{
|
34 |
-
return array(
|
35 |
-
self::STATUS_ENABLED => Mage::helper('nomorespam')->__('Enabled'),
|
36 |
-
self::STATUS_DISABLED => Mage::helper('nomorespam')->__('Disabled')
|
37 |
-
);
|
38 |
-
}
|
39 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/controllers/IndexController.php
DELETED
@@ -1,118 +0,0 @@
|
|
1 |
-
<?php /**
|
2 |
-
* Moogento
|
3 |
-
*
|
4 |
-
* SOFTWARE LICENSE
|
5 |
-
*
|
6 |
-
* This source file is covered by the Moogento End User License Agreement
|
7 |
-
* that is bundled with this extension in the file License.html
|
8 |
-
* It is also available online here:
|
9 |
-
* http://www.moogento.com/License.html
|
10 |
-
*
|
11 |
-
* NOTICE
|
12 |
-
*
|
13 |
-
* If you customize this file please remember that it will be overwrtitten
|
14 |
-
* with any future upgrade installs.
|
15 |
-
* If you'd like to add a feature which is not in this software, get in touch
|
16 |
-
* at www.moogento.com for a quote.
|
17 |
-
*
|
18 |
-
* ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
19 |
-
* File IndexController.php
|
20 |
-
* @category Moogento
|
21 |
-
* @package noMoreSpam
|
22 |
-
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
-
* @license http://www.moogento.com/License.html
|
24 |
-
*/ ?>
|
25 |
-
<?php
|
26 |
-
require_once 'Mage/Contacts/controllers/IndexController.php';
|
27 |
-
class Moogento_NoMoreSpam_IndexController extends Mage_Contacts_IndexController
|
28 |
-
{
|
29 |
-
private function _getHashKey(){
|
30 |
-
$salt1 = mage::getStoreConfig("no_more_spam/no_spam/generate_text");
|
31 |
-
$salt2 = mage::getStoreConfig("no_more_spam/no_spam/random_text");
|
32 |
-
$hash_result = hash("sha256", $salt2 . $salt1);
|
33 |
-
return $hash_result;
|
34 |
-
}
|
35 |
-
private function _checkHashKey($key_form, $empty_key){
|
36 |
-
$hash_key = $this->_getHashKey();
|
37 |
-
$isKey = false;
|
38 |
-
if(($key_form==$hash_key) && $empty_key==''){
|
39 |
-
$isKey = true;
|
40 |
-
}
|
41 |
-
return $isKey;
|
42 |
-
}
|
43 |
-
|
44 |
-
public function postAction()
|
45 |
-
{
|
46 |
-
$post = $this->getRequest()->getPost();
|
47 |
-
$isKeyHash = false;
|
48 |
-
$random_text = Mage::helper("nomorespam")->createNameInput1();
|
49 |
-
$empty_text = Mage::helper("nomorespam")->createNameInput2();
|
50 |
-
if(isset($post[$random_text]) && isset($post[$empty_text])){
|
51 |
-
$isKeyHash = $this->_checkHashKey($post[$random_text], $post[$empty_text]);
|
52 |
-
}
|
53 |
-
$enable_email = mage::getStoreConfig("no_more_spam/no_spam/enabled_email");
|
54 |
-
if ( $post && $isKeyHash && $enable_email) {
|
55 |
-
$translate = Mage::getSingleton('core/translate');
|
56 |
-
/* @var $translate Mage_Core_Model_Translate */
|
57 |
-
$translate->setTranslateInline(false);
|
58 |
-
try {
|
59 |
-
$postObject = new Varien_Object();
|
60 |
-
$postObject->setData($post);
|
61 |
-
|
62 |
-
$error = false;
|
63 |
-
|
64 |
-
if (!Zend_Validate::is(trim($post['name']) , 'NotEmpty')) {
|
65 |
-
$error = true;
|
66 |
-
}
|
67 |
-
|
68 |
-
if (!Zend_Validate::is(trim($post['comment']) , 'NotEmpty')) {
|
69 |
-
$error = true;
|
70 |
-
}
|
71 |
-
|
72 |
-
if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
|
73 |
-
$error = true;
|
74 |
-
}
|
75 |
-
|
76 |
-
if (Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
|
77 |
-
$error = true;
|
78 |
-
}
|
79 |
-
|
80 |
-
if ($error) {
|
81 |
-
throw new Exception();
|
82 |
-
}
|
83 |
-
$mailTemplate = Mage::getModel('core/email_template');
|
84 |
-
/* @var $mailTemplate Mage_Core_Model_Email_Template */
|
85 |
-
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
|
86 |
-
->setReplyTo($post['email'])
|
87 |
-
->sendTransactional(
|
88 |
-
Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
|
89 |
-
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
|
90 |
-
Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),
|
91 |
-
null,
|
92 |
-
array('data' => $postObject)
|
93 |
-
);
|
94 |
-
|
95 |
-
if (!$mailTemplate->getSentSuccess()) {
|
96 |
-
throw new Exception();
|
97 |
-
}
|
98 |
-
|
99 |
-
$translate->setTranslateInline(true);
|
100 |
-
Mage::getSingleton('customer/session')->addSuccess(Mage::helper('contacts')->__('Your inquiry was submitted and will be responded to as soon as possible. Thank you for contacting us.'));
|
101 |
-
$this->_redirect('*/*/');
|
102 |
-
|
103 |
-
return;
|
104 |
-
} catch (Exception $e) {
|
105 |
-
$translate->setTranslateInline(true);
|
106 |
-
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));
|
107 |
-
$this->_redirect('*/*/');
|
108 |
-
return;
|
109 |
-
}
|
110 |
-
|
111 |
-
} else {
|
112 |
-
$translate = Mage::getSingleton('core/translate');
|
113 |
-
$translate->setTranslateInline(true);
|
114 |
-
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));
|
115 |
-
$this->_redirect('*/*/');
|
116 |
-
}
|
117 |
-
}
|
118 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/controllers/Review/ProductController.php
DELETED
@@ -1,115 +0,0 @@
|
|
1 |
-
<?php /**
|
2 |
-
* Moogento
|
3 |
-
*
|
4 |
-
* SOFTWARE LICENSE
|
5 |
-
*
|
6 |
-
* This source file is covered by the Moogento End User License Agreement
|
7 |
-
* that is bundled with this extension in the file License.html
|
8 |
-
* It is also available online here:
|
9 |
-
* http://www.moogento.com/License.html
|
10 |
-
*
|
11 |
-
* NOTICE
|
12 |
-
*
|
13 |
-
* If you customize this file please remember that it will be overwrtitten
|
14 |
-
* with any future upgrade installs.
|
15 |
-
* If you'd like to add a feature which is not in this software, get in touch
|
16 |
-
* at www.moogento.com for a quote.
|
17 |
-
*
|
18 |
-
* ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
19 |
-
* File ProductController.php
|
20 |
-
* @category Moogento
|
21 |
-
* @package noMoreSpam
|
22 |
-
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
-
* @license http://www.moogento.com/License.html
|
24 |
-
*/ ?>
|
25 |
-
<?php
|
26 |
-
require_once 'Mage/Review/controllers/ProductController.php';
|
27 |
-
class Moogento_NoMoreSpam_Review_ProductController extends Mage_Review_ProductController
|
28 |
-
{
|
29 |
-
private function getHashKey(){
|
30 |
-
$salt1 = mage::getStoreConfig("no_more_spam/no_spam/generate_text");
|
31 |
-
$salt2 = mage::getStoreConfig("no_more_spam/no_spam/random_text");
|
32 |
-
$hash_result = hash("sha256", $salt2 . $salt1);
|
33 |
-
return $hash_result;
|
34 |
-
}
|
35 |
-
private function checkHashKey($key_form, $empty_key){
|
36 |
-
$hash_key = $this->getHashKey();
|
37 |
-
$isKey = false;
|
38 |
-
if(($key_form==$hash_key) && $empty_key==''){
|
39 |
-
$isKey = true;
|
40 |
-
}
|
41 |
-
return $isKey;
|
42 |
-
}
|
43 |
-
public function postAction()
|
44 |
-
{
|
45 |
-
|
46 |
-
if ($data = Mage::getSingleton('review/session')->getFormData(true)) {
|
47 |
-
$rating = array();
|
48 |
-
if (isset($data['ratings']) && is_array($data['ratings'])) {
|
49 |
-
$rating = $data['ratings'];
|
50 |
-
}
|
51 |
-
} else {
|
52 |
-
$data = $this->getRequest()->getPost();
|
53 |
-
$rating = $this->getRequest()->getParam('ratings', array());
|
54 |
-
}
|
55 |
-
$isKeyHash = false;
|
56 |
-
$random_text = Mage::helper("nomorespam")->createNameInput1();
|
57 |
-
$empty_text = Mage::helper("nomorespam")->createNameInput2();
|
58 |
-
if(isset($data[$random_text]) && isset($data[$empty_text])){
|
59 |
-
$isKeyHash = $this->checkHashKey($data[$random_text], $data[$empty_text]);
|
60 |
-
}
|
61 |
-
$enable_review = mage::getStoreConfig("no_more_spam/no_spam/enabled_review");
|
62 |
-
|
63 |
-
if (($product = $this->_initProduct()) && !empty($data) && $isKeyHash && $enable_review) {
|
64 |
-
$session = Mage::getSingleton('core/session');
|
65 |
-
/* @var $session Mage_Core_Model_Session */
|
66 |
-
$review = Mage::getModel('review/review')->setData($data);
|
67 |
-
/* @var $review Mage_Review_Model_Review */
|
68 |
-
|
69 |
-
$validate = $review->validate();
|
70 |
-
if ($validate === true) {
|
71 |
-
try {
|
72 |
-
$review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))
|
73 |
-
->setEntityPkValue($product->getId())
|
74 |
-
->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)
|
75 |
-
->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
|
76 |
-
->setStoreId(Mage::app()->getStore()->getId())
|
77 |
-
->setStores(array(Mage::app()->getStore()->getId()))
|
78 |
-
->save();
|
79 |
-
|
80 |
-
foreach ($rating as $ratingId => $optionId) {
|
81 |
-
Mage::getModel('rating/rating')
|
82 |
-
->setRatingId($ratingId)
|
83 |
-
->setReviewId($review->getId())
|
84 |
-
->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
|
85 |
-
->addOptionVote($optionId, $product->getId());
|
86 |
-
}
|
87 |
-
|
88 |
-
$review->aggregate();
|
89 |
-
$session->addSuccess($this->__('Your review has been accepted for moderation.'));
|
90 |
-
}
|
91 |
-
catch (Exception $e) {
|
92 |
-
$session->setFormData($data);
|
93 |
-
$session->addError($this->__('Unable to post the review.'));
|
94 |
-
}
|
95 |
-
}
|
96 |
-
else {
|
97 |
-
$session->setFormData($data);
|
98 |
-
if (is_array($validate)) {
|
99 |
-
foreach ($validate as $errorMessage) {
|
100 |
-
$session->addError($errorMessage);
|
101 |
-
}
|
102 |
-
}
|
103 |
-
else {
|
104 |
-
$session->addError($this->__('Unable to post the review.'));
|
105 |
-
}
|
106 |
-
}
|
107 |
-
}
|
108 |
-
|
109 |
-
if ($redirectUrl = Mage::getSingleton('review/session')->getRedirectUrl(true)) {
|
110 |
-
$this->_redirectUrl($redirectUrl);
|
111 |
-
return;
|
112 |
-
}
|
113 |
-
$this->_redirectReferer();
|
114 |
-
}
|
115 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/etc/adminhtml.xml
DELETED
@@ -1,48 +0,0 @@
|
|
1 |
-
<?xml version="1.0" ?>
|
2 |
-
<!--
|
3 |
-
Moogento
|
4 |
-
|
5 |
-
SOFTWARE LICENSE
|
6 |
-
|
7 |
-
This source file is covered by the Moogento End User License Agreement
|
8 |
-
that is bundled with this extension in the file License.html
|
9 |
-
It is also available online here:
|
10 |
-
http://www.moogento.com/License.html
|
11 |
-
|
12 |
-
NOTICE
|
13 |
-
|
14 |
-
If you customize this file please remember that it will be overwrtitten
|
15 |
-
with any future upgrade installs.
|
16 |
-
If you'd like to add a feature which is not in this software, get in touch
|
17 |
-
at www.moogento.com for a quote.
|
18 |
-
|
19 |
-
ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
20 |
-
File adminhtml.xml
|
21 |
-
@category Moogento
|
22 |
-
@package noMoreSpam
|
23 |
-
@copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
24 |
-
@license http://www.moogento.com/License.html
|
25 |
-
-->
|
26 |
-
<config>
|
27 |
-
<acl>
|
28 |
-
<resources>
|
29 |
-
<admin>
|
30 |
-
<children>
|
31 |
-
<system>
|
32 |
-
<children>
|
33 |
-
<config>
|
34 |
-
<children>
|
35 |
-
<no_more_spam>
|
36 |
-
<title>No More Spam</title>
|
37 |
-
<sort_order>301</sort_order>
|
38 |
-
</no_more_spam>
|
39 |
-
</children>
|
40 |
-
</config>
|
41 |
-
</children>
|
42 |
-
</system>
|
43 |
-
</children>
|
44 |
-
</admin>
|
45 |
-
</resources>
|
46 |
-
</acl>
|
47 |
-
|
48 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/etc/config.xml
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
Moogento
|
4 |
-
|
5 |
-
SOFTWARE LICENSE
|
6 |
-
|
7 |
-
This source file is covered by the Moogento End User License Agreement
|
8 |
-
that is bundled with this extension in the file License.html
|
9 |
-
It is also available online here:
|
10 |
-
http://www.moogento.com/License.html
|
11 |
-
|
12 |
-
NOTICE
|
13 |
-
|
14 |
-
If you customize this file please remember that it will be overwrtitten
|
15 |
-
with any future upgrade installs.
|
16 |
-
If you'd like to add a feature which is not in this software, get in touch
|
17 |
-
at www.moogento.com for a quote.
|
18 |
-
|
19 |
-
ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
20 |
-
File config.xml
|
21 |
-
@category Moogento
|
22 |
-
@package noMoreSpam
|
23 |
-
@copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
24 |
-
@license http://www.moogento.com/License.html
|
25 |
-
-->
|
26 |
-
<config>
|
27 |
-
<modules>
|
28 |
-
<Moogento_NoMoreSpam>
|
29 |
-
<version>0.1.0</version>
|
30 |
-
</Moogento_NoMoreSpam>
|
31 |
-
</modules>
|
32 |
-
<frontend>
|
33 |
-
<routers>
|
34 |
-
<contacts>
|
35 |
-
<args>
|
36 |
-
<modules>
|
37 |
-
<Moogento_NoMoreSpam before="Mage_Contacts">Moogento_NoMoreSpam</Moogento_NoMoreSpam>
|
38 |
-
</modules>
|
39 |
-
</args>
|
40 |
-
</contacts>
|
41 |
-
<review>
|
42 |
-
<args>
|
43 |
-
<modules>
|
44 |
-
<Moogento_NoMoreSpam before="Mage_Review">Moogento_NoMoreSpam_Review</Moogento_NoMoreSpam>
|
45 |
-
</modules>
|
46 |
-
</args>
|
47 |
-
</review>
|
48 |
-
</routers>
|
49 |
-
<layout>
|
50 |
-
<updates>
|
51 |
-
<nomorespam>
|
52 |
-
<file>moogento/nomorespam.xml</file>
|
53 |
-
</nomorespam>
|
54 |
-
</updates>
|
55 |
-
</layout>
|
56 |
-
</frontend>
|
57 |
-
<admin>
|
58 |
-
<routers>
|
59 |
-
<nomorespam>
|
60 |
-
<use>admin</use>
|
61 |
-
<args>
|
62 |
-
<module>Moogento_NoMoreSpam</module>
|
63 |
-
<frontName>nomorespam</frontName>
|
64 |
-
</args>
|
65 |
-
</nomorespam>
|
66 |
-
</routers>
|
67 |
-
</admin>
|
68 |
-
<adminhtml>
|
69 |
-
<acl>
|
70 |
-
<resources>
|
71 |
-
<all>
|
72 |
-
<title>Allow Everything</title>
|
73 |
-
</all>
|
74 |
-
<admin>
|
75 |
-
<children>
|
76 |
-
<Moogento_NoMoreSpam>
|
77 |
-
<title>NoMoreSpam Module</title>
|
78 |
-
<sort_order>10</sort_order>
|
79 |
-
</Moogento_NoMoreSpam>
|
80 |
-
</children>
|
81 |
-
</admin>
|
82 |
-
</resources>
|
83 |
-
</acl>
|
84 |
-
<layout>
|
85 |
-
<updates>
|
86 |
-
<nomorespam>
|
87 |
-
<file>moogento/nomorespam.xml</file>
|
88 |
-
</nomorespam>
|
89 |
-
</updates>
|
90 |
-
</layout>
|
91 |
-
</adminhtml>
|
92 |
-
<global>
|
93 |
-
<models>
|
94 |
-
<nomorespam>
|
95 |
-
<class>Moogento_NoMoreSpam_Model</class>
|
96 |
-
<resourceModel>nomorespam_mysql4</resourceModel>
|
97 |
-
</nomorespam>
|
98 |
-
<nomorespam_mysql4>
|
99 |
-
<class>Moogento_NoMoreSpam_Model_Mysql4</class>
|
100 |
-
<entities>
|
101 |
-
<nomorespam>
|
102 |
-
<table>nomorespam</table>
|
103 |
-
</nomorespam>
|
104 |
-
</entities>
|
105 |
-
</nomorespam_mysql4>
|
106 |
-
</models>
|
107 |
-
<resources>
|
108 |
-
<nomorespam_setup>
|
109 |
-
<setup>
|
110 |
-
<module>Moogento_NoMoreSpam</module>
|
111 |
-
</setup>
|
112 |
-
<connection>
|
113 |
-
<use>core_setup</use>
|
114 |
-
</connection>
|
115 |
-
</nomorespam_setup>
|
116 |
-
<nomorespam_write>
|
117 |
-
<connection>
|
118 |
-
<use>core_write</use>
|
119 |
-
</connection>
|
120 |
-
</nomorespam_write>
|
121 |
-
<nomorespam_read>
|
122 |
-
<connection>
|
123 |
-
<use>core_read</use>
|
124 |
-
</connection>
|
125 |
-
</nomorespam_read>
|
126 |
-
</resources>
|
127 |
-
<blocks>
|
128 |
-
<nomorespam>
|
129 |
-
<class>Moogento_NoMoreSpam_Block</class>
|
130 |
-
</nomorespam>
|
131 |
-
</blocks>
|
132 |
-
<helpers>
|
133 |
-
<nomorespam>
|
134 |
-
<class>Moogento_NoMoreSpam_Helper</class>
|
135 |
-
</nomorespam>
|
136 |
-
</helpers>
|
137 |
-
</global>
|
138 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Moogento/NoMoreSpam/etc/system.xml
DELETED
@@ -1,101 +0,0 @@
|
|
1 |
-
<?xml version="1.0"?>
|
2 |
-
<!--
|
3 |
-
Moogento
|
4 |
-
|
5 |
-
SOFTWARE LICENSE
|
6 |
-
|
7 |
-
This source file is covered by the Moogento End User License Agreement
|
8 |
-
that is bundled with this extension in the file License.html
|
9 |
-
It is also available online here:
|
10 |
-
http://www.moogento.com/License.html
|
11 |
-
|
12 |
-
NOTICE
|
13 |
-
|
14 |
-
If you customize this file please remember that it will be overwrtitten
|
15 |
-
with any future upgrade installs.
|
16 |
-
If you'd like to add a feature which is not in this software, get in touch
|
17 |
-
at www.moogento.com for a quote.
|
18 |
-
|
19 |
-
ID pe+sMEDTrtCzNq3pehW9DJ0lnYtgqva4i4Z=
|
20 |
-
File system.xml
|
21 |
-
@category Moogento
|
22 |
-
@package noMoreSpam
|
23 |
-
@copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
24 |
-
@license http://www.moogento.com/License.html
|
25 |
-
-->
|
26 |
-
<config>
|
27 |
-
<tabs>
|
28 |
-
<moogento translate="label comment" module="nomorespam">
|
29 |
-
<label><![CDATA[<img src="//www.moogento.com/logo/moogento_tinylogo.lp.png" alt="Moogento" height="20" style="vertical-align:bottom;margin-left:-1px;"/> MOOGENTO Extensions]]></label>
|
30 |
-
<sort_order>200</sort_order>
|
31 |
-
</moogento>
|
32 |
-
</tabs>
|
33 |
-
<sections>
|
34 |
-
<no_more_spam translate="label" module="nomorespam">
|
35 |
-
<label><![CDATA[noMoreSpam]]></label>
|
36 |
-
<header_css>moogento-header</header_css>
|
37 |
-
<tab>moogento</tab>
|
38 |
-
<frontend_type>text</frontend_type>
|
39 |
-
<sort_order>100</sort_order>
|
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 |
-
<groups>
|
44 |
-
<hint>
|
45 |
-
<frontend_model>nomorespam/adminhtml_system_config_fieldset_hint</frontend_model>
|
46 |
-
<sort_order>0</sort_order>
|
47 |
-
<show_in_default>1</show_in_default>
|
48 |
-
<show_in_website>1</show_in_website>
|
49 |
-
<show_in_store>1</show_in_store>
|
50 |
-
</hint>
|
51 |
-
<no_spam translate="label">
|
52 |
-
<label>General</label>
|
53 |
-
<frontend_type>text</frontend_type>
|
54 |
-
<sort_order>10</sort_order>
|
55 |
-
<show_in_default>1</show_in_default>
|
56 |
-
<show_in_website>1</show_in_website>
|
57 |
-
<show_in_store>1</show_in_store>
|
58 |
-
<expanded>1</expanded>
|
59 |
-
<fields>
|
60 |
-
<enabled_email translate="label">
|
61 |
-
<label>noMoreSpam for contact form?</label>
|
62 |
-
<frontend_type>select</frontend_type>
|
63 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
64 |
-
<backend_model>contacts/system_config_backend_links</backend_model>
|
65 |
-
<sort_order>10</sort_order>
|
66 |
-
<show_in_default>1</show_in_default>
|
67 |
-
<show_in_website>1</show_in_website>
|
68 |
-
<show_in_store>1</show_in_store>
|
69 |
-
</enabled_email>
|
70 |
-
<enabled_review translate="label">
|
71 |
-
<label>noMoreSpam for product reviews?</label>
|
72 |
-
<frontend_type>select</frontend_type>
|
73 |
-
<source_model>adminhtml/system_config_source_yesno</source_model>
|
74 |
-
<backend_model>contacts/system_config_backend_links</backend_model>
|
75 |
-
<sort_order>11</sort_order>
|
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 |
-
</enabled_review>
|
80 |
-
<generate_text translate="label">
|
81 |
-
<label></label>
|
82 |
-
<frontend_type>hidden</frontend_type>
|
83 |
-
<sort_order>50</sort_order>
|
84 |
-
<show_in_default>0</show_in_default>
|
85 |
-
<show_in_website>0</show_in_website>
|
86 |
-
<show_in_store>0</show_in_store>
|
87 |
-
</generate_text>
|
88 |
-
<random_text translate="label">
|
89 |
-
<label></label>
|
90 |
-
<frontend_type>hidden</frontend_type>
|
91 |
-
<sort_order>50</sort_order>
|
92 |
-
<show_in_default>0</show_in_default>
|
93 |
-
<show_in_website>0</show_in_website>
|
94 |
-
<show_in_store>0</show_in_store>
|
95 |
-
</random_text>
|
96 |
-
</fields>
|
97 |
-
</no_spam>
|
98 |
-
</groups>
|
99 |
-
</no_more_spam>
|
100 |
-
</sections>
|
101 |
-
</config>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/adminhtml/default/default/layout/moogento/nomorespam.xml
CHANGED
@@ -26,7 +26,6 @@
|
|
26 |
<layout version="0.1.0">
|
27 |
<default>
|
28 |
<reference name="head">
|
29 |
-
<!-- <action method="addJs"><script>moogento/pickpack/adminhtml/grouping.js</script></action> -->
|
30 |
<action method="addCss"><name>moogento/nomorespam/nomorespam.css</name></action>
|
31 |
</reference>
|
32 |
</default>
|
26 |
<layout version="0.1.0">
|
27 |
<default>
|
28 |
<reference name="head">
|
|
|
29 |
<action method="addCss"><name>moogento/nomorespam/nomorespam.css</name></action>
|
30 |
</reference>
|
31 |
</default>
|
app/design/frontend/default/default/layout/moogento/nomorespam.xml
CHANGED
@@ -25,21 +25,15 @@
|
|
25 |
-->
|
26 |
<layout version="0.1.0">
|
27 |
<default>
|
28 |
-
|
29 |
</default>
|
30 |
-
<!--<nomorespam_index_index>
|
31 |
-
<reference name="content">
|
32 |
-
<block type="nomorespam/nomorespam" name="nomorespam" template="nomorespam/nomorespam.phtml" />
|
33 |
-
</reference>
|
34 |
-
</nomorespam_index_index>-->
|
35 |
-
<contacts_index_index translate="label">
|
36 |
|
|
|
37 |
<reference name="content">
|
38 |
<block type="nomorespam/nomorespam" name="nomorespam_contact" template="nomorespam/nomorespam_contact.phtml" />
|
39 |
</reference>
|
40 |
</contacts_index_index>
|
|
|
41 |
<review_product_list>
|
42 |
-
|
43 |
<reference name="content">
|
44 |
<block type="nomorespam/nomorespam" name="nomorespam_review" template="nomorespam/nomorespam_review.phtml" />
|
45 |
</reference>
|
25 |
-->
|
26 |
<layout version="0.1.0">
|
27 |
<default>
|
|
|
28 |
</default>
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
+
<contacts_index_index translate="label">
|
31 |
<reference name="content">
|
32 |
<block type="nomorespam/nomorespam" name="nomorespam_contact" template="nomorespam/nomorespam_contact.phtml" />
|
33 |
</reference>
|
34 |
</contacts_index_index>
|
35 |
+
|
36 |
<review_product_list>
|
|
|
37 |
<reference name="content">
|
38 |
<block type="nomorespam/nomorespam" name="nomorespam_review" template="nomorespam/nomorespam_review.phtml" />
|
39 |
</reference>
|
app/design/frontend/default/default/template/nomorespam/nomorespam_contact.phtml
CHANGED
@@ -22,10 +22,10 @@
|
|
22 |
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
* @license http://www.moogento.com/License.html
|
24 |
*/ ?>
|
25 |
-
<div id="<?php echo Mage::helper("nomorespam")->
|
26 |
-
<input type="text" name="<?php echo Mage::helper("nomorespam")->
|
27 |
-
<input type="hidden" name="<?php echo Mage::helper("nomorespam")->
|
28 |
</div>
|
29 |
<script type="text/javascript">
|
30 |
-
Element.addMethods({getText:function(element){a=$(element);return a.innerHTML;}});$(document).on('dom:loaded',function(){var b="<?php echo Mage::helper("nomorespam")->
|
31 |
</script>
|
22 |
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
* @license http://www.moogento.com/License.html
|
24 |
*/ ?>
|
25 |
+
<div id="<?php echo Mage::helper("nomorespam")->getNmsId();?>">
|
26 |
+
<input type="text" name="<?php echo Mage::helper("nomorespam")->getNmsField1();?>" id="<?php echo Mage::helper("nomorespam")->getNmsField1()?>" value="<?php echo Mage::helper("nomorespam")->createValue(); ?>" style="display:none !important;" />
|
27 |
+
<input type="hidden" name="<?php echo Mage::helper("nomorespam")->getNmsField2();?>" id="<?php echo Mage::helper("nomorespam")->getNmsField2();?>" value="" />
|
28 |
</div>
|
29 |
<script type="text/javascript">
|
30 |
+
Element.addMethods({getText:function(element){a=$(element);return a.innerHTML;}});$(document).on('dom:loaded',function(){var b="<?php echo Mage::helper("nomorespam")->getNmsId();?>";var c=$(b).getText();if(c){$('contactForm').insert({top:c});$(b).remove();}});
|
31 |
</script>
|
app/design/frontend/default/default/template/nomorespam/nomorespam_review.phtml
CHANGED
@@ -22,10 +22,10 @@
|
|
22 |
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
* @license http://www.moogento.com/License.html
|
24 |
*/ ?>
|
25 |
-
<div id="<?php echo Mage::helper("nomorespam")->
|
26 |
-
<input type="text" name="<?php echo Mage::helper("nomorespam")->
|
27 |
-
<input type="hidden" name="<?php echo Mage::helper("nomorespam")->
|
28 |
</div>
|
29 |
<script type="text/javascript">
|
30 |
-
Element.addMethods({getText:function(element){a=$(element);return a.innerHTML;}});$(document).on('dom:loaded',function(){var b="<?php echo Mage::helper("nomorespam")->
|
31 |
</script>
|
22 |
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
23 |
* @license http://www.moogento.com/License.html
|
24 |
*/ ?>
|
25 |
+
<div id="<?php echo Mage::helper("nomorespam")->getNmsId();?>">
|
26 |
+
<input type="text" name="<?php echo Mage::helper("nomorespam")->getNmsField1();?>" id="<?php echo Mage::helper("nomorespam")->getNmsField1()?>" value="<?php echo Mage::helper("nomorespam")->createValue(); ?>" style="display:none !important;" />
|
27 |
+
<input type="hidden" name="<?php echo Mage::helper("nomorespam")->getNmsField2();?>" id="<?php echo Mage::helper("nomorespam")->getNmsField2();?>" value="" />
|
28 |
</div>
|
29 |
<script type="text/javascript">
|
30 |
+
Element.addMethods({getText:function(element){a=$(element);return a.innerHTML;}});$(document).on('dom:loaded',function(){var b="<?php echo Mage::helper("nomorespam")->getNmsId();?>";var c=$(b).getText();if(c){$('review-form').insert({top:c});$(b).remove();}});
|
31 |
</script>
|
package.xml
CHANGED
@@ -1,18 +1,20 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>moogento_nomorespam</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Instant-on, no-setup spam protection for Magento.</summary>
|
10 |
<description>Stop spam from your Contact Form and Product Review forms. No setup needed, it just works.</description>
|
11 |
-
<notes>Stable release
|
|
|
|
|
12 |
<authors><author><name>Jim Gilbert</name><user>moogento</user><email>moo@moogento.com</email></author></authors>
|
13 |
-
<date>2014-05-
|
14 |
-
<time>
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
-
<dependencies><required><php><min>5.3.28</min><max>5.6.
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>moogento_nomorespam</name>
|
4 |
+
<version>1.0.2</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>Instant-on, no-setup spam protection for Magento.</summary>
|
10 |
<description>Stop spam from your Contact Form and Product Review forms. No setup needed, it just works.</description>
|
11 |
+
<notes>Stable release - Magento now has an easy, free of charge, anti-spam extension.
|
12 |
+
- spam stopped in the contact form
|
13 |
+
- spam stopped in the product reviews pages</notes>
|
14 |
<authors><author><name>Jim Gilbert</name><user>moogento</user><email>moo@moogento.com</email></author></authors>
|
15 |
+
<date>2014-05-17</date>
|
16 |
+
<time>10:10:27</time>
|
17 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><dir name="moogento"><file name="nomorespam.xml" hash="a922801f561222e64398c902e03dfe1f"/></dir></dir><dir name="template"><dir name="moogento"><dir name="nomorespam"><dir name="system"><dir name="config"><dir name="fieldset"><file name="hint.phtml" hash="9d15ed4398de3cb3de129e38d5c4b9e9"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><dir name="moogento"><file name="nomorespam.xml" hash="36dbef370447b05722d68d6cca97a9f7"/></dir></dir><dir name="template"><dir name="nomorespam"><file name="nomorespam_contact.phtml" hash="acead23edbe31736a536f9b46e01c972"/><file name="nomorespam_review.phtml" hash="5941aa5fbede8208a8903349efe840c8"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="moogento"><dir name="nomorespam"><dir name="fonts"><file name="OpenSans-ExtraBoldItalic-webfont.eot" hash="ff3bedaecdec71c34b0ca85c3c495c2d"/><file name="OpenSans-ExtraBoldItalic-webfont.svg" hash="6512fca9ff4dc029307018c17e4a2a9d"/><file name="OpenSans-ExtraBoldItalic-webfont.ttf" hash="5517d73acdc17143c21b0cffab4cfaa9"/><file name="OpenSans-ExtraBoldItalic-webfont.woff" hash="042468300dab6f308592e15e02549c79"/><file name="OpenSans-Italic-webfont.eot" hash="43d5342998f3607bd61a8239e98b1160"/><file name="OpenSans-Italic-webfont.svg" hash="5b774c25787e0a52c013463c9e3c4219"/><file name="OpenSans-Italic-webfont.ttf" hash="de7ef31e6295902347c5c3643b2d82da"/><file name="OpenSans-Italic-webfont.woff" hash="f42641eed834f7b97a9499362c6c8855"/><file name="OpenSans-Regular-webfont.eot" hash="c4d82460ef260eb1589e73528cbfb257"/><file name="OpenSans-Regular-webfont.svg" hash="8185eb3059c46e4169ce107dfcf85950"/><file name="OpenSans-Regular-webfont.ttf" hash="488d5cc145299ba07b75495100419ee6"/><file name="OpenSans-Regular-webfont.woff" hash="79515ad0788973c533405f7012dfeccd"/><file name="allerdisplay-webfont.eot" hash="47c90b278673ea6d7486ad626e40860c"/><file name="allerdisplay-webfont.svg" hash="118d857008de7ae12bcba86b849e4e3f"/><file name="allerdisplay-webfont.ttf" hash="997c0263496f7e047d646f0dbb683c64"/><file name="allerdisplay-webfont.woff" hash="013049a31f05bb4f516414731f727e67"/></dir><dir name="images"><file name="moo_alert.png" hash="f8431fd4181d8a3d883c55a7ef743a67"/><file name="moo_alert_m.png" hash="4da04154b957595ec4fd4e0eada371d4"/><file name="moo_alert_small.png" hash="5cf46ec8036efedfc3085ab3fc4f102a"/><file name="moo_alert_small_orange.png" hash="9474b960c2db39219ba1b17a12068fd1"/><file name="moo_info_small_blue.png" hash="037b9358c7d3317c66b14c09ff7f898d"/><file name="moo_tick.png" hash="cc1ca0a3645d8494d62ba873108f3120"/><file name="moo_tick_m.png" hash="81379d3d96d4d353fae0a1cefffeb1b4"/><file name="moo_tick_small.png" hash="2eec22f15bae8c06f95ca3aaaf207fdf"/><file name="moo_tick_small_green.png" hash="2007293e5838837de28aa3815bd98dcd"/><file name="printer.png" hash="728631df727153ca6e72e6dd57be252e"/><file name="printer_small.png" hash="c8df122994f034a2a54ba227c1a896a9"/></dir><file name="nomorespam.css" hash="aaab79e239fb34f65e81521ca1f52011"/></dir></dir></dir></dir></dir></target></contents>
|
18 |
<compatible/>
|
19 |
+
<dependencies><required><php><min>5.3.28</min><max>5.6.20</max></php></required></dependencies>
|
20 |
</package>
|
skin/adminhtml/default/default/moogento/nomorespam/nomorespam.css
CHANGED
@@ -57,8 +57,18 @@ File nomorespam.css
|
|
57 |
font-style: normal;
|
58 |
}
|
59 |
div.moogento-notice {
|
60 |
-
|
61 |
-
background-image: -
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
border: 1px solid #FFF;
|
63 |
border-radius: 7px 3px 3px 7px;
|
64 |
margin: -24px 0 4px;
|
@@ -80,6 +90,7 @@ h3.moogento-header {
|
|
80 |
margin-top: 2px;
|
81 |
color: #777777;
|
82 |
background-position: 1px 2px;
|
|
|
83 |
}
|
84 |
.form-list p.note:hover {
|
85 |
color: #333;
|
@@ -90,6 +101,7 @@ h3.moogento-header {
|
|
90 |
.floatingcows {
|
91 |
min-height: 109px;
|
92 |
padding: 4px 0 0 10px;
|
|
|
93 |
}
|
94 |
.floatingsheep {
|
95 |
background-repeat: no-repeat;
|
@@ -125,6 +137,12 @@ h3.moogento-header {
|
|
125 |
#wikilinks a span {
|
126 |
font-size: 1.5em;
|
127 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
#wikilinks a:hover {
|
129 |
border-bottom: 1px solid darkgreen;
|
130 |
color: darkgreen;
|
@@ -168,9 +186,9 @@ h3.moogento-header {
|
|
168 |
color: #333;
|
169 |
}
|
170 |
.moogento-notice #mooink {
|
171 |
-
height:
|
172 |
text-decoration: none;
|
173 |
-
width:
|
174 |
display: block;
|
175 |
}
|
176 |
#mooinfo .tick em, #mooinfo .alert em, .moo_config_info em {
|
@@ -250,7 +268,7 @@ em.moo_bull {
|
|
250 |
display: block;
|
251 |
float: right;
|
252 |
font-family: "OpenSansReg","HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;
|
253 |
-
margin: -4.1em
|
254 |
position: relative;
|
255 |
width: 27em;
|
256 |
}
|
@@ -270,4 +288,14 @@ em.moo_bull {
|
|
270 |
.ext_info a:hover b {
|
271 |
background-color: #90EE90;
|
272 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
/******** *end* SHARED CONFIG CSS **********/
|
57 |
font-style: normal;
|
58 |
}
|
59 |
div.moogento-notice {
|
60 |
+
/* IE10 Consumer Preview */
|
61 |
+
background-image: -ms-linear-gradient( left, #FFFFFF 10%, #EEEEEE 30%, #58C28C 61%, #3BB878 91%);
|
62 |
+
/* Mozilla Firefox */
|
63 |
+
background-image: -moz-linear-gradient( left, #FFFFFF 10%, #EEEEEE 30%, #58C28C 61%, #3BB878 91%);
|
64 |
+
/* Opera */
|
65 |
+
background-image: -o-linear-gradient( left, #FFFFFF 10%, #EEEEEE 30%, #58C28C 61%, #3BB878 91%);
|
66 |
+
/* Webkit (Safari/Chrome 10) */
|
67 |
+
background-image: -webkit-gradient(linear, left , right bottom, color-stop(0.1, #FFFFFF), color-stop(0.3, #EEEEEE), color-stop(0.61, #58C28C), color-stop(0.91, #3BB878));
|
68 |
+
/* Webkit (Chrome 11+) */
|
69 |
+
background-image: -webkit-linear-gradient( left, #FFFFFF 10%, #EEEEEE 30%, #58C28C 61%, #3BB878 91%);
|
70 |
+
/* W3C Markup, IE10 Release Preview */
|
71 |
+
background-image: linear-gradient(to right, #FFFFFF 10%, #EEEEEE 30%, #58C28C 61%, #3BB878 91%);
|
72 |
border: 1px solid #FFF;
|
73 |
border-radius: 7px 3px 3px 7px;
|
74 |
margin: -24px 0 4px;
|
90 |
margin-top: 2px;
|
91 |
color: #777777;
|
92 |
background-position: 1px 2px;
|
93 |
+
font-style:italic;
|
94 |
}
|
95 |
.form-list p.note:hover {
|
96 |
color: #333;
|
101 |
.floatingcows {
|
102 |
min-height: 109px;
|
103 |
padding: 4px 0 0 10px;
|
104 |
+
background-repeat:no-repeat;
|
105 |
}
|
106 |
.floatingsheep {
|
107 |
background-repeat: no-repeat;
|
137 |
#wikilinks a span {
|
138 |
font-size: 1.5em;
|
139 |
}
|
140 |
+
/* saf3+, chrome1+ */
|
141 |
+
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
142 |
+
#wikilinks a span {
|
143 |
+
font-size: 1em;
|
144 |
+
}
|
145 |
+
}
|
146 |
#wikilinks a:hover {
|
147 |
border-bottom: 1px solid darkgreen;
|
148 |
color: darkgreen;
|
186 |
color: #333;
|
187 |
}
|
188 |
.moogento-notice #mooink {
|
189 |
+
height: 115px;
|
190 |
text-decoration: none;
|
191 |
+
width: 140px;
|
192 |
display: block;
|
193 |
}
|
194 |
#mooinfo .tick em, #mooinfo .alert em, .moo_config_info em {
|
268 |
display: block;
|
269 |
float: right;
|
270 |
font-family: "OpenSansReg","HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;
|
271 |
+
margin: -4.1em 5em 0 0;
|
272 |
position: relative;
|
273 |
width: 27em;
|
274 |
}
|
288 |
.ext_info a:hover b {
|
289 |
background-color: #90EE90;
|
290 |
}
|
291 |
+
img.small-image-preview {
|
292 |
+
height: 40px !important;
|
293 |
+
max-width: 150px !important;
|
294 |
+
width: auto !important;
|
295 |
+
}
|
296 |
+
.collapseable .moo_config_info a {
|
297 |
+
border-bottom: 1.5px solid #4682B4 !important;
|
298 |
+
color: #4682B4 !important;
|
299 |
+
line-height: 24px !important;
|
300 |
+
}
|
301 |
/******** *end* SHARED CONFIG CSS **********/
|