[zopeorg-checkins] CVS: Products/ZopeOrg-NV/skins/nzo - add_ldap_attributes.py:1.1 register.py:1.1 registered_notify_template.pt:1.1

Chris McDonough chrism at zope.com
Thu Aug 7 01:01:14 EDT 2003


Update of /cvs-zopeorg/Products/ZopeOrg-NV/skins/nzo
In directory cvs.zope.org:/tmp/cvs-serv28904/nzo

Added Files:
	add_ldap_attributes.py register.py 
	registered_notify_template.pt 
Log Message:
These were added in the wrong place.


=== Added File Products/ZopeOrg-NV/skins/nzo/add_ldap_attributes.py ===
## Script (Python) "add_ldap_attributes"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=request
##title=Register a User
##

if request.form.get('cn') is None:
    request.form['cn'] = request['username']

if request.form.get('givenName') is None:
    request.form['givenName'] = request['fullname']

if request.form.get('lastName') is None:
    request.form['lastName'] = ''

if request.form.get('mail') is None:
    email_addr = request['email']
    request.form['mail'] = email_addr

if request.form.get('o') is None:
    request.form['o']= ''

if request.form.get('portalSkin') is None:
    request.form['portalSkin'] = 'NZO'

if request.form.get('public') is None:
    request.form['public'] = ''

#if request.form.get('prevLogin') is None:
#    request.form['prevLogin'] = str(request['prev_visit'])
#
#if request.form.get('lastLogin') is None:
#    request.form['lastLogin'] = str(request['last_visit'])
    
return request


=== Added File Products/ZopeOrg-NV/skins/nzo/register.py ===
## Script (Python) "register"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=password='password', confirm='confirm'
##title=Register a User
##
REQUEST=context.REQUEST

# add LDAP attributes
REQUEST = context.add_ldap_attributes(REQUEST)
errors = {}

portal_registration=context.portal_registration
site_properties=context.portal_properties.site_properties

username = REQUEST['username']

password=REQUEST.get('password') or portal_registration.generatePassword()
portal_registration.addMember(username, password, properties=REQUEST)

if site_properties.validate_email or REQUEST.get('mail_me', 0):
    try:
        portal_registration.registeredNotify(username)
    except:
        context.plone_utils.logException()
        exception = context.plone_utils.exceptionString()
        errors['email'] = 'We were unable to send your password to this address.'
        return ('failure', context, {'portal_status_message':exception,
                                     'errors':errors,
                                     'came_from':context.REQUEST.get('came_from','logged_in')})

return ('success', context, {'portal_status_message':context.REQUEST.get('portal_status_message', 'Registered.'),\
                             'came_from':context.REQUEST.get('came_from','logged_in')})


=== Added File Products/ZopeOrg-NV/skins/nzo/registered_notify_template.pt ===
To: <span tal:replace="options/member/mail" />
From: "<span tal:replace="here/email_from_name" />" <<span tal:replace="here/email_from_address" />>
Subject: <span i18n:translate="mailtemplate_registered_portal_membership_info" tal:omit-tag="">Portal Membership Information</span>
Content-Type: text/plain; charset=<span tal:replace="here/portal_properties/site_properties/default_charset" />

<div i18n:translate="mailtemplate_registered_body" tal:omit-tag="">
You have been registered as a member of <span i18n:name="portal_name" tal:omit-tag="" tal:content="python:here.portal_url.getPortalObject().Title()" />, which
allows you to personalize your view of the website and participate in
the community.

Description:
<span i18n:name="description" tal:omit-tag="" tal:content="here/description" />

Visit us at <span i18n:name="portal_url" tal:omit-tag="" tal:content="here/portal_url" />

Your login name and password are:

Login name : <span i18n:name="username" tal:omit-tag="" tal:content="options/member/getUserName" />
Password   : <span i18n:name="password" tal:omit-tag="" tal:content="options/password" />
</div>
--
<span tal:replace="here/email_from_name" />





More information about the zopeorg-checkins mailing list