Remove /validuser endpoint now that the Trac wiki is gone.

This commit is contained in:
Neil Williams
2013-01-22 21:37:48 -08:00
parent 2a2ee845da
commit f7f94d5cd7
5 changed files with 3 additions and 23 deletions

View File

@@ -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')

View File

@@ -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)

View File

@@ -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)

View File

@@ -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):

View File

@@ -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)"""