def status_check_tween(request): status = d.common_status_check(request.userid) if status: # Permit POST'ing to the forced password reset path (handle the request normally) if request.method == "POST" and request.path == "/force/resetpassword": return handler(request) # Otherwise force the user to the corresponding `status` page. return Response(d.common_status_page(request.userid, status)) return handler(request)
def manage_alias_get_(request): status = define.common_status_check(request.userid) if status: return Response(define.common_status_page(request.userid, status)) elif not request.userid: return Response(define.webpage(request.userid)) return Response(define.webpage(request.userid, "manage/alias.html", [ # Alias useralias.select(request.userid), ]))
def manage_alias_get_(request): status = define.common_status_check(request.userid) if status: return Response(define.common_status_page(request.userid, status)) elif not request.userid: return Response(define.webpage(request.userid)) return Response(define.webpage(request.userid, "manage/alias.html", [ # Alias useralias.select(request.userid), ], title="Edit Username Alias"))
def admin_render_page(template_path, args=()): userid = d.get_userid() status = d.common_status_check(userid) if status: return d.common_status_page(userid, status) elif not userid: return d.webpage(userid) elif userid not in staff.ADMINS: return d.webpage(userid, errorcode.permission) else: return d.webpage(userid, template_path, args)
def GET(self): status = define.common_status_check(self.user_id) if status: return define.common_status_page(self.user_id, status) elif not self.user_id: return define.webpage(self.user_id) return define.webpage(self.user_id, "manage/alias.html", [ # Alias useralias.select(self.user_id), ])
def GET(self): status = define.common_status_check(self.user_id) if status: return define.common_status_page(self.user_id, status) elif not self.user_id: return define.webpage(self.user_id) return define.webpage( self.user_id, "manage/alias.html", [ # Alias useralias.select(self.user_id), ])
def POST(self): userid = d.get_userid() status = d.common_status_check(userid) if status: return d.common_status_page(userid, status) elif not userid: return d.webpage(userid) elif userid not in staff.MODS: return d.webpage(userid, d.errorcode.permission) form = web.input(title="", content="") create(userid, form) raise web.seeother("/admincontrol")
def status_check_tween(request): status = d.common_status_check(request.userid) if status: return Response(d.common_status_page(request.userid, status)) return handler(request)
def status_check_fail(self, *args, **kwargs): return define.common_status_page(self.user_id, self.status)