Giter VIP home page Giter VIP logo

recaptcha's Introduction

CakeDC Recaptcha Plugin

The Recaptcha plugin for CakePHP provides spam protection in an easy use helper.

Requirements

  • CakePHP 2.5+
  • PHP 5.2.8+

Documentation

For documentation, as well as tutorials, see the Docs directory of this repository.

Support

For bugs and feature requests, please use the issues section of this repository.

Commercial support is also available, contact us for more information.

Contributing

This repository follows the CakeDC Plugin Standard. If you'd like to contribute new features, enhancements or bug fixes to the plugin, please read our Contribution Guidelines for detailed instructions.

License

Copyright 2007-2014 Cake Development Corporation (CakeDC). 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.

recaptcha's People

Contributors

adhenawer avatar ajibarra avatar alscheuring avatar andrej-griniuk avatar dalpo avatar destinydriven avatar fiblan avatar lorenzo avatar predominant avatar real34 avatar renan avatar rnavarro avatar skie avatar steinkel avatar stephane-benoist avatar tersmitten avatar yeliparra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

recaptcha's Issues

Can't change the theme

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

<script type="text/javascript"> // </script>

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

Theme support

I cannot seem to be able to overwrite the theme.

echo $this->Recaptcha->display(array('recaptchaOptions' => array('theme' => 'white')));

How to access the Recaptcha-component from an element?

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

Composer support

Any thought of supporting composer/packagist dependency management?
I can send a PR if there.

Regressions introduced in the develop branch. Features broken.

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!

Readme on 2.0 branch

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

Theme support

I cannot seem to be able to overwrite the theme.

echo $this->Recaptcha->display(array('recaptchaOptions' => array('theme' => 'white')));

component not working.

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!

Packagist

Any change of getting this onto Packagist at some point

Ta

Recaptcha not working in cakephp

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

Tagged versions are the 1.3 branch

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!

The component is not attaching the behavior

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?

Helper display theme param not working

Trying to change the theme by passing theme parameter in helper display method. Not working.

For example:

echo $this->Recaptcha->display(array('theme' => 'white'));

testing with cakephp 2.0.4

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

The recaptcha is not always displayed

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?

RecaptchaComponent::display()

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();

reCaptcha is not rendering properly when you are introducings wrongs words

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

How to repopulate form that is using the Recaptcha plugin in an element?

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

Theme support

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.