diff --git a/gen/__init__.py b/gen/__init__.py index 35da42b..fa05a3c 100644 --- a/gen/__init__.py +++ b/gen/__init__.py @@ -1456,7 +1456,11 @@ class Boolean(Type): label, sdefault, scolspan) self.pythonType = bool + # Layout including a description dLayouts = {'view': 'lf', 'edit': Table('flrv;=d', width=None)} + # Centered layout, no description + cLayouts = {'view': 'lf|', 'edit': 'flrv|'} + def getDefaultLayouts(self): return {'view': 'lf', 'edit': Table('f;lrv;=', width=None)} @@ -2925,6 +2929,8 @@ class Config: self.sourceLanguage = 'en' # Activate or not the button on home page for asking a new password self.activateForgotPassword = True + # Enable session timeout? + self.enableSessionTimeout = False # When using Ogone, place an instance of appy.gen.ogone.OgoneConfig in # the field below. self.ogone = None diff --git a/gen/generator.py b/gen/generator.py index 9bed045..8ab1a0b 100644 --- a/gen/generator.py +++ b/gen/generator.py @@ -603,6 +603,7 @@ class ZopeGenerator(Generator): repls['languages'] = ','.join('"%s"' % l for l in self.config.languages) repls['languageSelector'] = self.config.languageSelector repls['sourceLanguage'] = self.config.sourceLanguage + repls['enableSessionTimeout'] = self.config.enableSessionTimeout repls['ogone'] = repr(self.config.ogone) repls['activateForgotPassword'] = self.config.activateForgotPassword self.copyFile('config.pyt', repls, destName='config.py') diff --git a/gen/installer.py b/gen/installer.py index fb40242..cd60316 100644 --- a/gen/installer.py +++ b/gen/installer.py @@ -318,7 +318,11 @@ class ZopeInstaller: # Register a function warning us when a session object is deleted. When # launching Zope in test mode, the temp folder does not exist. if not hasattr(self.app, 'temp_folder'): return - self.app.temp_folder.session_data.setDelNotificationTarget(onDelSession) + sessionData = self.app.temp_folder.session_data + if self.config.enableSessionTimeout: + sessionData.setDelNotificationTarget(onDelSession) + else: + sessionData.setDelNotificationTarget(None) def enableUserTracking(self): '''Enables the machinery allowing to know who is currently logged in. diff --git a/gen/templates/config.pyt b/gen/templates/config.pyt index d4a5041..6da84f5 100644 --- a/gen/templates/config.pyt +++ b/gen/templates/config.pyt @@ -48,6 +48,7 @@ languages = [] languageSelector = sourceLanguage = '' activateForgotPassword = +enableSessionTimeout = ogone = # When Zope is starting or runs in test mode, there is no request object. We