[Zope-CMF] personalize handler reading from tinytable
Chad Nantais
cnantais@rednaxel.com
Fri, 15 Feb 2002 03:32:14 -0500
I have added 2 custom fields to portal_memberdata: "promo_name" and
"promo_code". Members have to be able to enter these 2 fields through the
personalize_form. Then the 2 values must be checked to see if they are a
matching pair record in a TinyTable. If they match, then promo_name and
promo_code can be set. Otherwise, those 2 memberdata fields should not get
set.
I have tried to do this by customizing the personalize script in
portal_skins. However, when I submit my personalize_form from webspace, I a
with a login dialog box and when i refuse to login, i get an error saying
that permission to access "portal_registration.setProperties" is denied.
Here's the offending personalize script: (promo_roster is the TinyTable)
## Personalize Handler
REQUEST=context.REQUEST
context.portal_registration.setProperties(REQUEST)
if REQUEST.has_key('promo_name') and REQUEST.has_key('promo_code'):
for x in context.promo_roster():
if x['promo_name'] == REQUEST['promo_name'] and x['promo_code'] ==
REQUEST['promo_code']:
context.portal_registration.setProperties(promo_name=REQUEST['promo_name'],
promo_code=REQUEST['promo_code'])
if REQUEST.has_key('portal_skin'):
context.portal_skins.updateSkinCookie()
qs = '/personalize_form?portal_status_message=Member+changed.'
context.REQUEST.RESPONSE.redirect(context.portal_url() + qs)
##end
Is the error caused by the fact that setProperties is called twice?
Thanks