Ejemplo n.º 1
0
def index_static_get():
    if not auth.check_session():
        return flask.redirect('login')
    static_file = static.StaticFile(settings.conf.www_path,
                                    'index.html',
                                    cache=False)
    return static_file.get_response()
Ejemplo n.º 2
0
def login_static_get():
    if auth.check_session():
        return flask.redirect('')
    static_file = static.StaticFile(settings.conf.www_path,
        'login.html', cache=False, gzip=False)

    bodyClass = ''

    if settings.local.sub_active:
        if settings.app.theme == 'dark':
            bodyClass += 'dark '

        if settings.local.sub_plan == 'enterprise':
            if not settings.app.sso:
                pass
            elif settings.app.sso in (SAML_AUTH, SAML_DUO_AUTH):
                bodyClass += 'sso-saml '
            elif SAML_OKTA_AUTH in settings.app.sso:
                bodyClass += 'sso-okta '
            elif SAML_ONELOGIN_AUTH in settings.app.sso:
                bodyClass += 'sso-onelogin '
            elif GOOGLE_AUTH in settings.app.sso:
                bodyClass += 'sso-google '
            elif SLACK_AUTH in settings.app.sso:
                bodyClass += 'sso-slack '
            elif settings.app.sso == DUO_AUTH:
                bodyClass += 'sso-duo '

    if settings.app.demo_mode:
        bodyClass += 'demo '

    static_file.data = static_file.data.replace(
        '<body>', '<body class="' + bodyClass + '">')

    return static_file.get_response()
Ejemplo n.º 3
0
def index_static_get():
    if not auth.check_session(False):
        return utils.redirect('login')

    static_file = static.StaticFile(settings.conf.www_path,
        'index.html', cache=False)

    return static_file.get_response()
Ejemplo n.º 4
0
def index_static_get():
    if not auth.check_session():
        return flask.redirect('login')

    if settings.local.dart_url:
        return flask.redirect('/s/')

    static_file = static.StaticFile(settings.conf.www_path,
        'index.html', cache=False)

    return static_file.get_response()
Ejemplo n.º 5
0
def index_static_get():
    if not auth.check_session():
        return utils.redirect('login')

    if settings.local.dart_url:
        return utils.redirect('/s/')

    static_file = static.StaticFile(settings.conf.www_path,
                                    'index.html',
                                    cache=False)

    return static_file.get_response()
Ejemplo n.º 6
0
def login_static_get():
    if auth.check_session(False):
        return utils.redirect('')

    static_file = static.StaticFile(settings.conf.www_path,
                                    'login.html',
                                    cache=False,
                                    gzip=False)

    body_class = ''

    if auth.has_default_password():
        body_class += 'default-pass '

    if settings.local.sub_active:
        if settings.app.theme == 'dark':
            body_class += 'dark '

        if settings.local.sub_plan and \
                'enterprise' in settings.local.sub_plan:
            if not settings.app.sso:
                pass
            elif settings.app.sso in (SAML_AUTH, SAML_DUO_AUTH):
                body_class += 'sso-saml '
            elif SAML_OKTA_AUTH in settings.app.sso:
                body_class += 'sso-okta '
            elif SAML_ONELOGIN_AUTH in settings.app.sso:
                body_class += 'sso-onelogin '
            elif SAML_JUMPCLOUD_AUTH in settings.app.sso:
                body_class += 'sso-jumpcloud '
            elif AZURE_AUTH in settings.app.sso:
                body_class += 'sso-azure '
            elif GOOGLE_AUTH in settings.app.sso:
                body_class += 'sso-google '
            elif AUTHZERO_AUTH in settings.app.sso:
                body_class += 'sso-authzero '
            elif SLACK_AUTH in settings.app.sso:
                body_class += 'sso-slack '
            elif settings.app.sso == DUO_AUTH:
                body_class += 'sso-duo '

            if settings.app.sso and DUO_AUTH in settings.app.sso and \
                    settings.app.sso != DUO_AUTH and \
                    settings.app.sso_duo_mode != 'passcode':
                body_class += 'sso-duo-auth '

    if settings.app.demo_mode:
        body_class += 'demo '

    static_file.data = static_file.data.replace(
        '<body>', '<body class="' + body_class + '">')

    return static_file.get_response()
