cakedc / recaptcha Goto Github PK
View Code? Open in Web Editor NEWRecaptcha plugin for CakePHP
Home Page: http://cakedc.com
License: Other
Recaptcha plugin for CakePHP
Home Page: http://cakedc.com
License: Other
Im using cakephp2.2.5 and am using your recaptcha plugin. Now I ran into a snag. I got this error:
Error: Call to a member function attach() on a non-object
File: /../Controller/Component/RecaptchaComponent.php
Line: 120
Can you please assist?
Thank you!
Hi I'm new to cakephp. I'm creating a app and using captcha to validate the human activity. Using plugin(https://github.com/CakeDC/recaptcha). It's showing the captcha in my form. However when submitting the form. I'm getting an error "Call to a member function verify() on a non-object"
Can anyone help me to fix the error. what could be reason and how can I fix it
I cannot seem to be able to overwrite the theme.
echo $this->Recaptcha->display(array('recaptchaOptions' => array('theme' => 'white')));
Hi all the people!
I'm using cakephp 1.3 and this reCaptcha plugin.
The problem that i have is the next:
When i put wrong words on recaptcha or the before input fields are not validating the rules, ever introducing words in recaptcha, the render result is the ctp code, only the ctp code, the entire layout is not rendering.
Someone encountered with this problem?
Thank you very much
Trying to change the theme by passing theme parameter in helper display method. Not working.
For example:
echo $this->Recaptcha->display(array('theme' => 'white'));
Hi,
Does this plugin support the new reCAPTCHA API https://developers.google.com/recaptcha/docs/display#auto_render ?
Thanks
Using CakePHP 2 on this specific project.
Downloaded your recaptcha-2.2.4 from Git.
Copied Controller, Locale, Model & View to app/Plugin/Recaptcha
Edited bootstrap.php to include:
publicKey
privateKey
loaded 'Recaptcha'
In my login action added echo $this->Recaptcha->display();
Get an error:
Fatal error: Call to undefined method RecaptchaComponent::display() in app/Controller/UsersController.php on line 38
All line 38 is ...$this->Recaptcha->display();
Testing the 2.0 branch on Cake 2.04, it is working, thank you for your efforts!
Just one minor issue:
in the readme you are stating
"Through inclusion of the component, the helper is automatically made available to your views."
but that did not happen in my case, I had to add
$this->helpers = array('Recaptcha.Recaptcha');
to the controller's method
https://github.com/CakeDC/recaptcha/blob/master/Docs/Documentation/Installation.md
Is missing the usual "composer require" thing most plugin docs have. ;)
Reported by Lucky1968 | July 31st, 2011 @ 12:25 AM
Hi,
Can anyone tell me how to repopulate a contact form which is not been sent after validation failure by another controller?
The contact form is an element (views/elements/contact_form.ctp) which is included in a view of another controller (f.e. ContentPagesController) and on submission it sends the contact form to the MailsController.
After validation failure the MailsController redirects to the referer page (which belongs to f.e. the ContentPagesController) showing an empty form again.
Do these data get lost because it involves 2 controllers here or how to solve this?
Thanx in advance.
Luc
Reported by dien | December 12th, 2010 @ 10:36 PM
Plugin can't use when use comments plugin with ajax.
Hey,
I'd like to add recaptcha as a versioned submodule for one of my projects, but it appears as if the tagged versions are pointing at the Cake 1.x code stream? I've submoduled the HEAD for the moment, but I'd prefer to do so with a named version if that would be possible?
Thanks!
I cannot seem to be able to overwrite the theme.
echo $this->Recaptcha->display(array('recaptchaOptions' => array('theme' => 'white')));
This is in the 2.0 branch.
Thanks,
Dave
Any thought of supporting composer/packagist dependency management?
I can send a PR if there.
I can't change the theme on recaptcha.
After download, place it on app/plugin and change the name to Recaptcha.
Load the plugin from bootstrap and change the public & private key
CakePlugin::load( 'Recaptcha' );
// recaptcha key
Configure::write('Recaptcha.publicKey', 'your-public-api-key');
Configure::write('Recaptcha.privateKey', 'your-private-api-key');
On Controller
var $components = array(
'Recaptcha',
);
and on public function index {
if ($this->request->is('post')) {
if ($this->Recaptcha->verify()) {
// do something, save you data, login, whatever
} else {
// display the raw API error
$this->Session->setFlash($this->Recaptcha->error);
}
}
On the View, index
echo $this->Recaptcha->display(array('recaptchaOptions'=>array('theme' => 'blackglass')));
but wont display the blackglass theme, instead red theme.
I check with firebug
and on the head tag
but on the css load the red theme
<style type="text/css"> .recaptchatable td img{display:block}.recaptchatable .recaptcha_r1_c1{background:url('https://www.google.com/recaptcha/api/img/red/sprite.png') 0 -63px no-repeat;width:318px;height:9px}.recaptchatable .recaptcha_r2_c1{background:url('https://www.google.com/recaptcha/api/img/red/sprite.png') -18px 0 no-repeat;width:9px;height:57px}.recaptchatable .recaptcha_r2_c2{background:url('https://www.google.com/recaptcha/api/img/red/sprite.png') -27px 0 no-repeat;width:9px;height:57px}.recaptchatable .recaptcha_r3_c1{background:url('https://www.google.com/recaptcha/api/img/red/sprite.png') 0 0 no-repeat;width:9px;height:63px} ....... </style>I check on the Plugin/Recaptcha/View/Helper/RecaptchaHelper.php
on public function display{}
i just try to see what output result when i typed debug.
for some reason on line 131, when I try to debug ($jsonOptions) it wont give me any result.
Thank you
Reported by Pierre Martin | January 12th, 2011 @ 01:02 AM
What happens?
There were some regressions introduced in commit 44cf45a79c8362ed42f48dac7e2d3b8e1c7d78eb
Unit tests are broken and features such as selecting a theme do not work anymore.
Expected
All tests must be green again!
The plugin throws error:
Fatal error: Call to a member function attach() on a non-object in D:\xampp\htdocs\my_site\app\controllers\components\recaptcha.php on line 100
when I access URL served by Pages Controller, e.g. http://localhost/my_site/pages/about_me
but it works fine for other controllers, e.g. http://localhost/my_site/users/register
Anyone know why this happen?
Thanks,
Indra
I cannot seem to be able to overwrite the theme.
echo $this->Recaptcha->display(array('recaptchaOptions' => array('theme' => 'white')));
Any change of getting this onto Packagist at some point
Ta
Reported by Lucky1968 | July 17th, 2011 @ 01:20 AM
Hi,
Can anyone tell me how to repopulte a contact form which is not been sent after incorrect reCAPTCHA?
Thanx in advance.
Luc
syntax error, unexpected '['
Php version 5.3.3
cake 2.7
Reported by Lucky1968 | July 31st, 2011 @ 12:23 AM
Hi,
I'm developing my own CMS and I want to use the Recaptcha plugin to protect sending mails from the site.
My contact form is an element (views/elements/contact_form.ctp) which is using the MailsController to email the form.
The administrator can choose to show the contact form on the site in different pages belonging to different controllers although in most cases the administrator is likely to only show the contact form in the contact page (which is a view of the ContentPagesController). So the contact_form.ctp-element can be included in different views of different controllers but is most likely only used in 1 particular view of 1 controller.
Since I don't want to include the 'Recaptcha.Recaptcha'-component in all controllers which offer the possibility to include the contact form I would prefer to include the 'Recaptcha.Recaptcha'-component only when the contact_form.ctp-element is included in the view.
So is there a way to include the 'Recaptcha.Recaptcha'-component from within the contact_form.ctp-element? Or can the contact_form.ctp-element access the 'Recaptcha.Recaptcha'-component which is included in the MailsController anyway although the element is included in a view of another (f.e. ContentPagesController) controller?
FYI: Including the 'Recaptcha.Recaptcha'-component in the AppController looks like overkill to me since in most cases the component will only be used in 1 particular page (contact page) of 1 particular controller.
Also, trying to add 'Recaptcha.Recaptcha'-component to the AppController like this
class AppController extends Controller {
var $components = array('Auth', 'Session', 'Recaptcha.Recaptcha');
}
results in this error:
Notice (8): Undefined property: PagesController::$Page [CORE/plugins/recaptcha/controllers/components/recaptcha.php, line 86]
Notice (8): Trying to get property of non-object [CORE/plugins/recaptcha/controllers/components/recaptcha.php, line 86]
Fatal error: Call to a member function attach() on a non-object in /Applications/MAMP/htdocs/LuckyCMS/plugins/recaptcha/controllers/components/recaptcha.php on line 86
Thanx for any help.
Luc
i test it with cakephp 2.0.4 and using php 5.3.8
in my bootsrap
Configure::write('Recaptcha.publicKey', 'myPbKey');
Configure::write('Recaptcha.privateKey', 'myPkKey');
in my user model
class User extends AppModel {
public $actsAs = array('Acl' => array('type' => 'requester'),'Recaptcha.Recaptcha');
}
in my user controller
class UsersController extends AppController {
public $components = array('Recaptcha.Recaptcha');
public $helpers = array('Recaptcha.Recaptcha');
}
when i submit data it show message
Warning (2): explode() expects parameter 2 to be string, object given [APP/Plugin/Recaptcha/Controller/Component/RecaptchaComponent.php, line 132]
Code Context
$response = HttpResponse
explode - [internal], line ??
RecaptchaComponent::verify() - APP/Plugin/Recaptcha/Controller/Component/RecaptchaComponent.php, line 132
UsersController::register() - APP/Controller/UsersController.php, line 278
ReflectionMethod::invokeArgs() - [internal], line ??
Controller::invokeAction() - CORE/Cake/Controller/Controller.php, line 473
Dispatcher::_invoke() - CORE/Cake/Routing/Dispatcher.php, line 107
Dispatcher::dispatch() - CORE/Cake/Routing/Dispatcher.php, line 89
[main] - APP/webroot/index.php, line 97
What can cause not to display reCaptcha?
When I visit the page for the first time often it does not appear, but after I refresh the page, it begins to be displayed.
What can I do to solve this issue?
Hello,
How can I use Mailhide with your plugin?
Thanks,
I am using CakePHP version 2.2.5 and our pages are over SSL. When adding this plugin the captcha is displayed but no post request is received by the action in the controller and no error messages displayed.
I have reported this problem on stack overflow also:
In RecaptchaComponent::startup() there is a check for RecaptchaComponent::enabled. Only when this is true does the component attach the RecaptchaBehavior. However, I do not see where this can be set to true. Is that part of 1.3?
Title says it all. :)
It would be nice if there would be a CakePHP 3.x version available.
For those who can't wait check this one out https://github.com/agiletechvn/Recaptcha
Hello. Pls add support few recaptcha on some page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.