74277b91b02fa4a203b44e0a632ea9ae742ecff3
1 ##parameters=username, password, confirm, ajax=''
2 REQUEST
= context
.REQUEST
3 rtool
= context
.portal_registration
4 from ZTUtils
import make_query
as mq
5 url
= context
.portal_url()
6 red
= REQUEST
.RESPONSE
.redirect
8 failMessage
= rtool
.testPasswordValidity(password
, confirm
)
10 return red('%s/portal_members?%s' % (url
, mq(portal_status_message
= failMessage
, ajax
=ajax
)))
12 failMessage
= rtool
.testPropertiesValidity(REQUEST
.form
)
14 return red('%s/portal_members?%s' % (url
, mq(portal_status_message
= failMessage
, ajax
=ajax
)))
16 context
.portal_registration
.addMember(username
, password
, roles
=[], properties
=REQUEST
)
17 red('%s/portal_members?%s' % (url
, mq(portal_status_message
= 'Member created.', ajax
=ajax
)))