Example #1
0
 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)
Example #2
0
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),
    ]))
Example #3
0
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"))
Example #4
0
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)
Example #5
0
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)
Example #6
0
    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),
        ])
Example #7
0
    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),
            ])
Example #8
0
    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")
Example #9
0
    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")
Example #10
0
 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)
Example #11
0
File: base.py Project: 0x15/weasyl
 def status_check_fail(self, *args, **kwargs):
     return define.common_status_page(self.user_id, self.status)
Example #12
0
 def status_check_fail(self, *args, **kwargs):
     return define.common_status_page(self.user_id, self.status)
Example #13
0
 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)