[Checkins] SVN: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py Apply the login_transform on login, not just on name.

Maurits van Rees cvs-admin at zope.org
Thu Jan 3 16:15:30 UTC 2013


Log message for revision 128996:
  Apply the login_transform on login, not just on name.
  
  This is in searchUsers and searchPrincipals.
  The canonical argument according to the interface is 'name',
  but the plugins expect 'login', so third party code may easily
  pass a login argument to PAS.

Changed:
  U   Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py

-=-
Modified: Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py
===================================================================
--- Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py	2013-01-03 15:10:27 UTC (rev 128995)
+++ Products.PluggableAuthService/branches/maurits-login-transform/Products/PluggableAuthService/PluggableAuthService.py	2013-01-03 16:15:30 UTC (rev 128996)
@@ -308,7 +308,9 @@
             if kw.get('id') is not None:
                 del kw['id'] # don't even bother searching by id
             # Note: name can be a sequence.
-            kw['login'] = self.applyTransform( kw['name'] )
+            kw['login'] = kw['name']
+        if kw.get('login', None):
+            kw['login'] = self.applyTransform( kw['login'] )
 
         plugins = self._getOb( 'plugins' )
         enumerators = plugins.listPlugins( IUserEnumerationPlugin )
@@ -419,8 +421,8 @@
         # (e.g. Administrators), for users we apply the transform,
         # which could lowercase the name.
         groups = [ d.copy() for d in self.searchGroups( **kw ) ]
-        if search_name:
-            kw['login'] = self.applyTransform( search_name )
+        if kw.get('login', None):
+            kw['login'] = self.applyTransform( kw['login'] )
         users = [ d.copy() for d in self.searchUsers( **kw ) ]
 
         if groups_first:



More information about the checkins mailing list