diff roundup/cgi/client.py @ 6211:50960479f627

New config-option 'cookie_takes_precedence' .. in the [web] section. This allows sub-logins (e.g. without a password given a specific role) even when a non-cookie login mechanism (like Kerberos) is in use. With that mechanism e.g., a Kerberos ticket will not take precedence over an existing cookie. This might become the default in the future and the new option might go away.
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 29 Jun 2020 15:48:04 +0200
parents f35ca71c9f2e
children 3b62c35e824d
line wrap: on
line diff
--- a/roundup/cgi/client.py	Sun Jun 28 20:57:00 2020 -0400
+++ b/roundup/cgi/client.py	Mon Jun 29 15:48:04 2020 +0200
@@ -997,7 +997,14 @@
         user = None
         # first up, try http authorization if enabled
         cfg = self.instance.config
-        if cfg.WEB_HTTP_AUTH:
+        if cfg.WEB_COOKIE_TAKES_PRECEDENCE:
+            user = self.session_api.get('user')
+            if user:
+                # update session lifetime datestamp
+                self.session_api.update()
+                if 'REMOTE_USER' in self.env:
+                    del self.env['REMOTE_USER']
+        if not user and cfg.WEB_HTTP_AUTH:
             if 'REMOTE_USER' in self.env:
                 # we have external auth (e.g. by Apache)
                 user = self.env['REMOTE_USER']

Roundup Issue Tracker: http://roundup-tracker.org/