示例#1
0
    def custom_static_html(route):
        if route == 'index' and get_config('ctf_theme') == 'aeolus':
            return render_template('index.html')
        page = get_page(route)
        if page is None:
            abort(404)
        else:
            if page.auth_required and authed() is False:
                return redirect(url_for('auth.login', next=request.path))

            return render_template('page.html', content=markdown(page.content))
示例#2
0
文件: views.py 项目: sigpwny/CTFd
def static_html(route):
    """
    Route in charge of routing users to Pages.
    :param route:
    :return:
    """
    page = get_page(route)
    if page is None:
        abort(404)
    else:
        if page.auth_required and authed() is False:
            return redirect(url_for("auth.login", next=request.full_path))

        return render_template("page.html", content=page.html, title=page.title)
示例#3
0
文件: views.py 项目: shareef12/CTFd
def static_html(route):
    """
    Route in charge of routing users to Pages.
    :param route:
    :return:
    """
    page = get_page(route)
    if page is None:
        abort(404)
    else:
        if page.auth_required and authed() is False:
            return redirect(url_for('auth.login', next=request.path))

        return render_template('page.html', content=markdown(page.content))
示例#4
0
def static_html(route):
    """
    Route in charge of routing users to Pages.
    :param route:
    :return:
    """
    page = get_page(route)
    if page is None:
        if (ctftime() or current_user.is_admin()
                or (ctf_ended() and view_after_ctf())):
            filename = safe_join(app.root_path, "static", route)
            if os.path.isfile(filename):
                return send_file(filename)
        abort(404)
    else:
        if page.auth_required and authed() is False:
            return redirect(url_for("auth.login", next=request.full_path))

        return render_template("page.html", content=markdown(page.content))
示例#5
0
文件: views.py 项目: ccns/CCNS-CTF
def static_html(route):
    """
    Route in charge of routing users to Pages.
    :param route:
    :return:
    """
    page = get_page(route)
    if page is None:
        abort(404)
    else:
        if route == 'index':
            try:
                highscore = str(get_standings()[0][3]).rjust(6, '0')
            except:
                highscore = '000000'
            return render_template('index.html', highscore=highscore)
        elif page.auth_required and authed() is False:
            return redirect(url_for('auth.login', next=request.full_path))

        return render_template("page.html", content=markdown(page.content))