예제 #1
0
    def before_request():
        g.user = get_current_user()
        if g.user:
            if g.user.is_new:
                flash('请登录邮箱激活账户。')
                signout_user()
            if g.user.is_banned:
                flash('账户已被禁用,请联系管理员。')
                signout_user()

        if g.user and g.user.is_admin:
            g._before_request_time = time.time()
예제 #2
0
    def before_request():
        g.user = get_current_user()
        if g.user:
            if g.user.is_new:
                flash('请登录邮箱激活账户。')
                signout_user()
            if g.user.is_banned:
                flash('账户已被禁用,请联系管理员。')
                signout_user()

        if g.user and g.user.is_admin:
            g._before_request_time = time.time()
예제 #3
0
def signout():
    """登出"""
    signout_user()
    return redirect(request.referrer or url_for('site.index'))
예제 #4
0
def signout():
    """登出"""
    signout_user()
    return redirect(request.referrer or url_for('site.index'))