Commit 58db89bf181f4d8e6c2e1849f912cd2f7b34ba80
1 parent
5f0ef805
Exists in
captcha_serpro_plugin
Fix for hotspot plugin
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
lib/noosfero/api/helpers.rb
... | ... | @@ -412,7 +412,7 @@ require 'grape' |
412 | 412 | ########################################## |
413 | 413 | |
414 | 414 | def test_captcha(remote_ip, params, environment) |
415 | - captcha_plugin_enabled = @plugins.dispatch(:test_captcha, remote_ip, params, environment) | |
415 | + captcha_plugin_enabled = @plugins.dispatch(:test_captcha, remote_ip, params, environment).map {|p| p if ! ( p===nil ) } | |
416 | 416 | return true if captcha_plugin_enabled.size == 0 |
417 | 417 | if captcha_plugin_enabled.size > 1 |
418 | 418 | return render_api_error!(_("Error processing Captcha"), 500, nil, "More than one captcha plugin enabled") | ... | ... |
lib/noosfero/plugin.rb
... | ... | @@ -671,6 +671,11 @@ class Noosfero::Plugin |
671 | 671 | nil |
672 | 672 | end |
673 | 673 | |
674 | + #By default will return nil that will mean not implented by the plugin | |
675 | + def test_captcha(*args) | |
676 | + nil | |
677 | + end | |
678 | + | |
674 | 679 | # -> Adds additional blocks to profiles and environments. |
675 | 680 | # Your plugin must implements a class method called 'extra_blocks' |
676 | 681 | # that returns a hash with the following syntax. | ... | ... |