[Erp5-report] r41927 kazuhiko - /erp5/trunk/products/ERP5Security/
nobody at svn.erp5.org
nobody at svn.erp5.org
Sun Jan 2 17:37:44 CET 2011
Author: kazuhiko
Date: Sun Jan 2 17:37:44 2011
New Revision: 41927
URL: http://svn.erp5.org?rev=41927&view=rev
Log:
modify the code so that request.get_header is evaluated only when request.getHeader does not exist (even though request.get_header still exists in Zope-2.12).
Modified:
erp5/trunk/products/ERP5Security/ERP5ExternalAuthenticationPlugin.py
Modified: erp5/trunk/products/ERP5Security/ERP5ExternalAuthenticationPlugin.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Security/ERP5ExternalAuthenticationPlugin.py?rev=41927&r1=41926&r2=41927&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Security/ERP5ExternalAuthenticationPlugin.py [utf8] (original)
+++ erp5/trunk/products/ERP5Security/ERP5ExternalAuthenticationPlugin.py [utf8] Sun Jan 2 17:37:44 2011
@@ -102,7 +102,11 @@ class ERP5ExternalAuthenticationPlugin(E
def extractCredentials(self, request):
""" Extract credentials from the request header. """
creds = {}
- user_id = getattr(request, 'getHeader', request.get_header)(self.user_id_key)
+ getHeader = getattr(request, 'getHeader', None)
+ if getHeader is None:
+ # use get_header instead for Zope-2.8
+ getHeader = request.get_header
+ user_id = getHeader(self.user_id_key)
if user_id is not None:
creds['external_login'] = user_id
More information about the Erp5-report
mailing list