|
|
@ -11,28 +11,13 @@ def login():
|
|
|
|
form = forms.LoginForm()
|
|
|
|
form = forms.LoginForm()
|
|
|
|
endpoint = flask.request.args.get('next', 'ui.index')
|
|
|
|
endpoint = flask.request.args.get('next', 'ui.index')
|
|
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
form.target.choices = []
|
|
|
|
str(app.config["WEBMAIL"]).upper() != "NONE"
|
|
|
|
if str(app.config["ADMIN"]).upper() != "FALSE":
|
|
|
|
and str(app.config["ADMIN"]).upper() != "FALSE"
|
|
|
|
form.target.choices += [("Admin", "Admin")]
|
|
|
|
and endpoint != "ui.webmail"
|
|
|
|
if str(app.config["WEBMAIL"]).upper() != "NONE":
|
|
|
|
):
|
|
|
|
form.target.choices += [("Webmail", "Webmail")]
|
|
|
|
form.target.choices = [("Admin", "Admin"), ("Webmail", "Webmail")]
|
|
|
|
if endpoint == "ui.webmail":
|
|
|
|
elif (
|
|
|
|
form.target.choices.reverse()
|
|
|
|
str(app.config["WEBMAIL"]).upper() != "NONE"
|
|
|
|
|
|
|
|
and str(app.config["ADMIN"]).upper() != "FALSE"
|
|
|
|
|
|
|
|
and endpoint == "ui.webmail"
|
|
|
|
|
|
|
|
):
|
|
|
|
|
|
|
|
form.target.choices = [("Webmail", "Webmail"), ("Admin", "Admin")]
|
|
|
|
|
|
|
|
elif (
|
|
|
|
|
|
|
|
str(app.config["WEBMAIL"]).upper() != "NONE"
|
|
|
|
|
|
|
|
and str(app.config["ADMIN"]).upper() == "FALSE"
|
|
|
|
|
|
|
|
):
|
|
|
|
|
|
|
|
form.target.choices = [("Webmail", "Webmail")]
|
|
|
|
|
|
|
|
elif (
|
|
|
|
|
|
|
|
str(app.config["WEBMAIL"]).upper() == "NONE"
|
|
|
|
|
|
|
|
and str(app.config["ADMIN"]).upper() != "FALSE"
|
|
|
|
|
|
|
|
):
|
|
|
|
|
|
|
|
form.target.choices = [("Admin", "Admin")]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if form.validate_on_submit():
|
|
|
|
if form.validate_on_submit():
|
|
|
|
if str(form.target.data) == 'Admin':
|
|
|
|
if str(form.target.data) == 'Admin':
|
|
|
|