[CMF-checkins] CVS: CMF - SkinsTool.py:1.5

Jens Vagelpohl jens@digicool.com
Wed, 9 May 2001 17:47:48 -0400 (EDT)


Update of /cvs-repository/CMF/CMFCore
In directory korak:/tmp/cvs-serv3922

Modified Files:
	SkinsTool.py 
Log Message:
updateSkinCookie changes:

- changed protection from "public" to "protected: View" because portal_membership.getAuthenticatedMember would always just 
return "Anonymous User" while the method was public and invoked from logged_in

- took out a clause "if cookie is not None" that prevented a skins cookie being set if there was no skins cookie present at 
that moment.





--- Updated File SkinsTool.py in package CMF --
--- SkinsTool.py	2001/02/27 21:28:11	1.4
+++ SkinsTool.py	2001/05/09 21:47:47	1.5
@@ -240,11 +240,12 @@
         rval.sort()
         return rval
 
-    security.declarePublic('updateSkinCookie')
+    security.declareProtected('View', 'updateSkinCookie')
     def updateSkinCookie(self):
         '''
         If needed, updates the skin cookie based on the member preference.
         '''
+        import pdb; pdb.set_trace()
         pm = getToolByName(self, 'portal_membership')
         member = pm.getAuthenticatedMember()
         if hasattr(aq_base(member), 'portal_skin'):
@@ -252,7 +253,7 @@
             if mskin:
                 req = self.REQUEST
                 cookie = req.cookies.get(self.request_varname, None)
-                if cookie is not None and cookie != mskin:
+                if cookie != mskin:
                     resp = req.RESPONSE
                     expires = (DateTime('GMT') + 365).rfc822()
                     resp.setCookie(self.request_varname, mskin,