Пример #1
0
def logout():
  """Logs out current user."""
  from ggrc.login.common import get_next_url
  if 'permissions' in session:
    del session['permissions']
  flask_login.logout_user()
  return redirect(get_next_url(request, default_url=url_for('index')))
Пример #2
0
def logout():
  if 'permissions' in session:
    del session['permissions']
  flask_login.logout_user()
  return redirect(
    users.create_logout_url(
      get_next_url(request, default_url=url_for('index'))))
Пример #3
0
def login():
  user = get_user()
  flask_login.login_user(user)
  #FIXME adding default permissions of None to session for now.
  session['permissions'] = None
  return redirect(
    get_next_url(request, default_url=url_for('dashboard')))
Пример #4
0
def login():
  user = get_user()
  if user.system_wide_role != 'No Access':
    flask_login.login_user(user)
    return redirect(get_next_url(request, default_url=url_for('dashboard')))
  else:
    flash(u'You do not have access. Please contact your administrator.', 'alert alert-info')
    return redirect('/')
Пример #5
0
def login():
  user = get_user()
  if user.system_wide_role != 'No Access':
    flask_login.login_user(user)
    return redirect(get_next_url(request, default_url=url_for('dashboard')))
  else:
    flash(u'You do not have access. Please contact your administrator.', 'alert alert-info')
    return redirect('/')
Пример #6
0
def login():
  """Log in current user."""
  user = get_user()
  if user.system_wide_role != 'No Access':
    flask_login.login_user(user)
    return flask.redirect(common.get_next_url(
        flask.request, default_url=flask.url_for('dashboard')))

  flask.flash(u'You do not have access. Please contact your administrator.',
              'alert alert-info')
  return flask.redirect('/')
Пример #7
0
def login():
  """Logs in current user."""
  from ggrc.login.common import get_next_url
  db_user = get_user()
  common.commit_user_and_role(db_user)
  if db_user.system_wide_role != 'No Access':
    flask_login.login_user(db_user)
    return redirect(get_next_url(request, default_url=url_for('dashboard')))
  flash(u'You do not have access. Please contact your administrator.',
        'alert alert-info')
  return redirect('/')
Пример #8
0
def logout():
    flask_login.logout_user()
    return redirect(
        users.create_logout_url(
            get_next_url(request, default_url=url_for('index'))))
Пример #9
0
def login():
    user = get_user()
    flask_login.login_user(user)
    return redirect(get_next_url(request, default_url=url_for('dashboard')))
Пример #10
0
def logout():
  flask_login.logout_user()
  return flask.redirect(users.create_logout_url(common.get_next_url(
      flask.request, default_url=flask.url_for('index'))))
Пример #11
0
def login():
  user = get_user()
  flask_login.login_user(user)
  return redirect(
    get_next_url(request, default_url=url_for('dashboard')))
Пример #12
0
def logout():
    flask_login.logout_user()
    return redirect(users.create_logout_url(get_next_url(request, default_url=url_for("index"))))
Пример #13
0
def logout():
  flask_login.logout_user()
  return redirect(get_next_url(request, default_url=url_for('index')))
Пример #14
0
def login():
  from ggrc.login.common import get_next_url
  user = get_user()
  flask_login.login_user(user)
  return redirect(get_next_url(request, default_url=url_for('dashboard')))