diff --git a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/logout.py b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/logout.py index 6223fe956644a6d1e59384a891ce57eb684d6530..156457e882550d946c6279742ad0e92a733a85f3 100644 --- a/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/logout.py +++ b/product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_auto_logout/logout.py @@ -1,6 +1,7 @@ from AccessControl import getSecurityManager portal = context.getPortalObject() -username = getSecurityManager().getUser().getId() +user = getSecurityManager().getUser() +username = user.getId() if username is not None: portal.portal_sessions.manage_delObjects( portal.Base_getAutoLogoutSessionKey( @@ -18,4 +19,14 @@ if getattr(portal.portal_skins, "erp5_oauth_google_login", None): if getattr(portal.portal_skins, "erp5_oauth_facebook_login", None): REQUEST.RESPONSE.expireCookie('__ac_facebook_hash', path='/') +# PAS logout, if user is from a PAS user folder (which is the acquisition parent of the user) +getattr( + user, + 'resetCredentials', + lambda **kw: None, +)( + request=REQUEST, + response=REQUEST.RESPONSE, +) + return REQUEST.RESPONSE.redirect(REQUEST.URL1 + '/logged_out')