Ejemplo n.º 7
0
def login_static_get():
    if auth.check_session(False):
        return utils.redirect('')

    static_file = static.StaticFile(settings.conf.www_path,
        'login.html', cache=False, gzip=False)

    body_class = ''

    if auth.has_default_password():
        body_class += 'default-pass '

    if settings.local.sub_active:
        if settings.app.theme == 'dark':
            body_class += 'dark '

        if settings.local.sub_plan and \
                'enterprise' in settings.local.sub_plan:
            if not settings.app.sso:
                pass
            elif settings.app.sso in (SAML_AUTH, SAML_DUO_AUTH):
                body_class += 'sso-saml '
            elif SAML_OKTA_AUTH in settings.app.sso:
                body_class += 'sso-okta '
            elif SAML_ONELOGIN_AUTH in settings.app.sso:
                body_class += 'sso-onelogin '
            elif AZURE_AUTH in settings.app.sso:
                body_class += 'sso-azure '
            elif GOOGLE_AUTH in settings.app.sso:
                body_class += 'sso-google '
            elif AUTHZERO_AUTH in settings.app.sso:
                body_class += 'sso-authzero '
            elif SLACK_AUTH in settings.app.sso:
                body_class += 'sso-slack '
            elif settings.app.sso == DUO_AUTH:
                body_class += 'sso-duo '

            if settings.app.sso and DUO_AUTH in settings.app.sso and \
                    settings.app.sso != DUO_AUTH and \
                    settings.app.sso_duo_mode != 'passcode':
                body_class += 'sso-duo-auth '

    if settings.app.demo_mode:
        body_class += 'demo '

    static_file.data = static_file.data.replace(
        '<body>', '<body class="' + body_class + '">')

    return static_file.get_response()
Ejemplo n.º 8
0
def login_static_get():
    if auth.check_session():
        return flask.redirect('')
    static_file = static.StaticFile(settings.conf.www_path,
        'login.html', cache=False)

    dark_theme = all((
        settings.local.sub_active,
        settings.app.theme == 'dark',
    ))

    if dark_theme:
        static_file.data = static_file.data.replace(
            '<body>', '<body class="dark">')

    return static_file.get_response()
Ejemplo n.º 9
0
def login_static_get():
    if auth.check_session():
        return flask.redirect('')
    static_file = static.StaticFile(settings.conf.www_path,
                                    'login.html',
                                    cache=False)

    dark_theme = all((
        settings.local.sub_active,
        settings.app.theme == 'dark',
    ))

    if dark_theme:
        static_file.data = static_file.data.replace('<body>',
                                                    '<body class="dark">')

    return static_file.get_response()
Ejemplo n.º 10
0
def login_static_get():
    if auth.check_session():
        return flask.redirect('')
    static_file = static.StaticFile(settings.conf.www_path,
        'login.html', cache=False)

    bodyClass = ''

    if settings.local.sub_active:
        if settings.app.theme == 'dark':
            bodyClass += 'dark '

        if settings.app.sso and settings.local.sub_active:
            bodyClass += 'sso '

    static_file.data = static_file.data.replace(
        '<body>', '<body class="' + bodyClass + '">')

    return static_file.get_response()
Ejemplo n.º 11
0
def login_static_get():
    if auth.check_session():
        return flask.redirect('')
    static_file = static.StaticFile(settings.conf.www_path,
        'login.html', cache=False)

    bodyClass = ''

    if settings.local.sub_active:
        if settings.app.theme == 'dark':
            bodyClass += 'dark '

        if settings.app.sso and settings.local.sub_plan == 'enterprise':
            bodyClass += 'sso '

    static_file.data = static_file.data.replace(
        '<body>', '<body class="' + bodyClass + '">')

    return static_file.get_response()
Ejemplo n.º 12
0
def login_static_get():
    if auth.check_session():
        return flask.redirect('')
    static_file = static.StaticFile(settings.conf.www_path,
        'login.html', cache=False)

    bodyClass = ''

    if settings.local.sub_active:
        if settings.app.theme == 'dark':
            bodyClass += 'dark '

        if settings.local.sub_plan == 'enterprise':
            if settings.app.sso in (GOOGLE_AUTH, GOOGLE_DUO_AUTH):
                bodyClass += 'sso-google '
            elif settings.app.sso == DUO_AUTH:
                bodyClass += 'sso-duo '

    static_file.data = static_file.data.replace(
        '<body>', '<body class="' + bodyClass + '">')

    return static_file.get_response()
Ejemplo n.º 13
0
def login_static_get():
    if auth.check_session():
        return flask.redirect('')
    static_file = static.StaticFile(settings.conf.www_path,
        'login.html', cache=False)
    return static_file.get_response()