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
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to