Version Notes
Small bug fixes.
Adds contact form and CMS checks.
Download this release
Release Info
Developer | Magento Core Team |
Extension | moogento_nomorespam |
Version | 1.0.8 |
Comparing to | |
See all releases |
Code changes from version 1.0.6 to 1.0.8
- app/code/community/Moogento/NoMoreSpam/Block/Adminhtml/System/Config/Fieldset/Contactdescription.php +45 -0
- app/code/community/Moogento/NoMoreSpam/Block/Adminhtml/System/Config/Fieldset/Hint.php +63 -0
- app/code/community/Moogento/NoMoreSpam/Block/Nomorespam.php +39 -0
- app/code/community/Moogento/NoMoreSpam/Helper/Data.php +207 -0
- app/code/community/Moogento/NoMoreSpam/Model/Email.php +45 -0
- app/code/community/Moogento/NoMoreSpam/Model/NoMoreSpam.php +53 -0
- app/code/community/Moogento/NoMoreSpam/Model/Status.php +39 -0
- app/code/community/Moogento/NoMoreSpam/controllers/ActiveController.php +49 -0
- app/code/community/Moogento/NoMoreSpam/controllers/Customer/AccountController.php +243 -0
- app/code/community/Moogento/NoMoreSpam/controllers/IndexController.php +155 -0
- app/code/community/Moogento/NoMoreSpam/controllers/Newsletter/SubscriberController.php +208 -0
- app/code/community/Moogento/NoMoreSpam/controllers/Review/ProductController.php +180 -0
- app/code/community/Moogento/NoMoreSpam/etc/adminhtml.xml +48 -0
- app/code/community/Moogento/NoMoreSpam/etc/config.xml +187 -0
- app/code/community/Moogento/NoMoreSpam/etc/system.xml +328 -0
- app/design/frontend/default/default/layout/moogento/nomorespam.xml +17 -3
- app/design/frontend/default/default/template/nomorespam/nomorespam_contact.phtml +0 -31
- app/design/frontend/default/default/template/nomorespam/nomorespam_review.phtml +0 -31
- package.xml +6 -5
app/code/community/Moogento/NoMoreSpam/Block/Adminhtml/System/Config/Fieldset/Contactdescription.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
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 Packdescription.php
|
21 |
+
* @category Moogento
|
22 |
+
* @package pickPack
|
23 |
+
* @copyright Copyright (c) 2014 Moogento <info@moogento.com> / All rights reserved.
|
24 |
+
* @license http://www.moogento.com/License.html
|
25 |
+
*/
|
26 |
+
|
27 |
+
|
28 |
+
class Moogento_NoMoreSpam_Block_Adminhtml_System_Config_Fieldset_Contactdescription
|
29 |
+
extends Mage_Adminhtml_Block_Abstract
|
30 |
+
implements Varien_Data_Form_Element_Renderer_Interface {
|
31 |
+
// Mage_Adminhtml_Block_System_Config_Form_Fieldset
|
32 |
+
/**
|
33 |
+
* Render fieldset html
|
34 |
+
*
|
35 |
+
* @param Varien_Data_Form_Element_Abstract $element
|
36 |
+
* @return string
|
37 |
+
*/
|
38 |
+
public function render(Varien_Data_Form_Element_Abstract $element) {
|
39 |
+
$html = '<div class="moo_config_info"><em></em>Incluce NoMoreSpam to form contact in CMS page by adding this code to your CMS: <span class="comment_code">{{block type="nomorespam/nomorespam" name="nomorespam_contact" template="moogento/nomorespam/nomorespam_contact.phtml"}}</span></div>';
|
40 |
+
return $html;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
|
45 |
+
|
app/code/community/Moogento/NoMoreSpam/Block/Adminhtml/System/Config/Fieldset/Hint.php
ADDED
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 getMooVersion($e) {
|
47 |
+
return (string)Mage::getConfig()->getNode('modules/'.$e.'/version');
|
48 |
+
}
|
49 |
+
|
50 |
+
public function getMooo() {
|
51 |
+
return '.zn';
|
52 |
+
}
|
53 |
+
|
54 |
+
public function getInfoHtml()
|
55 |
+
{
|
56 |
+
$return_html = '<ul class="ext_info" style="width: 32em;">
|
57 |
+
<li style="line-height:26px;min-width:29em;padding:8px 6px 10px 11px;"><em></em>Thanks for installing <strong>NoMoreSpam!</strong><br />Check <a href="http://www.moogento.com" style="border-bottom:1px solid;">Moogento.com</a> for other great time-saving extensions!</li>
|
58 |
+
</ul>';
|
59 |
+
|
60 |
+
return $return_html;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
?>
|
app/code/community/Moogento/NoMoreSpam/Block/Nomorespam.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
return parent::_prepareLayout();
|
30 |
+
}
|
31 |
+
|
32 |
+
public function getNoMoreSpam() {
|
33 |
+
if (!$this->hasData('nomorespam')) {
|
34 |
+
$this->setData('nomorespam', Mage::registry('nomorespam'));
|
35 |
+
}
|
36 |
+
return $this->getData('nomorespam');
|
37 |
+
}
|
38 |
+
|
39 |
+
}
|
app/code/community/Moogento/NoMoreSpam/Helper/Data.php
ADDED
@@ -0,0 +1,207 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
const XML_PATH_EMAIL_NO_MORE_SPAM = 'no_more_spam/no_spam/email_template';
|
30 |
+
private function _crypto_rand_secure($min, $max) {
|
31 |
+
$range = $max - $min;
|
32 |
+
if ($range < 0) return $min; // not so random...
|
33 |
+
$log = log($range, 2);
|
34 |
+
$bytes = (int) ($log / 8) + 1; // length in bytes
|
35 |
+
$bits = (int) $log + 1; // length in bits
|
36 |
+
$filter = (int) (1 << $bits) - 1; // set all lower bits to 1
|
37 |
+
do {
|
38 |
+
$rnd = hexdec(bin2hex(openssl_random_pseudo_bytes($bytes)));
|
39 |
+
$rnd = $rnd & $filter; // discard irrelevant bits
|
40 |
+
} while ($rnd >= $range);
|
41 |
+
return $min + $rnd;
|
42 |
+
}
|
43 |
+
|
44 |
+
private function _getToken($length=32){
|
45 |
+
$token = "";
|
46 |
+
$codeAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
47 |
+
$codeAlphabet.= "abcdefghijklmnopqrstuvwxyz";
|
48 |
+
$codeAlphabet.= "0123456789";
|
49 |
+
for($i=0;$i<$length;$i++){
|
50 |
+
$token .= $codeAlphabet[$this->_crypto_rand_secure(0,strlen($codeAlphabet))];
|
51 |
+
}
|
52 |
+
return $token;
|
53 |
+
}
|
54 |
+
private function _getNmsId(){ //nms_nms_id
|
55 |
+
$nms_id = mage::getStoreConfig("no_more_spam/no_spam/nms_id");
|
56 |
+
if($nms_id==''){
|
57 |
+
$nms_id = $this->_getToken(8);
|
58 |
+
Mage::getModel('core/config')->saveConfig("no_more_spam/no_spam/nms_id", $nms_id );
|
59 |
+
}
|
60 |
+
return $nms_id;
|
61 |
+
}
|
62 |
+
private function _getNmsField1(){ //nms_field_1
|
63 |
+
$field_1 = mage::getStoreConfig("no_more_spam/no_spam/field_1");
|
64 |
+
if($field_1==''){
|
65 |
+
$field_1 = $this->_getToken(6);
|
66 |
+
Mage::getModel('core/config')->saveConfig("no_more_spam/no_spam/field_1", $field_1 );
|
67 |
+
}
|
68 |
+
return $field_1;
|
69 |
+
}
|
70 |
+
private function _getNmsField2(){ //nms_field_2
|
71 |
+
$field_2 = mage::getStoreConfig("no_more_spam/no_spam/field_2");
|
72 |
+
if($field_2==''){
|
73 |
+
$field_2 = $this->_getToken(6);
|
74 |
+
Mage::getModel('core/config')->saveConfig("no_more_spam/no_spam/field_2", $field_2 );
|
75 |
+
}
|
76 |
+
return $field_2;
|
77 |
+
}
|
78 |
+
private function _getNmsTooFast(){
|
79 |
+
$field = mage::getStoreConfig("no_more_spam/no_spam/field_toofast");
|
80 |
+
if($field==''){
|
81 |
+
$field = $this->_getToken(6);
|
82 |
+
Mage::getModel('core/config')->saveConfig("no_more_spam/no_spam/field_toofast", $field );
|
83 |
+
}
|
84 |
+
return $field;
|
85 |
+
}
|
86 |
+
public function IsToofast(){
|
87 |
+
return mage::getStoreConfig('no_more_spam/no_spam/too_fast_form');
|
88 |
+
}
|
89 |
+
public function getNmsId(){
|
90 |
+
return $this->_getNmsId();
|
91 |
+
}
|
92 |
+
public function getNmsField1(){
|
93 |
+
return $this->_getNmsField1();
|
94 |
+
}
|
95 |
+
public function getNmsField2(){
|
96 |
+
return $this->_getNmsField2();
|
97 |
+
}
|
98 |
+
public function getNmsTooFast(){
|
99 |
+
return $this->_getNmsTooFast();
|
100 |
+
}
|
101 |
+
public function createvalue(){
|
102 |
+
$nms_field_1 = $this->_getNmsField1();
|
103 |
+
$nms_field_2 = $this->_getNmsField2();
|
104 |
+
$hash_result = hash("sha256", $nms_field_2 . $nms_field_1);
|
105 |
+
return $hash_result;
|
106 |
+
}
|
107 |
+
public function sendEmailNoMore(){
|
108 |
+
//$translate = Mage::getSingleton('core/translate');
|
109 |
+
/* @var $translate Mage_Core_Model_Translate */
|
110 |
+
//$translate->setTranslateInline(false);
|
111 |
+
$sender_email = mage::getStoreConfig("no_more_spam/no_spam/new_no_spam_email_sender");
|
112 |
+
$sender_name = mage::getStoreConfig("no_more_spam/no_spam/new_no_spam_name_sender");
|
113 |
+
$sender[] = array(
|
114 |
+
'email' => $sender_email,
|
115 |
+
'name' => $sender_name
|
116 |
+
);
|
117 |
+
$recipient_email = mage::getStoreConfig("no_more_spam/no_spam/new_no_spam_review_notify");
|
118 |
+
$recipient_name = mage::getStoreConfig("no_more_spam/no_spam/new_no_spam_review_notify_name");
|
119 |
+
$email_subject = mage::getStoreConfig("no_more_spam/no_spam/email_subject");
|
120 |
+
$email_body = mage::getStoreConfig("no_more_spam/no_spam/email_body");
|
121 |
+
$mailTemplate = Mage::getModel('core/email_template');
|
122 |
+
/* @var $mailTemplate Mage_Core_Model_Email_Template */
|
123 |
+
|
124 |
+
$template = self::XML_PATH_EMAIL_NO_MORE_SPAM;
|
125 |
+
//create the object
|
126 |
+
$mail = Mage::getModel('core/email');
|
127 |
+
//set the reciever name
|
128 |
+
$mail->setToName($recipient_name);
|
129 |
+
//set the reciever mail
|
130 |
+
$mail->setToEmail($recipient_email);
|
131 |
+
//mail body
|
132 |
+
$mail->setBody($email_body);
|
133 |
+
//set subject
|
134 |
+
$mail->setSubject($email_subject);
|
135 |
+
//set sender mail id
|
136 |
+
$mail->setFromEmail($sender_email);
|
137 |
+
//message in subject
|
138 |
+
$mail->setFromName($sender_name);
|
139 |
+
// YOu can use Html or text as Mail format
|
140 |
+
$mail->setType('html');
|
141 |
+
|
142 |
+
try {
|
143 |
+
//send mail
|
144 |
+
$mail->send();
|
145 |
+
//show success msg
|
146 |
+
Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
|
147 |
+
// redirect to url
|
148 |
+
//$this->_redirect('');
|
149 |
+
}
|
150 |
+
catch (Exception $e) {
|
151 |
+
//if not success then show error msg
|
152 |
+
Mage::getSingleton('core/session')->addError('Unable to send.');
|
153 |
+
//$this->_redirect('');
|
154 |
+
}
|
155 |
+
}
|
156 |
+
public function _getUrlActive($id){
|
157 |
+
//$status = Mage_Review_Model_Review::STATUS_APPROVED;
|
158 |
+
//$reviews = array();
|
159 |
+
//$reviews[1] = $id;
|
160 |
+
//return Mage::helper("adminhtml")->getUrl('adminhtml/catalog_product_review/massUpdateStatus', array('reviews' => $reviews, 'status' => $status));
|
161 |
+
return Mage::getUrl('nomorespam/active/active', array('id' => $id));
|
162 |
+
}
|
163 |
+
public function _getUrlDelete($id){
|
164 |
+
return Mage::helper("adminhtml")->getUrl('adminhtml/catalog_product_review/delete', array('id' => $id));
|
165 |
+
//return Mage::getUrl('nomorespam/active/delete', array('id' => $id));
|
166 |
+
}
|
167 |
+
public function sendEmailNotify($ids)
|
168 |
+
{
|
169 |
+
$templateId = mage::getStoreConfig(self::XML_PATH_EMAIL_NO_MORE_SPAM);
|
170 |
+
$sender_email = mage::getStoreConfig("no_more_spam/no_spam/new_no_spam_email_sender");
|
171 |
+
$sender_name = mage::getStoreConfig("no_more_spam/no_spam/new_no_spam_name_sender");
|
172 |
+
$sender = array(
|
173 |
+
'email' => $sender_email,
|
174 |
+
'name' => $sender_name
|
175 |
+
);
|
176 |
+
// $sender = Array('name' => 'Ankur',
|
177 |
+
// 'email' => 'test@test.com');
|
178 |
+
//recepient
|
179 |
+
// $email = 'hong@moogento.com';
|
180 |
+
// $emailName = 'Ankur';
|
181 |
+
$html = "";
|
182 |
+
foreach($ids as $id){
|
183 |
+
$url_active = $this->_getUrlActive($id);
|
184 |
+
$url_delete = $this->_getUrlDelete($id);
|
185 |
+
$html = $html . $url_active . "<br />" . $url_delete . "<br />";
|
186 |
+
unset($url_active);
|
187 |
+
unset($url_delete);
|
188 |
+
}
|
189 |
+
|
190 |
+
$recipient_email = mage::getStoreConfig("no_more_spam/no_spam/new_no_spam_review_notify");
|
191 |
+
$recipient_name = mage::getStoreConfig("no_more_spam/no_spam/new_no_spam_review_notify_name");
|
192 |
+
$vars = Array();
|
193 |
+
$vars = Array(
|
194 |
+
);
|
195 |
+
$storeId = Mage::app()->getStore()->getId();
|
196 |
+
$translate = Mage::getSingleton('core/translate');
|
197 |
+
try {
|
198 |
+
Mage::getModel('core/email_template')
|
199 |
+
->sendTransactional($templateId, $sender, $recipient_email, $recipient_name, $vars, $storeId);
|
200 |
+
Mage::getSingleton('core/session')->addSuccess('Email has been sent');
|
201 |
+
}
|
202 |
+
catch(Exception $e){
|
203 |
+
Mage::getSingleton('core/session')->addError('Unable to send email.');
|
204 |
+
}
|
205 |
+
$translate->setTranslateInline(true);
|
206 |
+
}
|
207 |
+
}
|
app/code/community/Moogento/NoMoreSpam/Model/Email.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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_Email extends Varien_Object
|
28 |
+
{
|
29 |
+
public function _sendAnEmail(){
|
30 |
+
$storeId = Mage::app()->getStore()->getId();
|
31 |
+
//$templateId = 'catalog_giftrequest_email_template';//here you can use template id defined in XML or you can use template ID in database (would be 1,2,3,4 .....etc)
|
32 |
+
$mailSubject = Mage::getStoreConfig('no_more_spam/no_spam/email_subject');
|
33 |
+
$mailBody = Mage::getStoreConfig('no_more_spam/no_spam/email_body');
|
34 |
+
$sender = array('name' => $from,
|
35 |
+
'email' => $from);
|
36 |
+
$email = $to;
|
37 |
+
|
38 |
+
$name = '';
|
39 |
+
|
40 |
+
$mailTemplate = Mage::getModel('core/email_template');
|
41 |
+
|
42 |
+
$mailTemplate->setTemplateSubject($mailSubject)
|
43 |
+
->sendTransactional($templateId, $sender, $email, $name, $vars, $storeId);
|
44 |
+
}
|
45 |
+
}
|
app/code/community/Moogento/NoMoreSpam/Model/NoMoreSpam.php
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
public function getReviewsToday(){
|
35 |
+
$today = date("Y-m-d");
|
36 |
+
$review_collection = Mage::getModel('review/review')->getCollection();
|
37 |
+
$review_collection = $review_collection->addFieldToFilter('created_at',
|
38 |
+
array(
|
39 |
+
'from' => $today,
|
40 |
+
));
|
41 |
+
return $review_collection;
|
42 |
+
}
|
43 |
+
public function sendEmailReview(){
|
44 |
+
|
45 |
+
$review_collection = $this->getReviewsToday();
|
46 |
+
$ids = array();
|
47 |
+
foreach($review_collection as $review){
|
48 |
+
|
49 |
+
$ids[] = $review->getData('review_id');
|
50 |
+
}
|
51 |
+
Mage::helper("nomorespam")->sendEmailNotify($ids);
|
52 |
+
}
|
53 |
+
}
|
app/code/community/Moogento/NoMoreSpam/Model/Status.php
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/community/Moogento/NoMoreSpam/controllers/ActiveController.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
class Moogento_NoMoreSpam_ActiveController extends Mage_Core_Controller_Front_Action
|
27 |
+
{
|
28 |
+
public function activeAction(){
|
29 |
+
$this->loadLayout();
|
30 |
+
$id = $this->getRequest()->getParam("id");
|
31 |
+
$review = Mage::getModel('review/review')->load($id);
|
32 |
+
try{
|
33 |
+
$review->setStatusId(Mage_Review_Model_Review::STATUS_APPROVED);
|
34 |
+
Mage::getSingleton('core/session')->addSuccess('The review has been approved');
|
35 |
+
$review->save();
|
36 |
+
}
|
37 |
+
catch(Exception $e){
|
38 |
+
|
39 |
+
}
|
40 |
+
$this->renderLayout();
|
41 |
+
}
|
42 |
+
public function deleteAction(){
|
43 |
+
$this->loadLayout();
|
44 |
+
$id = $this->getRequest()->getParam("id");
|
45 |
+
$review = Mage::getModel('review/review')->load($id);
|
46 |
+
$review->delete();
|
47 |
+
$this->renderLayout();
|
48 |
+
}
|
49 |
+
}
|
app/code/community/Moogento/NoMoreSpam/controllers/Customer/AccountController.php
ADDED
@@ -0,0 +1,243 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/Customer/controllers/AccountController.php';
|
27 |
+
class Moogento_NoMoreSpam_Customer_AccountController extends Mage_Customer_AccountController
|
28 |
+
{
|
29 |
+
private $_spam_link_words = array('a href', '[url', 'http', '://', '[link', 'www.');
|
30 |
+
|
31 |
+
private function getHashKey(){
|
32 |
+
$nms_field_1 = mage::getStoreConfig("no_more_spam/no_spam/field_1");
|
33 |
+
$nms_field_2 = mage::getStoreConfig("no_more_spam/no_spam/field_2");
|
34 |
+
$hash_result = hash("sha256", $nms_field_2 . $nms_field_1);
|
35 |
+
return $hash_result;
|
36 |
+
}
|
37 |
+
|
38 |
+
private function checkHashKey($key_form, $empty_key){
|
39 |
+
$hash_key = $this->getHashKey();
|
40 |
+
$isKey = false;
|
41 |
+
if(($key_form==$hash_key) && $empty_key==''){
|
42 |
+
$isKey = true;
|
43 |
+
}
|
44 |
+
return $isKey;
|
45 |
+
}
|
46 |
+
|
47 |
+
private function _checkForLink($text){
|
48 |
+
foreach($this->_spam_link_words as $a) {
|
49 |
+
if (stripos($text,$a) !== false) return true;
|
50 |
+
}
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
+
private function _checkManualSpam(){
|
55 |
+
$has_spam = FALSE;
|
56 |
+
$time_end = microtime(true);
|
57 |
+
try {
|
58 |
+
$check_name_yn = 1;
|
59 |
+
$check_message_yn = 0;
|
60 |
+
$field_toofast = Mage::helper("nomorespam")->getNmsTooFast();
|
61 |
+
$post = $this->getRequest()->getPost();
|
62 |
+
$check_review_yn = mage::getStoreConfig('no_more_spam/no_spam/enabled_review_review_link');
|
63 |
+
$check_title_yn = mage::getStoreConfig('no_more_spam/no_spam/enabled_review_title_link');
|
64 |
+
$check_faster_yn = mage::getStoreConfig('no_more_spam/no_spam/too_fast_form');
|
65 |
+
|
66 |
+
if(($check_review_yn == 1) && (isset($post['detail'])) && (trim($post['detail'])!='') ) {
|
67 |
+
if($this->_checkForLink($post['detail']) === TRUE) {$has_spam = TRUE;}
|
68 |
+
}
|
69 |
+
|
70 |
+
if(($check_title_yn == 1) && (isset($post['title'])) && (trim($post['title'])!='') ) {
|
71 |
+
if($this->_checkForLink($post['title']) === TRUE) {$has_spam = TRUE;}
|
72 |
+
}
|
73 |
+
|
74 |
+
if(($check_faster_yn == 1) && (isset($post[$field_toofast])) && (trim($post[$field_toofast])!='') ) {
|
75 |
+
$time_start = $post[$field_toofast];
|
76 |
+
if($time_end - $time_start <=3 ) {$has_spam = TRUE;}
|
77 |
+
}
|
78 |
+
} catch (Exception $e) {
|
79 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Error: Unable to send this message. Please, try again later').' '.$e);
|
80 |
+
$this->_redirect('*/*/');
|
81 |
+
}
|
82 |
+
return $has_spam;
|
83 |
+
}
|
84 |
+
/**
|
85 |
+
* Create customer account action
|
86 |
+
*/
|
87 |
+
public function createPostAction()
|
88 |
+
{
|
89 |
+
$data = $this->getRequest()->getPost();
|
90 |
+
$isKeyHash = false;
|
91 |
+
$field_1 = Mage::helper("nomorespam")->getNmsField1();
|
92 |
+
$empty_text = Mage::helper("nomorespam")->getNmsField2();
|
93 |
+
|
94 |
+
if(isset($data[$field_1]) && isset($data[$empty_text])){
|
95 |
+
$isKeyHash = $this->checkHashKey($data[$field_1], $data[$empty_text]);
|
96 |
+
}
|
97 |
+
//else $isKeyHash = true; //
|
98 |
+
$enable_create_account = mage::getStoreConfig("no_more_spam/no_spam/create_account");
|
99 |
+
if(!$enable_create_account) $isKeyHash = true; // if this section is off in nomorespam config then don't check our fields
|
100 |
+
|
101 |
+
/** @var $session Mage_Customer_Model_Session */
|
102 |
+
$session = $this->_getSession();
|
103 |
+
if ($session->isLoggedIn()) {
|
104 |
+
$this->_redirect('*/*/');
|
105 |
+
return;
|
106 |
+
}
|
107 |
+
$session->setEscapeMessages(true); // prevent XSS injection in user input
|
108 |
+
if (!$this->getRequest()->isPost()) {
|
109 |
+
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
110 |
+
$this->_redirectError($errUrl);
|
111 |
+
return;
|
112 |
+
}
|
113 |
+
if($isKeyHash){
|
114 |
+
$customer = $this->_getCustomer();
|
115 |
+
|
116 |
+
try {
|
117 |
+
$errors = $this->_getCustomerErrors($customer);
|
118 |
+
|
119 |
+
if (empty($errors)) {
|
120 |
+
$customer->save();
|
121 |
+
$this->_dispatchRegisterSuccess($customer);
|
122 |
+
$this->_successProcessRegistration($customer);
|
123 |
+
return;
|
124 |
+
} else {
|
125 |
+
$this->_addSessionError($errors);
|
126 |
+
}
|
127 |
+
} catch (Mage_Core_Exception $e) {
|
128 |
+
$session->setCustomerFormData($this->getRequest()->getPost());
|
129 |
+
if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
|
130 |
+
$url = $this->_getUrl('customer/account/forgotpassword');
|
131 |
+
$message = $this->__('There is already an account with this email address. If you are sure that it is your email address, <a href="%s">click here</a> to get your password and access your account.', $url);
|
132 |
+
$session->setEscapeMessages(false);
|
133 |
+
} else {
|
134 |
+
$message = $e->getMessage();
|
135 |
+
}
|
136 |
+
$session->addError($message);
|
137 |
+
} catch (Exception $e) {
|
138 |
+
$session->setCustomerFormData($this->getRequest()->getPost())
|
139 |
+
->addException($e, $this->__('Cannot save the customer.'));
|
140 |
+
}
|
141 |
+
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
142 |
+
$this->_redirectError($errUrl);
|
143 |
+
}
|
144 |
+
$session->addError($this->__('Unable create account.'));
|
145 |
+
$errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
146 |
+
$this->_redirectError($errUrl);
|
147 |
+
}
|
148 |
+
|
149 |
+
// public function postAction()
|
150 |
+
// {
|
151 |
+
// if ($data = Mage::getSingleton('review/session')->getFormData(true)) {
|
152 |
+
// $rating = array();
|
153 |
+
// if (isset($data['ratings']) && is_array($data['ratings'])) {
|
154 |
+
// $rating = $data['ratings'];
|
155 |
+
// }
|
156 |
+
// } else {
|
157 |
+
// $data = $this->getRequest()->getPost();
|
158 |
+
// $rating = $this->getRequest()->getParam('ratings', array());
|
159 |
+
// }
|
160 |
+
|
161 |
+
// $isKeyHash = false;
|
162 |
+
// $field_1 = Mage::helper("nomorespam")->getNmsField1();
|
163 |
+
// $empty_text = Mage::helper("nomorespam")->getNmsField2();
|
164 |
+
|
165 |
+
// if(isset($data[$field_1]) && isset($data[$empty_text])){
|
166 |
+
// $isKeyHash = $this->checkHashKey($data[$field_1], $data[$empty_text]);
|
167 |
+
// }
|
168 |
+
// //else $isKeyHash = true; //
|
169 |
+
// $enable_review = mage::getStoreConfig("no_more_spam/no_spam/enabled_review");
|
170 |
+
// if(!$enable_review) $isKeyHash = true; // if this section is off in nomorespam config then don't check our fields
|
171 |
+
|
172 |
+
// $session = Mage::getSingleton('core/session');
|
173 |
+
// /* @var $session Mage_Core_Model_Session */
|
174 |
+
// $review = Mage::getModel('review/review')->setData($data);
|
175 |
+
// /* @var $review Mage_Review_Model_Review */
|
176 |
+
// if (($product = $this->_initProduct()) && !empty($data) && $isKeyHash) {
|
177 |
+
// // $session = Mage::getSingleton('core/session');
|
178 |
+
// // /* @var $session Mage_Core_Model_Session */
|
179 |
+
// // $review = Mage::getModel('review/review')->setData($data);
|
180 |
+
// // /* @var $review Mage_Review_Model_Review */
|
181 |
+
|
182 |
+
// $validate = $review->validate();
|
183 |
+
// if ($validate === true) {
|
184 |
+
// if($this->_checkManualSpam()) {
|
185 |
+
// $session->addError($this->__('Unable to add this review at the moment.'));
|
186 |
+
// }
|
187 |
+
// else
|
188 |
+
// {
|
189 |
+
// if(count($rating) < 3){
|
190 |
+
// $session->addError($this->__('Unable to add this review at the moment. Please choise ratings'));
|
191 |
+
// }
|
192 |
+
// else{
|
193 |
+
// try {
|
194 |
+
// $review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))
|
195 |
+
// ->setEntityPkValue($product->getId())
|
196 |
+
// ->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)
|
197 |
+
// ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
|
198 |
+
// ->setStoreId(Mage::app()->getStore()->getId())
|
199 |
+
// ->setStores(array(Mage::app()->getStore()->getId()))
|
200 |
+
// ->save();
|
201 |
+
|
202 |
+
// foreach ($rating as $ratingId => $optionId) {
|
203 |
+
// Mage::getModel('rating/rating')
|
204 |
+
// ->setRatingId($ratingId)
|
205 |
+
// ->setReviewId($review->getId())
|
206 |
+
// ->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
|
207 |
+
// ->addOptionVote($optionId, $product->getId());
|
208 |
+
// }
|
209 |
+
|
210 |
+
// $review->aggregate();
|
211 |
+
// $session->addSuccess($this->__('Your review has been accepted for moderation.'));
|
212 |
+
// }
|
213 |
+
// catch (Exception $e) {
|
214 |
+
// $session->setFormData($data);
|
215 |
+
// $session->addError($this->__('Unable to add the review.'));
|
216 |
+
// }
|
217 |
+
// }
|
218 |
+
// }
|
219 |
+
// }
|
220 |
+
// else {
|
221 |
+
// $session->setFormData($data);
|
222 |
+
// if (is_array($validate)) {
|
223 |
+
// foreach ($validate as $errorMessage) {
|
224 |
+
// $session->addError($errorMessage);
|
225 |
+
// }
|
226 |
+
// $session->addError($this->__('Sorry, unable to post the review.'));
|
227 |
+
// }
|
228 |
+
// else {
|
229 |
+
// $session->addError($this->__('Unable to post the review.'));
|
230 |
+
// }
|
231 |
+
// }
|
232 |
+
// }else{
|
233 |
+
// $session->setFormData($data);
|
234 |
+
// $session->addError($this->__('Could\'t post the review, sorry.'));
|
235 |
+
// }
|
236 |
+
// //Mage::helper("nomorespam")->sendEmailNotify($review->getId());
|
237 |
+
// if ($redirectUrl = Mage::getSingleton('review/session')->getRedirectUrl(true)) {
|
238 |
+
// $this->_redirectUrl($redirectUrl);
|
239 |
+
// return;
|
240 |
+
// }
|
241 |
+
// $this->_redirectReferer();
|
242 |
+
// }
|
243 |
+
}
|
app/code/community/Moogento/NoMoreSpam/controllers/IndexController.php
ADDED
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 $_spam_link_words = array('a href', '[url', 'http', '://', '[link', 'www.');
|
30 |
+
|
31 |
+
private function _getHashKey(){
|
32 |
+
$nms_field_1 = mage::getStoreConfig("no_more_spam/no_spam/field_1");
|
33 |
+
$nms_field_2 = mage::getStoreConfig("no_more_spam/no_spam/field_2");
|
34 |
+
$hash_result = hash("sha256", $nms_field_2 . $nms_field_1);
|
35 |
+
return $hash_result;
|
36 |
+
}
|
37 |
+
|
38 |
+
private function _checkHashKey($key_form, $empty_key){
|
39 |
+
$hash_key = $this->_getHashKey();
|
40 |
+
$isKey = false;
|
41 |
+
if(($key_form==$hash_key) && $empty_key==''){
|
42 |
+
$isKey = true;
|
43 |
+
}
|
44 |
+
return $isKey;
|
45 |
+
}
|
46 |
+
|
47 |
+
private function _checkForLink($text){
|
48 |
+
foreach($this->_spam_link_words as $a) {
|
49 |
+
if (stripos($text,$a) !== false) return true;
|
50 |
+
}
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
+
private function _checkManualSpam(){
|
55 |
+
$has_spam = FALSE;
|
56 |
+
try {
|
57 |
+
$check_name_yn = 1;
|
58 |
+
$check_message_yn = 0;
|
59 |
+
$post = $this->getRequest()->getPost();
|
60 |
+
$check_name_yn = mage::getStoreConfig('no_more_spam/no_spam/enabled_email_name_link');
|
61 |
+
$check_message_yn = mage::getStoreConfig('no_more_spam/no_spam/enabled_email_message_link');
|
62 |
+
if(($check_name_yn == 1) && (isset($post['name'])) && (trim($post['name'])!='') ) {
|
63 |
+
if($this->_checkForLink($post['name']) === TRUE) {$has_spam = TRUE;}
|
64 |
+
}
|
65 |
+
|
66 |
+
if(($check_message_yn == 1) && (isset($post['comment'])) && (trim($post['comment'])!='') ) {
|
67 |
+
if($this->_checkForLink($post['comment']) === TRUE) {$has_spam = TRUE;}
|
68 |
+
}
|
69 |
+
} catch (Exception $e) {
|
70 |
+
$translate->setTranslateInline(true);
|
71 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to send this message. Please, try again later'));
|
72 |
+
$this->_redirect('*/*/');
|
73 |
+
}
|
74 |
+
return $has_spam;
|
75 |
+
}
|
76 |
+
|
77 |
+
public function postAction()
|
78 |
+
{
|
79 |
+
$post = $this->getRequest()->getPost();
|
80 |
+
$isKeyHash = false;
|
81 |
+
$field_1 = Mage::helper("nomorespam")->getNmsField1();
|
82 |
+
$empty_text = Mage::helper("nomorespam")->getNmsField2();
|
83 |
+
if(isset($post[$field_1]) && isset($post[$empty_text])){
|
84 |
+
$isKeyHash = $this->_checkHashKey($post[$field_1], $post[$empty_text]);
|
85 |
+
}
|
86 |
+
$enable_email = mage::getStoreConfig("no_more_spam/no_spam/enabled_email");
|
87 |
+
if ( $post && $isKeyHash && $enable_email) {
|
88 |
+
$translate = Mage::getSingleton('core/translate');
|
89 |
+
/* @var $translate Mage_Core_Model_Translate */
|
90 |
+
$translate->setTranslateInline(false);
|
91 |
+
try {
|
92 |
+
$postObject = new Varien_Object();
|
93 |
+
$postObject->setData($post);
|
94 |
+
|
95 |
+
$error = false;
|
96 |
+
|
97 |
+
if (!Zend_Validate::is(trim($post['name']) , 'NotEmpty')) {
|
98 |
+
$error = true;
|
99 |
+
}
|
100 |
+
|
101 |
+
if (!Zend_Validate::is(trim($post['comment']) , 'NotEmpty')) {
|
102 |
+
$error = true;
|
103 |
+
}
|
104 |
+
|
105 |
+
if (!Zend_Validate::is(trim($post['email']), 'EmailAddress')) {
|
106 |
+
$error = true;
|
107 |
+
}
|
108 |
+
|
109 |
+
if (Zend_Validate::is(trim($post['hideit']), 'NotEmpty')) {
|
110 |
+
$error = true;
|
111 |
+
}
|
112 |
+
|
113 |
+
if($this->_checkManualSpam()) {
|
114 |
+
$error = true;
|
115 |
+
}
|
116 |
+
|
117 |
+
if ($error) {
|
118 |
+
throw new Exception();
|
119 |
+
}
|
120 |
+
$mailTemplate = Mage::getModel('core/email_template');
|
121 |
+
/* @var $mailTemplate Mage_Core_Model_Email_Template */
|
122 |
+
$mailTemplate->setDesignConfig(array('area' => 'frontend'))
|
123 |
+
->setReplyTo($post['email'])
|
124 |
+
->sendTransactional(
|
125 |
+
Mage::getStoreConfig(self::XML_PATH_EMAIL_TEMPLATE),
|
126 |
+
Mage::getStoreConfig(self::XML_PATH_EMAIL_SENDER),
|
127 |
+
Mage::getStoreConfig(self::XML_PATH_EMAIL_RECIPIENT),
|
128 |
+
null,
|
129 |
+
array('data' => $postObject)
|
130 |
+
);
|
131 |
+
|
132 |
+
if (!$mailTemplate->getSentSuccess()) {
|
133 |
+
throw new Exception();
|
134 |
+
}
|
135 |
+
|
136 |
+
$translate->setTranslateInline(true);
|
137 |
+
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.'));
|
138 |
+
$this->_redirect('*/*/');
|
139 |
+
|
140 |
+
return;
|
141 |
+
} catch (Exception $e) {
|
142 |
+
$translate->setTranslateInline(true);
|
143 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to send message. Please, try again later'));
|
144 |
+
$this->_redirect('*/*/');
|
145 |
+
return;
|
146 |
+
}
|
147 |
+
|
148 |
+
} else {
|
149 |
+
$translate = Mage::getSingleton('core/translate');
|
150 |
+
$translate->setTranslateInline(true);
|
151 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Unable to submit your request. Please, try again later'));
|
152 |
+
$this->_redirect('*/*/');
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}
|
app/code/community/Moogento/NoMoreSpam/controllers/Newsletter/SubscriberController.php
ADDED
@@ -0,0 +1,208 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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/Newsletter/controllers/SubscriberController.php';
|
27 |
+
class Moogento_NoMoreSpam_Newsletter_SubscriberController extends Mage_Newsletter_SubscriberController
|
28 |
+
{
|
29 |
+
private $_spam_link_words = array('a href', '[url', 'http', '://', '[link', 'www.');
|
30 |
+
|
31 |
+
private function getHashKey(){
|
32 |
+
$nms_field_1 = mage::getStoreConfig("no_more_spam/no_spam/field_1");
|
33 |
+
$nms_field_2 = mage::getStoreConfig("no_more_spam/no_spam/field_2");
|
34 |
+
$hash_result = hash("sha256", $nms_field_2 . $nms_field_1);
|
35 |
+
return $hash_result;
|
36 |
+
}
|
37 |
+
|
38 |
+
private function checkHashKey($key_form, $empty_key){
|
39 |
+
$hash_key = $this->getHashKey();
|
40 |
+
$isKey = false;
|
41 |
+
if(($key_form==$hash_key) && $empty_key==''){
|
42 |
+
$isKey = true;
|
43 |
+
}
|
44 |
+
return $isKey;
|
45 |
+
}
|
46 |
+
|
47 |
+
private function _checkForLink($text){
|
48 |
+
foreach($this->_spam_link_words as $a) {
|
49 |
+
if (stripos($text,$a) !== false) return true;
|
50 |
+
}
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
+
private function _checkManualSpam(){
|
55 |
+
$has_spam = FALSE;
|
56 |
+
$time_end = microtime(true);
|
57 |
+
try {
|
58 |
+
$check_name_yn = 1;
|
59 |
+
$check_message_yn = 0;
|
60 |
+
$field_toofast = Mage::helper("nomorespam")->getNmsTooFast();
|
61 |
+
$post = $this->getRequest()->getPost();
|
62 |
+
$check_review_yn = mage::getStoreConfig('no_more_spam/no_spam/enabled_review_review_link');
|
63 |
+
$check_title_yn = mage::getStoreConfig('no_more_spam/no_spam/enabled_review_title_link');
|
64 |
+
$check_faster_yn = mage::getStoreConfig('no_more_spam/no_spam/too_fast_form');
|
65 |
+
|
66 |
+
if(($check_review_yn == 1) && (isset($post['detail'])) && (trim($post['detail'])!='') ) {
|
67 |
+
if($this->_checkForLink($post['detail']) === TRUE) {$has_spam = TRUE;}
|
68 |
+
}
|
69 |
+
|
70 |
+
if(($check_title_yn == 1) && (isset($post['title'])) && (trim($post['title'])!='') ) {
|
71 |
+
if($this->_checkForLink($post['title']) === TRUE) {$has_spam = TRUE;}
|
72 |
+
}
|
73 |
+
|
74 |
+
if(($check_faster_yn == 1) && (isset($post[$field_toofast])) && (trim($post[$field_toofast])!='') ) {
|
75 |
+
$time_start = $post[$field_toofast];
|
76 |
+
if($time_end - $time_start <=3 ) {$has_spam = TRUE;}
|
77 |
+
}
|
78 |
+
} catch (Exception $e) {
|
79 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Error: Unable to send this message. Please, try again later').' '.$e);
|
80 |
+
$this->_redirect('*/*/');
|
81 |
+
}
|
82 |
+
return $has_spam;
|
83 |
+
}
|
84 |
+
/**
|
85 |
+
* New subscription action
|
86 |
+
*/
|
87 |
+
public function newAction()
|
88 |
+
{
|
89 |
+
$data = $this->getRequest()->getPost();
|
90 |
+
$isKeyHash = false;
|
91 |
+
$field_1 = Mage::helper("nomorespam")->getNmsField1();
|
92 |
+
$empty_text = Mage::helper("nomorespam")->getNmsField2();
|
93 |
+
|
94 |
+
if(isset($data[$field_1]) && isset($data[$empty_text])){
|
95 |
+
$isKeyHash = $this->checkHashKey($data[$field_1], $data[$empty_text]);
|
96 |
+
}
|
97 |
+
//else $isKeyHash = true; //
|
98 |
+
$enabled_newsletter = mage::getStoreConfig("no_more_spam/no_spam/enabled_newsletter");
|
99 |
+
$session = Mage::getSingleton('core/session');
|
100 |
+
if(!$enabled_newsletter) $isKeyHash = true; // if this section is off in nomorespam config then don't check our fields
|
101 |
+
if ($this->getRequest()->isPost() && $this->getRequest()->getPost('email') && $isKeyHash) {
|
102 |
+
$customerSession = Mage::getSingleton('customer/session');
|
103 |
+
$email = (string) $this->getRequest()->getPost('email');
|
104 |
+
|
105 |
+
try {
|
106 |
+
if (!Zend_Validate::is($email, 'EmailAddress')) {
|
107 |
+
Mage::throwException($this->__('Please enter a valid email address.'));
|
108 |
+
}
|
109 |
+
|
110 |
+
if (Mage::getStoreConfig(Mage_Newsletter_Model_Subscriber::XML_PATH_ALLOW_GUEST_SUBSCRIBE_FLAG) != 1 &&
|
111 |
+
!$customerSession->isLoggedIn()) {
|
112 |
+
Mage::throwException($this->__('Sorry, but administrator denied subscription for guests. Please <a href="%s">register</a>.', Mage::helper('customer')->getRegisterUrl()));
|
113 |
+
}
|
114 |
+
|
115 |
+
$ownerId = Mage::getModel('customer/customer')
|
116 |
+
->setWebsiteId(Mage::app()->getStore()->getWebsiteId())
|
117 |
+
->loadByEmail($email)
|
118 |
+
->getId();
|
119 |
+
if ($ownerId !== null && $ownerId != $customerSession->getId()) {
|
120 |
+
Mage::throwException($this->__('This email address is already assigned to another user.'));
|
121 |
+
}
|
122 |
+
|
123 |
+
$status = Mage::getModel('newsletter/subscriber')->subscribe($email);
|
124 |
+
if ($status == Mage_Newsletter_Model_Subscriber::STATUS_NOT_ACTIVE) {
|
125 |
+
$session->addSuccess($this->__('Confirmation request has been sent.'));
|
126 |
+
}
|
127 |
+
else {
|
128 |
+
$session->addSuccess($this->__('Thank you for your subscription.'));
|
129 |
+
}
|
130 |
+
}
|
131 |
+
catch (Mage_Core_Exception $e) {
|
132 |
+
$session->addException($e, $this->__('There was a problem with the subscription: %s', $e->getMessage()));
|
133 |
+
}
|
134 |
+
catch (Exception $e) {
|
135 |
+
$session->addException($e, $this->__('There was a problem with the subscription.'));
|
136 |
+
}
|
137 |
+
$this->_redirectReferer();
|
138 |
+
}
|
139 |
+
else{
|
140 |
+
$session->addError($this->__('Unable subscription.'));
|
141 |
+
$this->_redirectReferer();
|
142 |
+
}
|
143 |
+
}
|
144 |
+
// /**
|
145 |
+
// * Create customer account action
|
146 |
+
// */
|
147 |
+
// public function createPostAction()
|
148 |
+
// {
|
149 |
+
// $data = $this->getRequest()->getPost();
|
150 |
+
// $isKeyHash = false;
|
151 |
+
// $field_1 = Mage::helper("nomorespam")->getNmsField1();
|
152 |
+
// $empty_text = Mage::helper("nomorespam")->getNmsField2();
|
153 |
+
|
154 |
+
// if(isset($data[$field_1]) && isset($data[$empty_text])){
|
155 |
+
// $isKeyHash = $this->checkHashKey($data[$field_1], $data[$empty_text]);
|
156 |
+
// }
|
157 |
+
// //else $isKeyHash = true; //
|
158 |
+
// $enable_create_account = mage::getStoreConfig("no_more_spam/no_spam/create_account");
|
159 |
+
// if(!$enable_create_account) $isKeyHash = true; // if this section is off in nomorespam config then don't check our fields
|
160 |
+
|
161 |
+
// /** @var $session Mage_Customer_Model_Session */
|
162 |
+
// $session = $this->_getSession();
|
163 |
+
// if ($session->isLoggedIn()) {
|
164 |
+
// $this->_redirect('*/*/');
|
165 |
+
// return;
|
166 |
+
// }
|
167 |
+
// $session->setEscapeMessages(true); // prevent XSS injection in user input
|
168 |
+
// if (!$this->getRequest()->isPost()) {
|
169 |
+
// $errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
170 |
+
// $this->_redirectError($errUrl);
|
171 |
+
// return;
|
172 |
+
// }
|
173 |
+
// if($isKeyHash){
|
174 |
+
// $customer = $this->_getCustomer();
|
175 |
+
|
176 |
+
// try {
|
177 |
+
// $errors = $this->_getCustomerErrors($customer);
|
178 |
+
|
179 |
+
// if (empty($errors)) {
|
180 |
+
// $customer->save();
|
181 |
+
// $this->_dispatchRegisterSuccess($customer);
|
182 |
+
// $this->_successProcessRegistration($customer);
|
183 |
+
// return;
|
184 |
+
// } else {
|
185 |
+
// $this->_addSessionError($errors);
|
186 |
+
// }
|
187 |
+
// } catch (Mage_Core_Exception $e) {
|
188 |
+
// $session->setCustomerFormData($this->getRequest()->getPost());
|
189 |
+
// if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
|
190 |
+
// $url = $this->_getUrl('customer/account/forgotpassword');
|
191 |
+
// $message = $this->__('There is already an account with this email address. If you are sure that it is your email address, <a href="%s">click here</a> to get your password and access your account.', $url);
|
192 |
+
// $session->setEscapeMessages(false);
|
193 |
+
// } else {
|
194 |
+
// $message = $e->getMessage();
|
195 |
+
// }
|
196 |
+
// $session->addError($message);
|
197 |
+
// } catch (Exception $e) {
|
198 |
+
// $session->setCustomerFormData($this->getRequest()->getPost())
|
199 |
+
// ->addException($e, $this->__('Cannot save the customer.'));
|
200 |
+
// }
|
201 |
+
// $errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
202 |
+
// $this->_redirectError($errUrl);
|
203 |
+
// }
|
204 |
+
// $session->addError($this->__('Unable create account.'));
|
205 |
+
// $errUrl = $this->_getUrl('*/*/create', array('_secure' => true));
|
206 |
+
// $this->_redirectError($errUrl);
|
207 |
+
// }
|
208 |
+
}
|
app/code/community/Moogento/NoMoreSpam/controllers/Review/ProductController.php
ADDED
@@ -0,0 +1,180 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 $_spam_link_words = array('a href', '[url', 'http', '://', '[link', 'www.');
|
30 |
+
|
31 |
+
private function getHashKey(){
|
32 |
+
$nms_field_1 = mage::getStoreConfig("no_more_spam/no_spam/field_1");
|
33 |
+
$nms_field_2 = mage::getStoreConfig("no_more_spam/no_spam/field_2");
|
34 |
+
$hash_result = hash("sha256", $nms_field_2 . $nms_field_1);
|
35 |
+
return $hash_result;
|
36 |
+
}
|
37 |
+
|
38 |
+
private function checkHashKey($key_form, $empty_key){
|
39 |
+
$hash_key = $this->getHashKey();
|
40 |
+
$isKey = false;
|
41 |
+
if(($key_form==$hash_key) && $empty_key==''){
|
42 |
+
$isKey = true;
|
43 |
+
}
|
44 |
+
return $isKey;
|
45 |
+
}
|
46 |
+
|
47 |
+
private function _checkForLink($text){
|
48 |
+
foreach($this->_spam_link_words as $a) {
|
49 |
+
if (stripos($text,$a) !== false) return true;
|
50 |
+
}
|
51 |
+
return false;
|
52 |
+
}
|
53 |
+
|
54 |
+
private function _checkManualSpam(){
|
55 |
+
$has_spam = FALSE;
|
56 |
+
$time_end = microtime(true);
|
57 |
+
try {
|
58 |
+
$check_name_yn = 1;
|
59 |
+
$check_message_yn = 0;
|
60 |
+
$field_toofast = Mage::helper("nomorespam")->getNmsTooFast();
|
61 |
+
$post = $this->getRequest()->getPost();
|
62 |
+
$check_review_yn = mage::getStoreConfig('no_more_spam/no_spam/enabled_review_review_link');
|
63 |
+
$check_title_yn = mage::getStoreConfig('no_more_spam/no_spam/enabled_review_title_link');
|
64 |
+
$check_faster_yn = mage::getStoreConfig('no_more_spam/no_spam/too_fast_form');
|
65 |
+
|
66 |
+
if(($check_review_yn == 1) && (isset($post['detail'])) && (trim($post['detail'])!='') ) {
|
67 |
+
if($this->_checkForLink($post['detail']) === TRUE) {$has_spam = TRUE;}
|
68 |
+
}
|
69 |
+
|
70 |
+
if(($check_title_yn == 1) && (isset($post['title'])) && (trim($post['title'])!='') ) {
|
71 |
+
if($this->_checkForLink($post['title']) === TRUE) {$has_spam = TRUE;}
|
72 |
+
}
|
73 |
+
|
74 |
+
if(($check_faster_yn == 1) && (isset($post[$field_toofast])) && (trim($post[$field_toofast])!='') ) {
|
75 |
+
$time_start = $post[$field_toofast];
|
76 |
+
if($time_end - $time_start <=3 ) {$has_spam = TRUE;}
|
77 |
+
}
|
78 |
+
} catch (Exception $e) {
|
79 |
+
Mage::getSingleton('customer/session')->addError(Mage::helper('contacts')->__('Error: Unable to send this message. Please, try again later').' '.$e);
|
80 |
+
$this->_redirect('*/*/');
|
81 |
+
}
|
82 |
+
return $has_spam;
|
83 |
+
}
|
84 |
+
|
85 |
+
public function postAction()
|
86 |
+
{
|
87 |
+
if ($data = Mage::getSingleton('review/session')->getFormData(true)) {
|
88 |
+
$rating = array();
|
89 |
+
if (isset($data['ratings']) && is_array($data['ratings'])) {
|
90 |
+
$rating = $data['ratings'];
|
91 |
+
}
|
92 |
+
} else {
|
93 |
+
$data = $this->getRequest()->getPost();
|
94 |
+
$rating = $this->getRequest()->getParam('ratings', array());
|
95 |
+
}
|
96 |
+
|
97 |
+
$isKeyHash = false;
|
98 |
+
$field_1 = Mage::helper("nomorespam")->getNmsField1();
|
99 |
+
$empty_text = Mage::helper("nomorespam")->getNmsField2();
|
100 |
+
|
101 |
+
if(isset($data[$field_1]) && isset($data[$empty_text])){
|
102 |
+
$isKeyHash = $this->checkHashKey($data[$field_1], $data[$empty_text]);
|
103 |
+
}
|
104 |
+
//else $isKeyHash = true; //
|
105 |
+
$enable_review = mage::getStoreConfig("no_more_spam/no_spam/enabled_review");
|
106 |
+
$enable_review_rating = mage::getStoreConfig("no_more_spam/no_spam/enabled_review_rating");
|
107 |
+
if(!$enable_review) $isKeyHash = true; // if this section is off in nomorespam config then don't check our fields
|
108 |
+
|
109 |
+
$session = Mage::getSingleton('core/session');
|
110 |
+
/* @var $session Mage_Core_Model_Session */
|
111 |
+
$review = Mage::getModel('review/review')->setData($data);
|
112 |
+
/* @var $review Mage_Review_Model_Review */
|
113 |
+
if (($product = $this->_initProduct()) && !empty($data) && $isKeyHash) {
|
114 |
+
// $session = Mage::getSingleton('core/session');
|
115 |
+
// /* @var $session Mage_Core_Model_Session */
|
116 |
+
// $review = Mage::getModel('review/review')->setData($data);
|
117 |
+
// /* @var $review Mage_Review_Model_Review */
|
118 |
+
|
119 |
+
$validate = $review->validate();
|
120 |
+
if ($validate === true) {
|
121 |
+
if($this->_checkManualSpam()) {
|
122 |
+
$session->addError($this->__('Unable to add this review at the moment.'));
|
123 |
+
}
|
124 |
+
else
|
125 |
+
{
|
126 |
+
if(count($rating) < 3 && $enable_review_rating == 1){
|
127 |
+
$session->addError($this->__('Unable to add this review at the moment. Please choise ratings'));
|
128 |
+
}
|
129 |
+
else{
|
130 |
+
try {
|
131 |
+
$review->setEntityId($review->getEntityIdByCode(Mage_Review_Model_Review::ENTITY_PRODUCT_CODE))
|
132 |
+
->setEntityPkValue($product->getId())
|
133 |
+
->setStatusId(Mage_Review_Model_Review::STATUS_PENDING)
|
134 |
+
->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
|
135 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
136 |
+
->setStores(array(Mage::app()->getStore()->getId()))
|
137 |
+
->save();
|
138 |
+
|
139 |
+
foreach ($rating as $ratingId => $optionId) {
|
140 |
+
Mage::getModel('rating/rating')
|
141 |
+
->setRatingId($ratingId)
|
142 |
+
->setReviewId($review->getId())
|
143 |
+
->setCustomerId(Mage::getSingleton('customer/session')->getCustomerId())
|
144 |
+
->addOptionVote($optionId, $product->getId());
|
145 |
+
}
|
146 |
+
|
147 |
+
$review->aggregate();
|
148 |
+
$session->addSuccess($this->__('Your review has been accepted for moderation.'));
|
149 |
+
}
|
150 |
+
catch (Exception $e) {
|
151 |
+
$session->setFormData($data);
|
152 |
+
$session->addError($this->__('Unable to add the review.'));
|
153 |
+
}
|
154 |
+
}
|
155 |
+
}
|
156 |
+
}
|
157 |
+
else {
|
158 |
+
$session->setFormData($data);
|
159 |
+
if (is_array($validate)) {
|
160 |
+
foreach ($validate as $errorMessage) {
|
161 |
+
$session->addError($errorMessage);
|
162 |
+
}
|
163 |
+
$session->addError($this->__('Sorry, unable to post the review.'));
|
164 |
+
}
|
165 |
+
else {
|
166 |
+
$session->addError($this->__('Unable to post the review.'));
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}else{
|
170 |
+
$session->setFormData($data);
|
171 |
+
$session->addError($this->__('Could\'t post the review, sorry.'));
|
172 |
+
}
|
173 |
+
//Mage::helper("nomorespam")->sendEmailNotify($review->getId());
|
174 |
+
if ($redirectUrl = Mage::getSingleton('review/session')->getRedirectUrl(true)) {
|
175 |
+
$this->_redirectUrl($redirectUrl);
|
176 |
+
return;
|
177 |
+
}
|
178 |
+
$this->_redirectReferer();
|
179 |
+
}
|
180 |
+
}
|
app/code/community/Moogento/NoMoreSpam/etc/adminhtml.xml
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>500</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/community/Moogento/NoMoreSpam/etc/config.xml
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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>1.0.5</version>
|
30 |
+
</Moogento_NoMoreSpam>
|
31 |
+
</modules>
|
32 |
+
<default>
|
33 |
+
<no_more_spam>
|
34 |
+
<no_spam>
|
35 |
+
<enabled_review_review_link>1</enabled_review_review_link>
|
36 |
+
<enabled_review_title_link>1</enabled_review_title_link>
|
37 |
+
<enabled_email_name_link>1</enabled_email_name_link>
|
38 |
+
<enabled_email_message_link>0</enabled_email_message_link>
|
39 |
+
<too_fast_form>1</too_fast_form>
|
40 |
+
<enabled_review_rating>1</enabled_review_rating>
|
41 |
+
<email_subject>New product review(s) submitted</email_subject>
|
42 |
+
<email_body>Hi, you have a new product review which has passed the NoMoreSpam! filtering system.</email_body>
|
43 |
+
</no_spam>
|
44 |
+
</no_more_spam>
|
45 |
+
</default>
|
46 |
+
<frontend>
|
47 |
+
<routers>
|
48 |
+
<contacts>
|
49 |
+
<args>
|
50 |
+
<modules>
|
51 |
+
<Moogento_NoMoreSpam before="Mage_Contacts">Moogento_NoMoreSpam</Moogento_NoMoreSpam>
|
52 |
+
</modules>
|
53 |
+
</args>
|
54 |
+
</contacts>
|
55 |
+
<review>
|
56 |
+
<args>
|
57 |
+
<modules>
|
58 |
+
<Moogento_NoMoreSpam before="Mage_Review">Moogento_NoMoreSpam_Review</Moogento_NoMoreSpam>
|
59 |
+
</modules>
|
60 |
+
</args>
|
61 |
+
</review>
|
62 |
+
<customer>
|
63 |
+
<args>
|
64 |
+
<modules>
|
65 |
+
<Moogento_NoMoreSpam before="Mage_Customer">Moogento_NoMoreSpam_Customer</Moogento_NoMoreSpam>
|
66 |
+
</modules>
|
67 |
+
</args>
|
68 |
+
</customer>
|
69 |
+
<newsletter>
|
70 |
+
<args>
|
71 |
+
<modules>
|
72 |
+
<Moogento_NoMoreSpam before="Mage_Newsletter">Moogento_NoMoreSpam_Newsletter</Moogento_NoMoreSpam>
|
73 |
+
</modules>
|
74 |
+
</args>
|
75 |
+
</newsletter>
|
76 |
+
</routers>
|
77 |
+
<layout>
|
78 |
+
<updates>
|
79 |
+
<nomorespam>
|
80 |
+
<file>moogento/nomorespam.xml</file>
|
81 |
+
</nomorespam>
|
82 |
+
</updates>
|
83 |
+
</layout>
|
84 |
+
</frontend>
|
85 |
+
<admin>
|
86 |
+
<routers>
|
87 |
+
<nomorespam>
|
88 |
+
<use>admin</use>
|
89 |
+
<args>
|
90 |
+
<module>Moogento_NoMoreSpam</module>
|
91 |
+
<frontName>nomorespam</frontName>
|
92 |
+
</args>
|
93 |
+
</nomorespam>
|
94 |
+
</routers>
|
95 |
+
</admin>
|
96 |
+
<adminhtml>
|
97 |
+
<acl>
|
98 |
+
<resources>
|
99 |
+
<all>
|
100 |
+
<title>Allow Everything</title>
|
101 |
+
</all>
|
102 |
+
<admin>
|
103 |
+
<children>
|
104 |
+
<Moogento_NoMoreSpam>
|
105 |
+
<title>NoMoreSpam Module</title>
|
106 |
+
<sort_order>10</sort_order>
|
107 |
+
</Moogento_NoMoreSpam>
|
108 |
+
</children>
|
109 |
+
</admin>
|
110 |
+
</resources>
|
111 |
+
</acl>
|
112 |
+
<layout>
|
113 |
+
<updates>
|
114 |
+
<nomorespam>
|
115 |
+
<file>moogento/nomorespam.xml</file>
|
116 |
+
</nomorespam>
|
117 |
+
</updates>
|
118 |
+
</layout>
|
119 |
+
</adminhtml>
|
120 |
+
<global>
|
121 |
+
<models>
|
122 |
+
<nomorespam>
|
123 |
+
<class>Moogento_NoMoreSpam_Model</class>
|
124 |
+
<resourceModel>nomorespam_mysql4</resourceModel>
|
125 |
+
</nomorespam>
|
126 |
+
<nomorespam_mysql4>
|
127 |
+
<class>Moogento_NoMoreSpam_Model_Mysql4</class>
|
128 |
+
<entities>
|
129 |
+
<nomorespam>
|
130 |
+
<table>nomorespam</table>
|
131 |
+
</nomorespam>
|
132 |
+
</entities>
|
133 |
+
</nomorespam_mysql4>
|
134 |
+
</models>
|
135 |
+
<resources>
|
136 |
+
<nomorespam_setup>
|
137 |
+
<setup>
|
138 |
+
<module>Moogento_NoMoreSpam</module>
|
139 |
+
</setup>
|
140 |
+
<connection>
|
141 |
+
<use>core_setup</use>
|
142 |
+
</connection>
|
143 |
+
</nomorespam_setup>
|
144 |
+
<nomorespam_write>
|
145 |
+
<connection>
|
146 |
+
<use>core_write</use>
|
147 |
+
</connection>
|
148 |
+
</nomorespam_write>
|
149 |
+
<nomorespam_read>
|
150 |
+
<connection>
|
151 |
+
<use>core_read</use>
|
152 |
+
</connection>
|
153 |
+
</nomorespam_read>
|
154 |
+
</resources>
|
155 |
+
<blocks>
|
156 |
+
<nomorespam>
|
157 |
+
<class>Moogento_NoMoreSpam_Block</class>
|
158 |
+
</nomorespam>
|
159 |
+
</blocks>
|
160 |
+
<helpers>
|
161 |
+
<nomorespam>
|
162 |
+
<class>Moogento_NoMoreSpam_Helper</class>
|
163 |
+
</nomorespam>
|
164 |
+
</helpers>
|
165 |
+
<template>
|
166 |
+
<email>
|
167 |
+
<notify_new_review_email_template translate="label" module="nomorespam">
|
168 |
+
<label>Notify new review email template</label>
|
169 |
+
<file>review_email.html</file>
|
170 |
+
<type>html</type>
|
171 |
+
</notify_new_review_email_template>
|
172 |
+
</email>
|
173 |
+
</template>
|
174 |
+
</global>
|
175 |
+
<crontab>
|
176 |
+
<jobs>
|
177 |
+
<review_email>
|
178 |
+
<schedule>
|
179 |
+
<cron_expr>0 0 * * * *</cron_expr>
|
180 |
+
</schedule>
|
181 |
+
<run>
|
182 |
+
<model>nomorespam/noMoreSpam::sendEmailReview</model>
|
183 |
+
</run>
|
184 |
+
</review_email>
|
185 |
+
</jobs>
|
186 |
+
</crontab>
|
187 |
+
</config>
|
app/code/community/Moogento/NoMoreSpam/etc/system.xml
ADDED
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.ln.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 |
+
<contact_cms_description>
|
61 |
+
<!-- TODO pdf attach-->
|
62 |
+
<frontend_model>nomorespam/adminhtml_system_config_fieldset_contactdescription</frontend_model>
|
63 |
+
<sort_order>1</sort_order>
|
64 |
+
<show_in_default>1</show_in_default>
|
65 |
+
<show_in_website>1</show_in_website>
|
66 |
+
<show_in_store>1</show_in_store>
|
67 |
+
</contact_cms_description>
|
68 |
+
<heading translate="label">
|
69 |
+
<label>Enable NoMoreSpam! for these specific sections:</label>
|
70 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
71 |
+
<sort_order>5</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 |
+
</heading>
|
76 |
+
<enabled_email translate="label">
|
77 |
+
<label>Contact form?</label>
|
78 |
+
<frontend_type>select</frontend_type>
|
79 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
80 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
81 |
+
<sort_order>10</sort_order>
|
82 |
+
<show_in_default>1</show_in_default>
|
83 |
+
<show_in_website>1</show_in_website>
|
84 |
+
<show_in_store>1</show_in_store>
|
85 |
+
</enabled_email>
|
86 |
+
<enabled_review translate="label">
|
87 |
+
<label>Product reviews?</label>
|
88 |
+
<frontend_type>select</frontend_type>
|
89 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
90 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
91 |
+
<sort_order>20</sort_order>
|
92 |
+
<show_in_default>1</show_in_default>
|
93 |
+
<show_in_website>1</show_in_website>
|
94 |
+
<show_in_store>1</show_in_store>
|
95 |
+
</enabled_review>
|
96 |
+
<create_account translate="label">
|
97 |
+
<label>Create account?</label>
|
98 |
+
<frontend_type>select</frontend_type>
|
99 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
100 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
101 |
+
<sort_order>21</sort_order>
|
102 |
+
<show_in_default>1</show_in_default>
|
103 |
+
<show_in_website>1</show_in_website>
|
104 |
+
<show_in_store>1</show_in_store>
|
105 |
+
</create_account>
|
106 |
+
<enabled_newsletter translate="label">
|
107 |
+
<label>Newsletter?</label>
|
108 |
+
<frontend_type>select</frontend_type>
|
109 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
110 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
111 |
+
<sort_order>22</sort_order>
|
112 |
+
<show_in_default>1</show_in_default>
|
113 |
+
<show_in_website>1</show_in_website>
|
114 |
+
<show_in_store>1</show_in_store>
|
115 |
+
</enabled_newsletter>
|
116 |
+
<heading_force translate="label">
|
117 |
+
<label>These specifically force a spam tag:</label>
|
118 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
119 |
+
<sort_order>25</sort_order>
|
120 |
+
<show_in_default>1</show_in_default>
|
121 |
+
<show_in_website>1</show_in_website>
|
122 |
+
<show_in_store>1</show_in_store>
|
123 |
+
</heading_force>
|
124 |
+
<enabled_email_name_link translate="label">
|
125 |
+
<label>Contact form: Links in 'name'?</label>
|
126 |
+
<frontend_type>select</frontend_type>
|
127 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
128 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
129 |
+
<sort_order>30</sort_order>
|
130 |
+
<show_in_default>1</show_in_default>
|
131 |
+
<show_in_website>1</show_in_website>
|
132 |
+
<show_in_store>1</show_in_store>
|
133 |
+
<depends><enabled_email>1</enabled_email></depends>
|
134 |
+
</enabled_email_name_link>
|
135 |
+
<enabled_email_message_link translate="label">
|
136 |
+
<label>Contact form: Links in 'message'?</label>
|
137 |
+
<frontend_type>select</frontend_type>
|
138 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
139 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
140 |
+
<sort_order>40</sort_order>
|
141 |
+
<show_in_default>1</show_in_default>
|
142 |
+
<show_in_website>1</show_in_website>
|
143 |
+
<show_in_store>1</show_in_store>
|
144 |
+
<comment><![CDATA[Default: <b>No</b>
|
145 |
+
<br />If you are unlikely to be sent links in your contact form, then set this to <b style = "color:darkgreen;">Yes</b>.]]></comment>
|
146 |
+
<depends><enabled_email>1</enabled_email></depends>
|
147 |
+
</enabled_email_message_link>
|
148 |
+
<enabled_review_review_link translate="label">
|
149 |
+
<label>Product review: Links in 'review'?</label>
|
150 |
+
<frontend_type>select</frontend_type>
|
151 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
152 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
153 |
+
<sort_order>50</sort_order>
|
154 |
+
<show_in_default>1</show_in_default>
|
155 |
+
<show_in_website>1</show_in_website>
|
156 |
+
<show_in_store>1</show_in_store>
|
157 |
+
<depends><enabled_review>1</enabled_review></depends>
|
158 |
+
</enabled_review_review_link>
|
159 |
+
<enabled_review_title_link translate="label">
|
160 |
+
<label>Product review: Links in 'title'?</label>
|
161 |
+
<frontend_type>select</frontend_type>
|
162 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
163 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
164 |
+
<sort_order>60</sort_order>
|
165 |
+
<show_in_default>1</show_in_default>
|
166 |
+
<show_in_website>1</show_in_website>
|
167 |
+
<show_in_store>1</show_in_store>
|
168 |
+
<depends><enabled_review>1</enabled_review></depends>
|
169 |
+
</enabled_review_title_link>
|
170 |
+
<enabled_review_rating translate="label">
|
171 |
+
<label>Product review: Ratings not set?</label>
|
172 |
+
<frontend_type>select</frontend_type>
|
173 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
174 |
+
<backend_model>contacts/system_config_backend_links</backend_model>
|
175 |
+
<sort_order>70</sort_order>
|
176 |
+
<show_in_default>1</show_in_default>
|
177 |
+
<show_in_website>1</show_in_website>
|
178 |
+
<show_in_store>1</show_in_store>
|
179 |
+
<comment><![CDATA[Default: <b>Yes</b>
|
180 |
+
<br />If you <b>don't require</b> all star ratings set, make this <b style = "color:darkgreen;">No</b>.
|
181 |
+
<br />If you <b>do require</b> all star ratings set, make this <b style = "color:darkgreen;">Yes</b>.]]></comment>
|
182 |
+
<depends><enabled_review>1</enabled_review></depends>
|
183 |
+
</enabled_review_rating>
|
184 |
+
|
185 |
+
<field_1 translate="label">
|
186 |
+
<label></label>
|
187 |
+
<frontend_type>hidden</frontend_type>
|
188 |
+
<sort_order>500</sort_order>
|
189 |
+
<show_in_default>0</show_in_default>
|
190 |
+
<show_in_website>0</show_in_website>
|
191 |
+
<show_in_store>0</show_in_store>
|
192 |
+
</field_1>
|
193 |
+
<field_2 translate="label">
|
194 |
+
<label></label>
|
195 |
+
<frontend_type>hidden</frontend_type>
|
196 |
+
<sort_order>500</sort_order>
|
197 |
+
<show_in_default>0</show_in_default>
|
198 |
+
<show_in_website>0</show_in_website>
|
199 |
+
<show_in_store>0</show_in_store>
|
200 |
+
</field_2>
|
201 |
+
<field_toofast translate="label">
|
202 |
+
<label></label>
|
203 |
+
<frontend_type>hidden</frontend_type>
|
204 |
+
<sort_order>500</sort_order>
|
205 |
+
<show_in_default>0</show_in_default>
|
206 |
+
<show_in_website>0</show_in_website>
|
207 |
+
<show_in_store>0</show_in_store>
|
208 |
+
</field_toofast>
|
209 |
+
<too_fast_form translate="label">
|
210 |
+
<label>Forms submitted too fast?</label>
|
211 |
+
<frontend_type>select</frontend_type>
|
212 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
213 |
+
<sort_order>600</sort_order>
|
214 |
+
<show_in_default>1</show_in_default>
|
215 |
+
<show_in_website>1</show_in_website>
|
216 |
+
<show_in_store>1</show_in_store>
|
217 |
+
<comment>Bots will submit forms faster than humans possibly could.</comment>
|
218 |
+
</too_fast_form>
|
219 |
+
<heading_email translate="label">
|
220 |
+
<label>Product Reviews Notification Service</label>
|
221 |
+
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
|
222 |
+
<sort_order>690</sort_order>
|
223 |
+
<show_in_default>1</show_in_default>
|
224 |
+
<show_in_website>1</show_in_website>
|
225 |
+
<show_in_store>1</show_in_store>
|
226 |
+
</heading_email>
|
227 |
+
<new_no_spam_review translate="label">
|
228 |
+
<label>Notify on legit review?</label>
|
229 |
+
<frontend_type>select</frontend_type>
|
230 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
231 |
+
<sort_order>700</sort_order>
|
232 |
+
<show_in_default>1</show_in_default>
|
233 |
+
<show_in_website>1</show_in_website>
|
234 |
+
<show_in_store>1</show_in_store>
|
235 |
+
<comment>This will send a summary email when a product review passes NoMoreSpam! filters.</comment>
|
236 |
+
</new_no_spam_review>
|
237 |
+
<!-- <new_no_spam_review_sender>
|
238 |
+
<frontend_type>select</frontend_type>
|
239 |
+
<source_model>adminhtml/system_config_source_email_identity</source_model>
|
240 |
+
<sort_order>740</sort_order>
|
241 |
+
<show_in_default>1</show_in_default>
|
242 |
+
<show_in_website>1</show_in_website>
|
243 |
+
<show_in_store>1</show_in_store>
|
244 |
+
<label><![CDATA[ <em class = "moo_down_arrow">⤷</em>]]> Notify: email sender</label>
|
245 |
+
<depends>
|
246 |
+
<new_no_spam_review>1</new_no_spam_review>
|
247 |
+
</depends>
|
248 |
+
</new_no_spam_review_sender> -->
|
249 |
+
<new_no_spam_email_sender translate="label">
|
250 |
+
<label><![CDATA[ <em class = "moo_down_arrow">⤷</em>]]> Notify: email sender</label>
|
251 |
+
<frontend_type>text</frontend_type>
|
252 |
+
<sort_order>750</sort_order>
|
253 |
+
<show_in_default>1</show_in_default>
|
254 |
+
<show_in_website>1</show_in_website>
|
255 |
+
<show_in_store>1</show_in_store>
|
256 |
+
<depends>
|
257 |
+
<new_no_spam_review>1</new_no_spam_review>
|
258 |
+
</depends>
|
259 |
+
</new_no_spam_email_sender>
|
260 |
+
<new_no_spam_name_sender translate="label">
|
261 |
+
<label><![CDATA[ <em class = "moo_down_arrow">⤷</em>]]> Notify: name sender</label>
|
262 |
+
<frontend_type>text</frontend_type>
|
263 |
+
<sort_order>755</sort_order>
|
264 |
+
<show_in_default>1</show_in_default>
|
265 |
+
<show_in_website>1</show_in_website>
|
266 |
+
<show_in_store>1</show_in_store>
|
267 |
+
<depends>
|
268 |
+
<new_no_spam_review>1</new_no_spam_review>
|
269 |
+
</depends>
|
270 |
+
</new_no_spam_name_sender>
|
271 |
+
<new_no_spam_review_notify translate="label">
|
272 |
+
<label><![CDATA[ <em class = "moo_down_arrow">⤷</em>]]> Notify: email receiver</label>
|
273 |
+
<frontend_type>text</frontend_type>
|
274 |
+
<sort_order>760</sort_order>
|
275 |
+
<show_in_default>1</show_in_default>
|
276 |
+
<show_in_website>1</show_in_website>
|
277 |
+
<show_in_store>1</show_in_store>
|
278 |
+
<depends>
|
279 |
+
<new_no_spam_review>1</new_no_spam_review>
|
280 |
+
</depends>
|
281 |
+
</new_no_spam_review_notify>
|
282 |
+
<new_no_spam_review_notify_name translate="label">
|
283 |
+
<label><![CDATA[ <em class = "moo_down_arrow">⤷</em>]]> Notify: name receiver</label>
|
284 |
+
<frontend_type>text</frontend_type>
|
285 |
+
<sort_order>765</sort_order>
|
286 |
+
<show_in_default>1</show_in_default>
|
287 |
+
<show_in_website>1</show_in_website>
|
288 |
+
<show_in_store>1</show_in_store>
|
289 |
+
<depends>
|
290 |
+
<new_no_spam_review>1</new_no_spam_review>
|
291 |
+
</depends>
|
292 |
+
</new_no_spam_review_notify_name>
|
293 |
+
<email_template translate="label">
|
294 |
+
<label>Email Template</label>
|
295 |
+
<frontend_type>select</frontend_type>
|
296 |
+
<source_model>adminhtml/system_config_source_email_template</source_model>
|
297 |
+
<sort_order>768</sort_order>
|
298 |
+
<show_in_default>1</show_in_default>
|
299 |
+
<show_in_website>1</show_in_website>
|
300 |
+
<show_in_store>1</show_in_store>
|
301 |
+
</email_template>
|
302 |
+
<email_subject>
|
303 |
+
<sort_order>770</sort_order>
|
304 |
+
<show_in_default>1</show_in_default>
|
305 |
+
<show_in_website>1</show_in_website>
|
306 |
+
<show_in_store>1</show_in_store>
|
307 |
+
<label><![CDATA[ <em class = "moo_down_arrow">⤷</em>]]> Notify: email subject</label>
|
308 |
+
<depends>
|
309 |
+
<new_no_spam_review>1</new_no_spam_review>
|
310 |
+
</depends>
|
311 |
+
</email_subject>
|
312 |
+
<email_body>
|
313 |
+
<frontend_type>textarea</frontend_type>
|
314 |
+
<sort_order>775</sort_order>
|
315 |
+
<show_in_default>1</show_in_default>
|
316 |
+
<show_in_website>1</show_in_website>
|
317 |
+
<show_in_store>1</show_in_store>
|
318 |
+
<label><![CDATA[ <em class = "moo_down_arrow">⤷</em>]]> Notify: email body</label>
|
319 |
+
<depends>
|
320 |
+
<new_no_spam_review>1</new_no_spam_review>
|
321 |
+
</depends>
|
322 |
+
</email_body>
|
323 |
+
</fields>
|
324 |
+
</no_spam>
|
325 |
+
</groups>
|
326 |
+
</no_more_spam>
|
327 |
+
</sections>
|
328 |
+
</config>
|
app/design/frontend/default/default/layout/moogento/nomorespam.xml
CHANGED
@@ -25,17 +25,31 @@
|
|
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 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
<reference name="content">
|
38 |
<block type="nomorespam/nomorespam" name="nomorespam_review" template="nomorespam/nomorespam_review.phtml" />
|
39 |
</reference>
|
40 |
-
</
|
41 |
</layout>
|
25 |
-->
|
26 |
<layout version="0.1.0">
|
27 |
<default>
|
28 |
+
<reference name="left">
|
29 |
+
<block type="nomorespam/nomorespam" name="nomorespam_newsletter" template="moogento/nomorespam/newsletter.phtml" />
|
30 |
+
</reference>
|
31 |
</default>
|
32 |
|
33 |
<contacts_index_index translate="label">
|
34 |
<reference name="content">
|
35 |
+
<block type="nomorespam/nomorespam" name="nomorespam_contact" template="moogento/nomorespam/nomorespam_contact.phtml" />
|
36 |
</reference>
|
37 |
</contacts_index_index>
|
38 |
|
39 |
+
<review_product_list>
|
40 |
+
<reference name="content">
|
41 |
+
<block type="nomorespam/nomorespam" name="nomorespam_review" template="moogento/nomorespam/nomorespam_review.phtml" />
|
42 |
+
</reference>
|
43 |
+
</review_product_list>
|
44 |
+
|
45 |
+
<customer_account_create>
|
46 |
+
<reference name="content">
|
47 |
+
<block type="nomorespam/nomorespam" name="account_create" template="moogento/nomorespam/account_create.phtml" />
|
48 |
+
</reference>
|
49 |
+
</customer_account_create>
|
50 |
+
<!-- <nomorespam_active_active>
|
51 |
<reference name="content">
|
52 |
<block type="nomorespam/nomorespam" name="nomorespam_review" template="nomorespam/nomorespam_review.phtml" />
|
53 |
</reference>
|
54 |
+
</nomorespam_active_active> -->
|
55 |
</layout>
|
app/design/frontend/default/default/template/nomorespam/nomorespam_contact.phtml
DELETED
@@ -1,31 +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_contact.phtml
|
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 |
-
<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
DELETED
@@ -1,31 +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_review.phtml
|
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 |
-
<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,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>moogento_nomorespam</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<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>Small bug fixes
|
|
|
12 |
<authors><author><name>Jim Gilbert</name><user>auto-converted</user><email>moo@moogento.com</email></author></authors>
|
13 |
-
<date>2014-
|
14 |
-
<time>
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>moogento_nomorespam</name>
|
4 |
+
<version>1.0.8</version>
|
5 |
<stability>stable</stability>
|
6 |
<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>Small bug fixes.
|
12 |
+
Adds contact form and CMS checks.</notes>
|
13 |
<authors><author><name>Jim Gilbert</name><user>auto-converted</user><email>moo@moogento.com</email></author></authors>
|
14 |
+
<date>2014-08-17</date>
|
15 |
+
<time>04:48:13</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Moogento"><dir name="NoMoreSpam"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Fieldset"><file name="Contactdescription.php" hash="7ba638aa01e2f89ea3eabe6260baf228"/><file name="Hint.php" hash="80fcba4b693f087e2c5d420867630680"/></dir></dir></dir></dir><file name="Nomorespam.php" hash="0e6304f8c74a24521e7886e19f213ac1"/></dir><dir name="Helper"><file name="Data.php" hash="0a027111c01da66052b3c951d396fd48"/></dir><dir name="Model"><file name="Email.php" hash="4e5fbfc66d504d17282c9cd27bba7d4e"/><file name="NoMoreSpam.php" hash="f46e20b1e1607a6c0ed620dcb1162e71"/><file name="Status.php" hash="5375244f2c1e79e0c1d4752cb0ce4b60"/></dir><dir name="controllers"><dir name="Customer"><file name="AccountController.php" hash="cf9ebea542eb4425f0803512c1c09d01"/></dir><dir name="Newsletter"><file name="SubscriberController.php" hash="79282afbe0ade7974b1c7167fcdc1789"/></dir><dir name="Review"><file name="ProductController.php" hash="7570313ae0b1b212062bcc0e66d9dc8e"/></dir><file name="ActiveController.php" hash="1b71fb28bf6a368c6e0d34652babe829"/><file name="IndexController.php" hash="c2f1279eb30ec07995d6de443236a08b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="249a8cb2cf65cabbc5f44e193b8a6d2e"/><file name="config.xml" hash="6e0ed1d4ea8e4f8f817ed19b48527bdb"/><file name="system.xml" hash="78377e89a303d771ee2993d285ed2515"/></dir></dir></dir></target><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="08bde0eab8e5bd8f8c4dcf9010d385b2"/></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="17ff92a4f4231015a8691a0abde5aef7"/></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>
|
17 |
<compatible/>
|
18 |
<dependencies/>
|
19 |
</package>
|