Merge pull request #3411 from evazion/fix-recaptcha

Make recaptcha optional on signup page.
This commit is contained in:
Albert Yi
2017-12-13 14:34:22 -08:00
committed by GitHub
5 changed files with 24 additions and 7 deletions

View File

@@ -44,7 +44,7 @@ class UsersController < ApplicationController
def create
@user = User.new(params[:user], :as => CurrentUser.role)
@user.last_ip_addr = request.remote_ip
if verify_recaptcha(model: @user)
if !Danbooru.config.enable_recaptcha? || verify_recaptcha(model: @user)
@user.save
if @user.errors.empty?
session[:user_id] = @user.id

View File

@@ -15,7 +15,11 @@
<%= f.input :password %>
<%= f.input :password_confirmation %>
<%= invisible_recaptcha_tags callback: 'submitInvisibleRecaptchaForm', text: 'Sign up' %>
<% if Danbooru.config.enable_recaptcha? %>
<%= invisible_recaptcha_tags callback: 'submitInvisibleRecaptchaForm', text: 'Sign up' %>
<% else %>
<%= f.submit "Sign up", :data => { :disable_with => "Signing up..." } %>
<% end %>
<% end %>
</div>
</div>