Re: Re[4]: [Zope-dev] moment when zope was started.
On 11/9/05, Victor Safronovich [EMAIL PROTECTED] wrote: Ok, i need to replace zpublisher_validate_hook with my hook. [...] _afterValidateHook do many thinks specific to the portal such as 1. Sets response charset according to the user's selected language. 2. Replaces HTML-encoded entities with their corresponding characters in the POST form data. 3. Changes system locale according to the portal language. Ok, 2. and 3. can be moved to UserFolder.validate method, which PAS used. But 1. uses getSecurityManager through Products.CMFCore.utils._getAuthenticatedUser through MembershipTool.{isAnonymousUser,getAuthenticatedMember}, and must be executed after the Zope`s zpublisher_validate_hook hook, which setted new security manager. OK, fine, I don't know if there is another way of doing this, so I'll assume your way is the best (although it's complicated). But you say you want to know when the server was started. How does that come into any of the above things? None of those have anything to do with how long the server has been running. You are just giving us small disassociated pieces of information, and then you assume that we should read your mind for the rest of the needed information. It doesn't work like that. http://www.catb.org/~esr/faqs/smart-questions.html -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/ ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re[4]: [Zope-dev] moment when zope was started.
Hello Lennart Regebro, Tuesday, November 8, 2005, 6:43:23 PM, you wrote: LR Yeah, but he asked for what you are trying to do, not what you want to LR know. We can't help you if we don't know what you are trying to do. Ok, i need to replace zpublisher_validate_hook with my hook. my hook: def zpublisher_validated_hook( REQUEST, user ): Zope._nau_zpublisher_validated_hook( REQUEST, user ) # old validate hook published = self.PUBLISHED published = getattr(published, 'im_self', published) portal = published.getPortalObject() if hasattr( portal, '_afterValidateHook' ): portal._afterValidateHook( user, published, REQUEST ) _afterValidateHook do many thinks specific to the portal such as 1. Sets response charset according to the user's selected language. 2. Replaces HTML-encoded entities with their corresponding characters in the POST form data. 3. Changes system locale according to the portal language. Ok, 2. and 3. can be moved to UserFolder.validate method, which PAS used. But 1. uses getSecurityManager through Products.CMFCore.utils._getAuthenticatedUser through MembershipTool.{isAnonymousUser,getAuthenticatedMember}, and must be executed after the Zope`s zpublisher_validate_hook hook, which setted new security manager. -- Best regards, Victor Safronovich NauMen.NauDoc.SoftwareDeveloper http://www.naumen.ru ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )