[Checkins] SVN: PluggableAuthService/trunk/plugins/ Patch from laz to make the user search not show results when unknown keywords are present in the search

Alec Mitchell apm13 at columbia.edu
Sun Apr 1 04:26:58 EDT 2007


Log message for revision 73960:
  Patch from laz to make the user search not show results when unknown keywords are present in the search
  

Changed:
  U   PluggableAuthService/trunk/plugins/ZODBUserManager.py
  U   PluggableAuthService/trunk/plugins/tests/test_ZODBUserManager.py

-=-
Modified: PluggableAuthService/trunk/plugins/ZODBUserManager.py
===================================================================
--- PluggableAuthService/trunk/plugins/ZODBUserManager.py	2007-04-01 01:36:03 UTC (rev 73959)
+++ PluggableAuthService/trunk/plugins/ZODBUserManager.py	2007-04-01 08:26:57 UTC (rev 73960)
@@ -521,6 +521,7 @@
 
         self._filter_ids = id
         self._filter_logins = login
+        self._filter_keywords = kw
 
     def __call__( self, user_info ):
 
@@ -534,8 +535,11 @@
             key = 'login'
             to_test = self._filter_logins
 
+        elif self._filter_keywords:
+            return 0    # TODO:  try using 'kw'
+
         else:
-            return 1 # TODO:  try using 'kw'
+            return 1    # the search is done without any criteria
 
         value = user_info.get( key )
 

Modified: PluggableAuthService/trunk/plugins/tests/test_ZODBUserManager.py
===================================================================
--- PluggableAuthService/trunk/plugins/tests/test_ZODBUserManager.py	2007-04-01 01:36:03 UTC (rev 73959)
+++ PluggableAuthService/trunk/plugins/tests/test_ZODBUserManager.py	2007-04-01 08:26:57 UTC (rev 73960)
@@ -243,6 +243,20 @@
             self.assertEqual( info_list[ i ][ 'editurl' ]
                             , 'partial/manage_users?user_id=%s' % sorted[ i ])
 
+    def test_enumerateUsers_other_criteria( self ):
+
+        from Products.PluggableAuthService.tests.test_PluggableAuthService \
+            import FauxRoot
+
+        root = FauxRoot()
+        zum = self._makeOne( id='partial' ).__of__( root )
+
+        ID_LIST = ( 'foo', 'bar', 'baz', 'bam' )
+
+        for id in ID_LIST:
+
+            zum.addUser( id, '%s at example.com' % id, 'password' )
+
     def test_enumerateUsers_exact_nonesuch( self ):
 
         from Products.PluggableAuthService.tests.test_PluggableAuthService \



More information about the Checkins mailing list