cybernostics / captcha
Captcha plugin for CakePHP.
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:cakephp-plugin
Requires
- php: >=5.3.0
- composer/installers: *
This package is not auto-updated.
Last update: 2025-05-06 11:17:51 UTC
README
The Captcha plugin allows you to add captcha checks on selected forms.
- Install the plugin in Plugins folder
- Add the captcha input on your selected view (eg register.ctp)
eg:
CaptchaInput->captcha_input(); ?>-
Add the following to the controller method which handles the form: (assuming your controller uses a User model)
public function your_controller_method() { // enable check captcha for create $this->YourModelNameHere->Behaviors->load('CaptchaCreator.CaptchaCheck');
if ($this->request->is('post')) { $this->YourModelNameHere->create(); // captcha will now be checked if ($this->YourModelNameHere->save($this->request->data)) { $this->Session->setFlash(__('The XYZ has been saved.')); return $this->redirect(array('action' => 'index')); } else { $this->Session->setFlash(__('The XYZ could not be saved. Please, try again.')); } }
}
Other methods like admin screens can still create records without the captcha validation getting in your way. The validation rule is only enabled when you request it.
Requirements
- CakePHP 2.5+
- PHP 5.2.8+
- Lib GD
Contributing
Pull requests welcome.
License
Copyright 2007-2014 Cybernostics Pty. All rights reserved.
Licensed under the MIT License. Redistributions of the source code included in this repository must retain the copyright notice found in each file.