-if add and \
- context.validatePassword(**form) and \
- context.members_add_control(**form) and \
- context.setRedirect(atool, 'user/join', b_start=b_start, ajax=ajax):
- return
+
+if add :
+ if validate_email :
+ password = confirm = rtool.generatePassword()
+ else :
+ ok = context.validatePassword(**form)
+ try :
+ if email_as_login :
+ member_id = member_email
+ rtool.addMember(id=member_id, password=password,
+ properties={'username': member_id,
+ 'given_name' : given_name,
+ 'name' : name,
+ 'email': member_email})
+ context.setStatus(True, _('Success!'))
+ except ValueError, errmsg:
+ context.setStatus(False, errmsg)
+
+
+
+# if add and \
+# context.validatePassword(**form) and \
+# context.members_add_control(**form) and \
+# context.setRedirect(atool, 'user/join', b_start=b_start, ajax=ajax):
+# return