[Checkins] SVN: Products.PluggableAuthService/branches/shh-15-masquerading/Products/PluggableAuthService/utils.py Return previously set value when an arg is passed to masquerading.

Stefan H. Holek stefan at epy.co.at
Mon Mar 9 07:09:57 EDT 2009


Log message for revision 97690:
  Return previously set value when an arg is passed to masquerading.

Changed:
  U   Products.PluggableAuthService/branches/shh-15-masquerading/Products/PluggableAuthService/utils.py

-=-
Modified: Products.PluggableAuthService/branches/shh-15-masquerading/Products/PluggableAuthService/utils.py
===================================================================
--- Products.PluggableAuthService/branches/shh-15-masquerading/Products/PluggableAuthService/utils.py	2009-03-09 11:06:06 UTC (rev 97689)
+++ Products.PluggableAuthService/branches/shh-15-masquerading/Products/PluggableAuthService/utils.py	2009-03-09 11:09:56 UTC (rev 97690)
@@ -217,9 +217,10 @@
 _ENVAR = 'PAS_MASQUERADING'
 
 def masquerading( enabled=None ):
+    value = os.environ.get(_ENVAR, 'off')
     if enabled is not None:
         os.environ[_ENVAR] = enabled and 'on' or 'off'
-    return os.environ.get(_ENVAR, '') == 'on'
+    return value == 'on'
 
 _MASQ = '/'
 
@@ -228,5 +229,5 @@
         split = user_id.split(_MASQ, 1)
         if len(split) == 2 and '' not in split:
             return tuple(split)
-    return (user_id, None)
+    return user_id, None
 



More information about the Checkins mailing list