mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-26 15:28:37 -05:00
Added option to disable captcha verification
This commit is contained in:
@@ -38,6 +38,7 @@ INDEXTANK_API_URL =
|
||||
|
||||
# -- feature toggles --
|
||||
disable_ads = false
|
||||
disable_captcha = false
|
||||
|
||||
# -- important settings --
|
||||
# the domain that this app serves itself up as
|
||||
|
||||
@@ -432,7 +432,7 @@ class ApiController(RedditController):
|
||||
form.has_errors("passwd", errors.BAD_PASSWORD) or
|
||||
form.has_errors("passwd2", errors.BAD_PASSWORD_MATCH) or
|
||||
form.has_errors('ratelimit', errors.RATELIMIT) or
|
||||
form.has_errors('captcha', errors.BAD_CAPTCHA)):
|
||||
(not g.disable_captcha and form.has_errors('captcha', errors.BAD_CAPTCHA))):
|
||||
|
||||
user = register(name, password)
|
||||
VRatelimit.ratelimit(rate_ip = True, prefix = "rate_register_")
|
||||
|
||||
@@ -89,6 +89,7 @@ class Globals(object):
|
||||
'read_only_mode',
|
||||
'frontpage_dart',
|
||||
'allow_wiki_editing',
|
||||
'disable_captcha',
|
||||
]
|
||||
|
||||
tuple_props = ['stalecaches',
|
||||
|
||||
@@ -207,7 +207,7 @@ class Account(Thing):
|
||||
return id_time + ',' + sha.new(to_hash).hexdigest()
|
||||
|
||||
def needs_captcha(self):
|
||||
return self.link_karma < 1
|
||||
return self.link_karma < 1 and not g.disable_captcha
|
||||
|
||||
def modhash(self, rand=None, test=False):
|
||||
return modhash(self, rand = rand, test = test)
|
||||
|
||||
@@ -36,9 +36,11 @@
|
||||
${login_panel(login_form,
|
||||
user_reg = thing.user_reg, user_login = thing.user_login,
|
||||
dest=thing.dest)}
|
||||
%if not g.disable_captcha:
|
||||
<script type="text/javascript">
|
||||
$.request("new_captcha");
|
||||
</script>
|
||||
%endif
|
||||
%endif
|
||||
|
||||
<%def name="login_form(register=False, user='', dest='', include_tos=True)">
|
||||
@@ -101,8 +103,10 @@
|
||||
${error_field("BAD_PASSWORD_MATCH", "passwd2", kind="span")}
|
||||
</li>
|
||||
<li>
|
||||
%if not g.disable_captcha:
|
||||
<% iden = hasattr(thing, "captcha") and thing.captcha.iden or '' %>
|
||||
${captchagen(iden, tabulate=True, label=False, size=30)}
|
||||
%endif
|
||||
${error_field("RATELIMIT", "ratelimit")}
|
||||
${error_field("RATELIMIT", "vdelay")}
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user