mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-01 18:25:05 -05:00
Remove /validuser endpoint now that the Trac wiki is gone.
This commit is contained in:
@@ -47,7 +47,6 @@ def make_map():
|
||||
mc('/adminon', controller='forms', action='adminon')
|
||||
mc('/adminoff', controller='forms', action='adminoff')
|
||||
mc('/submit', controller='front', action='submit')
|
||||
mc('/validuser', controller='forms', action='validuser')
|
||||
|
||||
mc('/over18', controller='post', action='over18')
|
||||
|
||||
|
||||
@@ -1233,17 +1233,6 @@ class FormsController(RedditController):
|
||||
self.disable_admin_mode(c.user)
|
||||
return self.redirect(dest)
|
||||
|
||||
def GET_validuser(self):
|
||||
"""checks login cookie to verify that a user is logged in and
|
||||
returns their user name"""
|
||||
response.content_type = 'text/plain'
|
||||
if c.user_is_loggedin:
|
||||
# Change cookie based on can_wiki trac permissions
|
||||
perm = str(c.user.can_wiki(default=False))
|
||||
return c.user.name + "," + perm
|
||||
else:
|
||||
return ""
|
||||
|
||||
def _render_opt_in_out(self, msg_hash, leave):
|
||||
"""Generates the form for an optin/optout page"""
|
||||
email = Email.handler.get_recipient(msg_hash)
|
||||
|
||||
@@ -791,8 +791,7 @@ class MinimalController(BaseController):
|
||||
# update last_visit
|
||||
if (c.user_is_loggedin and not g.disallow_db_writes and
|
||||
request.method.upper() != "POST" and
|
||||
not c.dont_update_last_visit and
|
||||
request.path != '/validuser'):
|
||||
not c.dont_update_last_visit):
|
||||
c.user.update_last_visit(c.start_time)
|
||||
|
||||
check_request(end_time)
|
||||
|
||||
@@ -95,8 +95,8 @@ def may_revise(sr, user, page=None):
|
||||
# Users who are not allowed to view the page may not contribute to the page
|
||||
return False
|
||||
|
||||
if not user.can_wiki(default=True):
|
||||
# Global wiki contribute ban
|
||||
if user.wiki_override == False:
|
||||
# global ban
|
||||
return False
|
||||
|
||||
if page and page.has_editor(user._id36):
|
||||
|
||||
@@ -182,13 +182,6 @@ class Account(Thing):
|
||||
karma = self.link_karma
|
||||
return max(karma, 1) if karma > -1000 else karma
|
||||
|
||||
def can_wiki(self, default=False):
|
||||
if self.wiki_override is None:
|
||||
if not default:
|
||||
return self.link_karma > 100 or self.comment_karma > 100
|
||||
return default
|
||||
return self.wiki_override
|
||||
|
||||
def all_karmas(self):
|
||||
"""returns a list of tuples in the form (name, hover-text, link_karma,
|
||||
comment_karma)"""
|
||||
|
||||
Reference in New Issue
Block a user