linksture_product_review_captcha - Version 1.0.0.2

Version Notes

Releasing version 1.0.0.2, Add magento native image captcha to product review form.

Download this release

Release Info

Developer Haresh
Extension linksture_product_review_captcha
Version 1.0.0.2
Comparing to
See all releases


Code changes from version 1.0.0.1 to 1.0.0.2

app/code/community/Linksture/Productreview/Model/Observer.php CHANGED
@@ -13,7 +13,7 @@ class Linksture_Productreview_Model_Observer extends Mage_Captcha_Model_Observer
13
 
14
  $controller = $observer->getControllerAction();
15
  if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
16
- Mage::getSingleton('core/session')->addError('Incorrect CAPTCHA.');
17
  Mage::app()->getResponse()->setRedirect($returnUrl)->sendResponse();
18
  exit;
19
 
13
 
14
  $controller = $observer->getControllerAction();
15
  if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
16
+ Mage::getSingleton('core/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
17
  Mage::app()->getResponse()->setRedirect($returnUrl)->sendResponse();
18
  exit;
19
 
app/code/community/Linksture/Productreview/Model/Observer.php~ ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Linksture_Productreview_Model_Observer extends Mage_Captcha_Model_Observer
4
+ {
5
+
6
+
7
+ public function checkProductReview($observer)
8
+ {
9
+ $productId = $observer->getControllerAction()->getRequest()->getParam('id');
10
+ $returnUrl = Mage::getUrl('review/product/list', array('id'=> $productId));
11
+ $formId = 'review-form';
12
+ $captchaModel = Mage::helper('captcha')->getCaptcha($formId);
13
+
14
+ $controller = $observer->getControllerAction();
15
+ if (!$captchaModel->isCorrect($this->_getCaptchaString($controller->getRequest(), $formId))) {
16
+ Mage::getSingleton('core/session')->addError(Mage::helper('captcha')->__('Incorrect CAPTCHA.'));
17
+ Mage::app()->getResponse()->setRedirect($returnUrl)->sendResponse();
18
+ exit;
19
+
20
+ }
21
+ }
22
+
23
+ }
24
+
25
+
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>linksture_product_review_captcha</name>
4
- <version>1.0.0.1</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Add magento native image captcha to product review form.</summary>
10
  <description>Add magento native image captcha to product review form.</description>
11
- <notes>Releasing version 1.0.0.1, Add magento native image captcha to product review form.</notes>
12
  <authors><author><name>Haresh</name><user>linksture</user><email>haresh@linksture.com</email></author></authors>
13
- <date>2014-08-29</date>
14
- <time>08:34:18</time>
15
- <contents><target name="mageetc"><dir name="modules"><file name="Linksture_Productreview.xml" hash="e5303dce4d35a1f1cd834e57b81aae85"/></dir></target><target name="magecommunity"><dir name="Linksture"><dir name="Productreview"><dir name="Block"><dir name="Captcha"><file name="Zend.php" hash="54ea8ff3635cfe2ca10eb8b319fd5859"/></dir></dir><dir name="Helper"><file name="Data.php" hash="71ef779f05af5db7c20562daa8cc0b3d"/></dir><dir name="Model"><file name="Observer.php" hash="0b1a1bc8f2fea758278e8d7cc09ec89b"/></dir><dir name="etc"><file name="config.xml" hash="f8ed9cf1113008b7a48963e748a7629d"/><file name="system.xml" hash="2ba9c16199e5a759da558386607a7376"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="reviewcaptcha.xml" hash="851a314c535509608604e27a957c934b"/></dir><dir name="template"><dir name="review"><file name="form.phtml" hash="c51e0c2e27d346e2022a0c5d82694b5b"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="js"><file name="captcha.js" hash="6b65c3644bd2d971b08870b51d3555f8"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>linksture_product_review_captcha</name>
4
+ <version>1.0.0.2</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Add magento native image captcha to product review form.</summary>
10
  <description>Add magento native image captcha to product review form.</description>
11
+ <notes>Releasing version 1.0.0.2, Add magento native image captcha to product review form.</notes>
12
  <authors><author><name>Haresh</name><user>linksture</user><email>haresh@linksture.com</email></author></authors>
13
+ <date>2014-10-07</date>
14
+ <time>11:01:47</time>
15
+ <contents><target name="mageetc"><dir name="modules"><file name="Linksture_Productreview.xml" hash="e5303dce4d35a1f1cd834e57b81aae85"/></dir></target><target name="magecommunity"><dir name="Linksture"><dir name="Productreview"><dir name="Block"><dir name="Captcha"><file name="Zend.php" hash="54ea8ff3635cfe2ca10eb8b319fd5859"/></dir></dir><dir name="Helper"><file name="Data.php" hash="71ef779f05af5db7c20562daa8cc0b3d"/></dir><dir name="Model"><file name="Observer.php" hash="0d903c7e916dcf12235b5af3fadc11a1"/><file name="Observer.php~" hash="0d903c7e916dcf12235b5af3fadc11a1"/></dir><dir name="etc"><file name="config.xml" hash="f8ed9cf1113008b7a48963e748a7629d"/><file name="system.xml" hash="2ba9c16199e5a759da558386607a7376"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="reviewcaptcha.xml" hash="851a314c535509608604e27a957c934b"/></dir><dir name="template"><dir name="review"><file name="form.phtml" hash="c51e0c2e27d346e2022a0c5d82694b5b"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="js"><file name="captcha.js" hash="6b65c3644bd2d971b08870b51d3555f8"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>