Esempio n. 1
0
    def manage_addAnonAttendeeAction(self, sn, givenname, organisation, mail,
            tel, postaladdress, attending, REQUEST=None):
        "Create an attendee, by calling the constructor"
        if not sn:
            return self.signup(setFormError(REQUEST, 'sn', 'Please enter your surname!'))
        if not givenname:
            return self.signup(setFormError(REQUEST, 'givenname', 'Please enter your givenname!'))
        if not mail:
            return self.signup(setFormError(REQUEST, 'mail', 'Please enter your email address!'))
        if mail and not isEmailValid(mail):
            return self.signup(setFormError(REQUEST, 'mail', 'Your email address is invalid!'))

        mail = str(mail)
        pat = re.compile(r'([a-zA-Z][\w-]*@[\w-]+(?:\.[\w-]+)*)')
        if pat.search(mail) is None:
            return MessageDialog(
                title = 'Bad email address',
                message = "Your registration couldn't succeed due to invalid email address",
                action = 'signup',
                )
        id = self.parseEmail(mail)
        passwd = genRandomId()

        if self.checkID(id):
           return self.signup(setFormError(REQUEST, 'mail', 'This email account was already used to make a reservation!'))

        self.manage_addProduct['ManagedMeetings'].manage_addAttendee(
                id , sn, givenname, organisation, mail,
                tel, postaladdress, attending, passwd, '', 'Attendee', 0, 1, '', REQUEST)

        if REQUEST is not None:
            return REQUEST.RESPONSE.redirect('registration')
Esempio n. 2
0
    def manage_addAttendeeAction(self, sn, givenname, organisation, mail,
            tel, postaladdress, attending, passwd, role, ldap_id, REQUEST=None):
        "Create an attendee, by calling the constructor"

        id = self.parseEmail(mail)
        passwd = genRandomId()

        if self.checkID(id):
            return self.authenticatedsignup(setFormError(REQUEST, 'mail', 'This email account was already used to make a reservation!'))

        self.manage_addProduct['ManagedMeetings'].manage_addAttendee(
                id , sn, givenname, organisation, mail,
                tel, postaladdress, attending, passwd, '', role, 1, 1, ldap_id, REQUEST)
        if REQUEST is not None:
            return REQUEST.RESPONSE.redirect('registration')