diff --git a/Model/Behavior/SimpleCaptchaBehavior.php b/Model/Behavior/SimpleCaptchaBehavior.php index bf87ff799..1fb22016b 100644 --- a/Model/Behavior/SimpleCaptchaBehavior.php +++ b/Model/Behavior/SimpleCaptchaBehavior.php @@ -62,7 +62,7 @@ public function setup(&$Model, $settings) { * @param type $queryData * @return bool */ - public function beforeValidate(&$Model, &$queryData) { + public function beforeValidate($Model, $queryData) { $this->Model = &$Model; if (!$this->_validateCaptchaMinTime($this->Model->data[$this->Model->name])) { @@ -223,4 +223,4 @@ private function logAttempt($errorsOnly = true) { } } -?> \ No newline at end of file +?> diff --git a/View/Helper/SimpleCaptchaHelper.php b/View/Helper/SimpleCaptchaHelper.php index 772c41e16..52d37287e 100644 --- a/View/Helper/SimpleCaptchaHelper.php +++ b/View/Helper/SimpleCaptchaHelper.php @@ -20,7 +20,7 @@ class SimpleCaptchaHelper extends AppHelper { private $captcha_hash = null; private $captcha_generated = false; - function __construct() { + function __construct(View $View, $settings = array()) { $this->options = SimpleCaptcha::$defaults; # Set up an array with the operators that we want to use. With difficulty=1 it is only subtraction and addition. @@ -31,7 +31,7 @@ function __construct() { $this->options = array_merge($this->options, $configs); } - parent::__construct(); + parent::__construct($View, $settings); } @@ -148,4 +148,4 @@ private function __fieldName($model_name = null) { return $field_name; } } -?> \ No newline at end of file +?> diff --git a/history.md b/history.md index 8c28b972b..68409549d 100644 --- a/history.md +++ b/history.md @@ -1,3 +1,7 @@ +## 0.3 (2012-02-25) + +* Updated for CakePHP 2.0 + ## 0.2 (2011-06-09) * German localization @@ -8,4 +12,4 @@ ## Origin -Based on http://www.dereuromark.de/2010/08/09/how-to-implement-captchas-properly/ \ No newline at end of file +Based on http://www.dereuromark.de/2010/08/09/how-to-implement-captchas-properly/ diff --git a/readme.md b/readme.md index ce15e5db7..db3de26f3 100644 --- a/readme.md +++ b/readme.md @@ -14,7 +14,7 @@ Usage Example Include helper in the Controller: - var $helpers = array ( + plubic $helpers = array ( 'SimpleCaptcha.SimpleCaptcha', );