diff --git a/docker/routlin-dash/app/pages/accountlogin/action.py b/docker/routlin-dash/app/pages/accountlogin/action.py index 8955b5f..c2f4c23 100644 --- a/docker/routlin-dash/app/pages/accountlogin/action.py +++ b/docker/routlin-dash/app/pages/accountlogin/action.py @@ -68,6 +68,7 @@ def form_login(): session.clear() session['account_id'] = account['account_id'] session['tz_offset_seconds'] = settings.get_host_utc_offset() + session['timezone'] = settings.get_host_timezone() session['apply_changes_immediately'] = False session.permanent = True diff --git a/docker/routlin-dash/app/pages/accountmanage/content.json b/docker/routlin-dash/app/pages/accountmanage/content.json index 735d6c4..0518e5e 100644 --- a/docker/routlin-dash/app/pages/accountmanage/content.json +++ b/docker/routlin-dash/app/pages/accountmanage/content.json @@ -81,13 +81,6 @@ "method": "post", "items": [ {"type": "hidden", "name": "row_index", "value": ""}, - { - "type": "field", - "label": "Email Address", - "name": "email_address_display", - "input_type": "text", - "value": "" - }, { "type": "field", "label": "Access Level", diff --git a/docker/routlin-dash/app/session_interface.py b/docker/routlin-dash/app/session_interface.py index e913485..6130c88 100644 --- a/docker/routlin-dash/app/session_interface.py +++ b/docker/routlin-dash/app/session_interface.py @@ -55,6 +55,7 @@ class SqliteSessionInterface(SessionInterface): 'timezone': str(prefs.get('timezone', '')), 'apply_changes_immediately': bool(prefs.get('apply_changes_immediately', False)), '_flashes': flashes, + '_permanent': True, } con.close() return SqliteSession(data, sid=sid, new=False) diff --git a/docker/routlin-dash/app/settings.py b/docker/routlin-dash/app/settings.py index 5741284..161b219 100644 --- a/docker/routlin-dash/app/settings.py +++ b/docker/routlin-dash/app/settings.py @@ -31,6 +31,19 @@ def get_host_utc_offset(): return time.localtime().tm_gmtoff +def get_host_timezone(): + """Return the host timezone name (e.g. 'America/New_York'), or '' if unknown.""" + tz = os.environ.get('TZ', '').strip() + if tz: + return tz + try: + with open('/etc/timezone') as f: + return f.read().strip() + except OSError: + pass + return '' + + def get_credentials_key(): """Return a Fernet-compatible key derived from the CREDENTIALS_KEY environment variable, or None if not set. SHA-256 hashes the raw string to produce 32 bytes, which are then