Skip to content

Commit

Permalink
Updated for CakePHP 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlaefer committed Feb 25, 2012
1 parent 7d8f7e2 commit a5f0c08
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Model/Behavior/SimpleCaptchaBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand Down Expand Up @@ -223,4 +223,4 @@ private function logAttempt($errorsOnly = true) {
}

}
?>
?>
6 changes: 3 additions & 3 deletions View/Helper/SimpleCaptchaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -31,7 +31,7 @@ function __construct() {
$this->options = array_merge($this->options, $configs);
}

parent::__construct();
parent::__construct($View, $settings);
}


Expand Down Expand Up @@ -148,4 +148,4 @@ private function __fieldName($model_name = null) {
return $field_name;
}
}
?>
?>
6 changes: 5 additions & 1 deletion history.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3 (2012-02-25)

* Updated for CakePHP 2.0

## 0.2 (2011-06-09)

* German localization
Expand All @@ -8,4 +12,4 @@

## Origin

Based on http://www.dereuromark.de/2010/08/09/how-to-implement-captchas-properly/
Based on http://www.dereuromark.de/2010/08/09/how-to-implement-captchas-properly/
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Usage Example

Include helper in the Controller:

var $helpers = array (
plubic $helpers = array (
'SimpleCaptcha.SimpleCaptcha',
);

Expand Down

0 comments on commit a5f0c08

Please sign in to comment.