1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-02-02 09:47:13 +03:00

Merge remote-tracking branch 'origin/v3.5' into v3.5-mfa

This commit is contained in:
Adolfo Gómez García 2022-06-23 14:05:25 +02:00
commit 00d9f5759d
5 changed files with 27 additions and 27 deletions

View File

@ -85,7 +85,7 @@ default_app_config = 'uds.UDSAppConfig'
@receiver(connection_created)
def extend_sqlite(connection=None, **kwargs):
if connection.vendor == "sqlite":
if connection and connection.vendor == "sqlite":
logger.debug('Connection vendor is sqlite, extending methods')
cursor = connection.cursor()
cursor.execute('PRAGMA synchronous=OFF')
@ -95,5 +95,4 @@ def extend_sqlite(connection=None, **kwargs):
connection.connection.create_function("MIN", 2, min)
connection.connection.create_function("MAX", 2, max)
connection.connection.create_function("CEIL", 1, math.ceil)
connection.connection.create_function("FLOOR", 1, math.floor)

View File

@ -422,29 +422,27 @@ def webLogout(
"""
if exit_url is None:
exit_url = request.build_absolute_uri(reverse('page.login'))
# exit_url = GlobalConfig.LOGIN_URL.get()
# if GlobalConfig.REDIRECT_TO_HTTPS.getBool() is True:
# exit_url = exit_url.replace('http://', 'https://')
if request.user:
authenticator = request.user.manager.getInstance()
username = request.user.name
exit_url = authenticator.logout(username) or exit_url
if request.user.id != ROOT_ID:
# Log the event if not root user
events.addEvent(
request.user.manager,
events.ET_LOGOUT,
username=request.user.name,
srcip=request.ip,
)
else: # No user, redirect to /
return HttpResponseRedirect(reverse('page.login'))
# Try to delete session
request.session.flush()
# set authorized to False
request.authorized = False
try:
if request.user:
authenticator = request.user.manager.getInstance()
username = request.user.name
exit_url = authenticator.logout(username) or exit_url
if request.user.id != ROOT_ID:
# Log the event if not root user
events.addEvent(
request.user.manager,
events.ET_LOGOUT,
username=request.user.name,
srcip=request.ip,
)
else: # No user, redirect to /
return HttpResponseRedirect(reverse('page.login'))
except Exception:
raise
finally:
# Try to delete session
request.session.flush()
request.authorized = False
response = HttpResponseRedirect(request.build_absolute_uri(exit_url))
if authenticator:

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -22,6 +22,7 @@ gettext("Launching service");
gettext("Errors found");
gettext("Warning");
gettext("Service is in maintenance and cannot be executed");
gettext("Errors found");
gettext("We use cookies to track usage and preferences");
gettext("I Understand");
gettext("Learn more");
@ -70,3 +71,5 @@ gettext("Username");
gettext("Password");
gettext("Authenticator");
gettext("Login");
gettext("Login Verification");
gettext("Submit");