コード例 #1
0
ファイル: __init__.py プロジェクト: anshprat/nuancier-lite
def logout():
    """ Log out if the user is logged in other do nothing.
    Return to the index page at the end.
    """
    if hasattr(flask.g, 'fas_user') and flask.g.fas_user is not None:
        FAS.logout()
    return flask.redirect(flask.url_for('.index'))
コード例 #2
0
ファイル: __init__.py プロジェクト: grdryn/nuancier
def logout():  # pragma: no cover
    ''' Log out if the user is logged in other do nothing.
    Return to the index page at the end.
    '''
    if hasattr(flask.g, 'fas_user') and flask.g.fas_user is not None:
        FAS.logout()
        flask.flash('You are no longer logged-in')
    return flask.redirect(flask.url_for('.index'))
コード例 #3
0
ファイル: app.py プロジェクト: TroJan/mirrormanager2
def auth_logout():
    """ Log out if the user is logged in other do nothing.
    Return to the index page at the end.
    """
    next_url = flask.url_for('index')

    if APP.config.get('MM_AUTHENTICATION', None) == 'fas':
        if hasattr(flask.g, 'fas_user') and flask.g.fas_user is not None:
            FAS.logout()
            flask.flash("You are no longer logged-in")
    elif APP.config.get('MM_AUTHENTICATION', None) == 'local':
        login.logout()
    return flask.redirect(next_url)
コード例 #4
0
ファイル: __init__.py プロジェクト: yumsuresht/mirrormanager2
def auth_logout():
    """ Log out if the user is logged in other do nothing.
    Return to the index page at the end.
    """
    next_url = flask.url_for('index')

    if APP.config.get('MM_AUTHENTICATION', None) == 'fas':
        if hasattr(flask.g, 'fas_user') and flask.g.fas_user is not None:
            FAS.logout()
            flask.flash("You are no longer logged-in")
    elif APP.config.get('MM_AUTHENTICATION', None) == 'local':
        login.logout()
    return flask.redirect(next_url)
コード例 #5
0
ファイル: app.py プロジェクト: lmacken/kerneltest-harness
def logout():
    ''' Log out if the user is logged in other do nothing.
    Return to the index page at the end.
    '''
    next_url = flask.url_for('index')
    if 'next' in flask.request.values:
        if is_safe_url(flask.request.values['next']):
            next_url = flask.request.values['next']

    if next_url == flask.url_for('logout'):
        next_url = flask.url_for('index')
    if hasattr(flask.g, 'fas_user') and flask.g.fas_user is not None:
        FAS.logout()
        flask.flash("You are no longer logged-in")
    return flask.redirect(next_url)
コード例 #6
0
def logout():
    ''' Log out if the user is logged in other do nothing.
    Return to the index page at the end.
    '''
    next_url = flask.url_for('index')
    if 'next' in flask.request.values:
        if is_safe_url(flask.request.values['next']):
            next_url = flask.request.values['next']

    if next_url == flask.url_for('logout'):
        next_url = flask.url_for('index')
    if hasattr(flask.g, 'fas_user') and flask.g.fas_user is not None:
        FAS.logout()
        flask.flash("You are no longer logged-in")
    return flask.redirect(next_url)
コード例 #7
0
def logout():  # pragma: no cover
    ''' Log out if the user is logged in other do nothing.
    Return to the index page at the end.
    '''
    next_url = None
    if 'next' in flask.request.args:
        if is_safe_url(flask.request.args['next']):
            next_url = flask.request.args['next']

    if not next_url or next_url == flask.url_for('.login'):
        next_url = flask.url_for('.index')

    if hasattr(flask.g, 'fas_user') and flask.g.fas_user is not None:
        FAS.logout()
        flask.flash('You are no longer logged-in')

    return flask.redirect(next_url)
コード例 #8
0
ファイル: __init__.py プロジェクト: VoidWhisperer/elections
def auth_logout():
    if hasattr(flask.g, 'fas_user') and flask.g.fas_user is not None:
        FAS.logout()
        flask.g.fas_user = None
        flask.flash('You have been logged out')
    return safe_redirect_back()