summaryrefslogtreecommitdiff
path: root/lib/gitlab/recaptcha.rb
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2015-12-28 18:21:34 -0200
committerGabriel Mazetto <gabriel@gitlab.com>2015-12-28 18:50:29 -0200
commita3469d914aaf28a1184247cbe72e5197ce7ca006 (patch)
tree8bc68cf4adf391142bcfa8bf2cc7a3d7a572ead2 /lib/gitlab/recaptcha.rb
parentaf00558d38806eda2fa70c8fdc34be98fced44a4 (diff)
downloadgitlab-ce-a3469d914aaf28a1184247cbe72e5197ce7ca006.tar.gz
reCAPTCHA is configurable through Admin Settings, no reload needed.
Diffstat (limited to 'lib/gitlab/recaptcha.rb')
-rw-r--r--lib/gitlab/recaptcha.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/recaptcha.rb b/lib/gitlab/recaptcha.rb
new file mode 100644
index 00000000000..70e7f25d518
--- /dev/null
+++ b/lib/gitlab/recaptcha.rb
@@ -0,0 +1,14 @@
+module Gitlab
+ module Recaptcha
+ def self.load_configurations!
+ if current_application_settings.recaptcha_enabled
+ ::Recaptcha.configure do |config|
+ config.public_key = current_application_settings.recaptcha_site_key
+ config.private_key = current_application_settings.recaptcha_private_key
+ end
+
+ true
+ end
+ end
+ end
+end