Ejemplo n.º 1
0
def lo_page():
    try:
        session.clear()
        return redirect(url_for('basic_page.landing_page'))
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 2
0
def start_login():
    try:
        authorization_url = pl.process_login()
        return redirect(authorization_url)
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 3
0
def landing_page():
    try:
        if 'au_id' in session:
            return redirect(url_for('internal_page.dashboard_page'))
        else:
            return render_template('index.html')
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 4
0
def terms_and_conditions_page():
    try:
        if 'au_id' in session:
            permission_level = ue.check_user_role(session['au_id'])
        else:
            permission_level = 'Guest'
        return render_template('terms-conditions.html', value=permission_level)
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 5
0
def create_flashcards_page():
    try:
        if 'au_id' in session:
            permission_level = ue.check_user_role(session['au_id'])
            return render_template('create-flashcards.html', value=permission_level)
        else:
            return redirect(url_for('basic_page.landing_page'))
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 6
0
def oauth2callback():
    try:
        pl.handle_callback()
        uu.update_user_info()
        user_blocked = ue.check_user_role(session['au_id']) == 'Blocked'
        if user_blocked:
            session.clear()
            return redirect(url_for('basic_page.account_suspended_page'))
        else:
            return redirect(url_for('internal_page.dashboard_page'))
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 7
0
def sheet_management_page():
    try:
        if 'au_id' in session:
            permission_level = ue.check_user_role(session['au_id'])
            if permission_level == 'Super User':
                return render_template('sheet-management.html')
            else:
                return redirect(url_for('internal_page.dashboard_page'))
        else:
            return redirect(url_for('basic_page.landing_page'))
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 8
0
def dashboard_page():
    try:
        if 'au_id' in session:
            permission_level = ue.check_user_role(session['au_id'])
            if permission_level == 'Blocked':
                session.clear()
                return redirect(url_for('basic_page.account_suspended_page'))
            else:
                return render_template('dashboard.html', value=permission_level)
        else:
            return redirect(url_for('basic_page.landing_page'))
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 9
0
def show_blog(sheet_id):
    try:
        if 'au_id' in session:
            permission_level = ue.check_user_role(session['au_id'])
            if permission_level == 'Blocked':
                session.clear()
                return redirect(url_for('basic_page.account_suspended_page'))
        else:
            permission_level = 'Guest'

        return render_template('flashcards-template.html', sheet_id=sheet_id, permission_level=permission_level)
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))
Ejemplo n.º 10
0
def account_suspended_page():
    try:
        return render_template('account-suspended.html')
    except:
        print(utils.generate_error_message(sys.exc_info()))
        return redirect(url_for('basic_page.general_error_page'))