def _process( self ):
     regForm = self._conf.getRegistrationForm()
     if not regForm.isActivated() or not self._conf.hasEnabledSection("regForm"):
         p = registrationForm.WPRegFormInactive( self, self._conf )
         return p.display()
     else:
         p = ePayments.WPEPaymentSkipjackDisplayInfo(self, self._conf, self._registrant )
         return p.display()
Exemple #2
0
 def _process(self):
     #if the RegForm is not activated we show up a form informing about that.
     #   This must be done at RH level because there can be some RH not
     #   displaying pages.
     if not self._regForm.isActivated() or not self._conf.hasEnabledSection("regForm"):
         p = registrationForm.WPRegFormInactive(self, self._conf)
         return p.display()
     else:
         return self._processIfActive()
Exemple #3
0
    def _process(self):
        canManageRegistration = self._conf.canManageRegistration(self._getUser())
        if not canManageRegistration and not self._regForm.isActivated():
            p = registrationForm.WPRegFormInactive(self, self._conf)
            return p.display()
        params = self._getRequestParams()
        email = self._regForm.getPersonalData().getValueFromParams(params, 'email')
        if email is None:
            raise FormValuesError(_("An email address has to be set in order to make the registration in the event."))
        elif not validMail(email, False):
            raise FormValuesError(_("The given email address is not valid."))
        matchedUsers = AvatarHolder().match({"email": email}, exact=1)
        if matchedUsers:
            user = matchedUsers[0]
        else:
            user = None
        # Check if the user can register
        if not canManageRegistration:  # normal user registering. Managers can.
            if self._conf.getRegistrationForm().isFull():
                self._redirect(urlHandlers.UHConfRegistrationFormDisplay.getURL(self._conf))
                return
            elif not self._conf.getRegistrationForm().inRegistrationPeriod():
                flash(_("Your registration couldn't be recorded."), 'error')
                return redirect(url_for('event.confRegistrationFormDisplay', self._conf))
        if user is None:
            if self._conf.hasRegistrantByEmail(email):
                raise FormValuesError("There is already a user with the email \"%s\". Please choose another one" % email)
        else:
            if user.isRegisteredInConf(self._conf) or self._conf.hasRegistrantByEmail(email):
                if canManageRegistration:
                    raise FormValuesError("There is already a user with the email \"%s\". Please choose another one" % email)
                else:
                    raise FormValuesError("You have already registered with the email address \"%s\". If you need to modify your registration, please contact the managers of the conference." % email)

        rp = registration.Registrant()
        self._conf.addRegistrant(rp, user)
        rp.setValues(self._getRequestParams(), user)

        if user is not None:
            user.addRegistrant(rp)
            rp.setAvatar(user)

        notify_registration_confirmation(self._conf, rp)

        if canManageRegistration and user != self._getUser():
            self._redirect(RHRegistrantListModif._uh.getURL(self._conf))
        else:
            params = {}
            if not rp.doPay() or not payment_event_settings.get(self._conf, 'enabled'):
                flash(_(u"Your registration has been recorded successfully."), 'success')
            if not session.avatar:
                params.update(rp.getLocator(), **{'authkey': rp.getRandomId()})
            else:
                params.update(self._conf.getLocator())
            return redirect(url_for('event.confRegistrationFormDisplay', **params))
Exemple #4
0
    def _process( self ):
        canManageRegistration = self._conf.canManageRegistration(self._getUser())
        if not canManageRegistration and not self._regForm.isActivated():
            p = registrationForm.WPRegFormInactive( self, self._conf )
            return p.display()
        params = self._getRequestParams()
        email = self._regForm.getPersonalData().getValueFromParams(params, 'email')
        if email is None:
            raise FormValuesError(_("An email address has to be set in order to make the registration in the event."))
        elif not validMail(email, False):
            raise FormValuesError(_("The given email address is not valid."))
        matchedUsers = AvatarHolder().match({"email": email}, exact=1)
        if matchedUsers:
            user = matchedUsers[0]
        else:
            user = None
        # Check if the user can register
        if not canManageRegistration: # normal user registering. Managers can.
            if self._conf.getRegistrationForm().isFull():
                self._redirect(urlHandlers.UHConfRegistrationFormDisplay.getURL(self._conf))
                return
            elif not self._conf.getRegistrationForm().inRegistrationPeriod():
                p = registrationForm.WPRegistrationFormClosed(self, self._conf)
                return p.display()
        if user is None:
            if self._conf.hasRegistrantByEmail(email):
                raise FormValuesError("There is already a user with the email \"%s\". Please choose another one"%email)
        else:
            if user.isRegisteredInConf(self._conf):
                self._redirect(urlHandlers.UHConfRegistrationForm.getURL(self._conf))
                return
            if self._conf.hasRegistrantByEmail(email):
                if canManageRegistration:
                    raise FormValuesError("There is already a user with the email \"%s\". Please choose another one"%email)
                else:
                    raise FormValuesError("You have already registered with the email address \"%s\". If you need to modify your registration, please contact the managers of the conference."%email)

        rp = registration.Registrant()
        self._conf.addRegistrant(rp)
        rp.setValues(self._getRequestParams(), user)
        rp.setSessionBillingEnabled(self._regForm.getSessionsForm().getType() != "2priorities")
        if user is not None:
            user.addRegistrant(rp)
            rp.setAvatar(user)
        # avoid multiple sending in case of db conflict
        email = self._regForm.getNotification().createEmailNewRegistrant(self._regForm, rp)
        if email:
            GenericMailer.send(email)
        if not canManageRegistration:
            self._redirect(urlHandlers.UHConfRegistrationFormCreationDone.getURL(rp))
        else:
            self._redirect(RHRegistrantListModif._uh.getURL(self._conf))
Exemple #5
0
 def _process( self ):
     user = self._getUser()
     canManageRegistration = self._conf.canManageRegistration(user)
     if not canManageRegistration and (not self._regForm.isActivated() or not self._conf.hasEnabledSection("regForm")):
         p = registrationForm.WPRegFormInactive( self, self._conf )
         return p.display()
     if user is not None and user.isRegisteredInConf(self._conf):
         if not self._conf.getRegistrationForm().inRegistrationPeriod() and not self._conf.getRegistrationForm().inModificationPeriod():
             p = registrationForm.WPRegistrationFormClosed(self, self._conf)
             return p.display()
         else:
             p = registrationForm.WPRegistrationFormModify(self, self._conf)
             return p.display()
     self._redirect(urlHandlers.UHConfRegistrationForm.getURL(self._conf))
 def _process( self ):
     user = self._getUser()
     canManageRegistration = self._conf.canManageRegistration(user)
     if not canManageRegistration and (not self._regForm.isActivated() or not self._conf.hasEnabledSection("regForm")):
         p = registrationForm.WPRegFormInactive( self, self._conf )
         return p.display()
     params = self._getRequestParams()
     if canManageRegistration:
         matchedUsers = AvatarHolder().match({"email": params["email"]})
         if matchedUsers:
             user = matchedUsers[0]
         else:
             user = None
     else:
         if self._conf.getRegistrationForm().isFull():
             self._redirect(urlHandlers.UHConfRegistrationFormDisplay.getURL(self._conf))
             return
         elif not self._conf.getRegistrationForm().inRegistrationPeriod():
             p = registrationForm.WPRegistrationFormClosed(self, self._conf)
             return p.display()
     if user is None:
         if self._conf.hasRegistrantByEmail(self._getRequestParams().get("email","")):
             raise FormValuesError("There is already a user with the email \"%s\". Please choose another one"%self._getRequestParams().get("email","--no email--")) 
     else:
         if user.isRegisteredInConf(self._conf):
             self._redirect(urlHandlers.UHConfRegistrationForm.getURL(self._conf))
             return
     rp = registration.Registrant()
     self._conf.addRegistrant(rp)
     rp.setValues(self._getRequestParams(), user)
     if user is not None:
         user.addRegistrant(rp)
         rp.setAvatar(user)
     #if not canManageRegistration:
         # avoid multiple sending in case of db conflict
     if not hasattr(self, "_emailsent"):
         self._regForm.getNotification().sendEmailNewRegistrant(self._regForm, rp)
         self._emailSent = True
     if not canManageRegistration:
         self._redirect(urlHandlers.UHConfRegistrationFormCreationDone.getURL(rp))
     else:
         self._redirect(RHRegistrantListModif._uh.getURL(self._conf))
    def _process(self):
        canManageRegistration = self._conf.canManageRegistration(
            self._getUser())
        if not canManageRegistration and not self._regForm.isActivated():
            p = registrationForm.WPRegFormInactive(self, self._conf)
            return p.display()
        params = self._getRequestParams()
        email = self._regForm.getPersonalData().getValueFromParams(
            params, 'email')
        if email is None:
            raise FormValuesError(
                _("An email address has to be set in order to make the registration in the event."
                  ))
        elif not validMail(email, False):
            raise FormValuesError(_("The given email address is not valid."))
        matchedUsers = AvatarHolder().match({"email": email}, exact=1)
        if matchedUsers:
            user = matchedUsers[0]
        else:
            user = None
        # Check if the user can register
        if not canManageRegistration:  # normal user registering. Managers can.
            if self._conf.getRegistrationForm().isFull():
                self._redirect(
                    urlHandlers.UHConfRegistrationFormDisplay.getURL(
                        self._conf))
                return
            elif not self._conf.getRegistrationForm().inRegistrationPeriod():
                p = registrationForm.WPRegistrationFormClosed(self, self._conf)
                return p.display()
        if user is None:
            if self._conf.hasRegistrantByEmail(email):
                raise FormValuesError(
                    "There is already a user with the email \"%s\". Please choose another one"
                    % email)
        else:
            if user.isRegisteredInConf(
                    self._conf) or self._conf.hasRegistrantByEmail(email):
                if canManageRegistration:
                    raise FormValuesError(
                        "There is already a user with the email \"%s\". Please choose another one"
                        % email)
                else:
                    raise FormValuesError(
                        "You have already registered with the email address \"%s\". If you need to modify your registration, please contact the managers of the conference."
                        % email)

        rp = registration.Registrant()
        self._conf.addRegistrant(rp, user)
        rp.setValues(self._getRequestParams(), user)

        if user is not None:
            user.addRegistrant(rp)
            rp.setAvatar(user)

        # This creates the email to the new registrant and SENDS the email to the organizers if necessary... WTF.
        email = self._regForm.getNotification().createEmailNewRegistrant(
            self._regForm, rp)
        if self._regForm.isSendRegEmail() and rp.getEmail().strip():
            modEticket = self._conf.getRegistrationForm().getETicket()

            if modEticket.isEnabled() and modEticket.isAttachedToEmail():
                attachment = {
                    'name': "{0}-Ticket.pdf".format(self._target.getTitle()),
                    'binary': TicketToPDF(self._target, rp).getPDFBin(),
                }
                email["attachments"] = [attachment]
            GenericMailer.send(email)

        if canManageRegistration and user != self._getUser():
            self._redirect(RHRegistrantListModif._uh.getURL(self._conf))
        else:
            self._redirect(
                urlHandlers.UHConfRegistrationFormCreationDone.getURL(rp))
    def _process( self ):
        regForm = self._conf.getRegistrationForm()
        if not regForm.isActivated() or not self._conf.hasEnabledSection("regForm"):
            p = registrationForm.WPRegFormInactive( self, self._conf )
            return p.display()
        else:
            if self._registrant is not None:
                if self._params.get('szIsApproved',"0") != '0':
                    self._registrant.setPayed(True)
                    d={}
                    d["shiptostate"]=self._params.get('shiptostate',"")
                    d["registrantId"]=self._params.get('registrantId',"")
                    d["shiptoname"]=self._params.get('shiptoname',"")
                    d["streetaddress"]=self._params.get('streetaddress',"")
                    d["szTransactionFileName"]=self._params.get('szTransactionFileName',"")
                    d["month"]=self._params.get('month',"")
                    d["year"]=self._params.get('year',"")
                    d["szAuthorizationResponseCode"]=self._params.get('szAuthorizationResponseCode',"")
                    d["streetaddress2"]=self._params.get('streetaddress2',"")
                    d["szOrderNumber"]=self._params.get('szOrderNumber',"")
                    d["accountnumber"]=self._params.get('accountnumber',"")
                    d["zipcode"]=self._params.get('zipcode',"")
                    d["szAVSResponseCode"]=self._params.get('szAVSResponseCode',"")
                    d["szCVV2ResponseCode"]=self._params.get('szCVV2ResponseCode',"")
                    d["Phone"]=self._params.get('Phone',"")
                    d["state"]=self._params.get('state',"")
                    d["shiptostreetaddress2"]=self._params.get('shiptostreetaddress2',"")
                    d["shiptozipcode"]=self._params.get('shiptozipcode',"")
                    d["transactionamount"]=self._params.get('transactionamount',"")
                    d["sjname"]=self._params.get('sjname',"")
                    d["szCVV2ResponseMessage"]=self._params.get('szCVV2ResponseMessage',"")
                    d["shiptocity"]=self._params.get('shiptocity',"")
                    d["orderstring"]=self._params.get('orderstring',"")
                    d["szAVSResponseMessage"]=self._params.get('szAVSResponseMessage',"")
                    d["szCAVVResponseCode"]=self._params.get('szCAVVResponseCode',"")
                    d["shiptophone"]=self._params.get('shiptophone',"")
                    d["country"]=self._params.get('country',"")
                    d["shiptostreetaddress"]=self._params.get('shiptostreetaddress',"")
                    d["szTransactionAmount"]=self._params.get('szTransactionAmount',"")
                    d["email"]=self._params.get('email',"")
                    d["city"]=self._params.get('city',"")
                    d["requestTag"]=self._params.get('requestTag',"")

                    tr=ePayment.TransactionSkipjack(d)

                    self._registrant.setTransactionInfo(tr)
                    self._regForm.getNotification().sendEmailNewRegistrantConfirmPay(self._regForm,self._registrant)

                    p = ePayments.WPEPaymentSkipjackAccepted(self, self._conf, self._registrant )
                    return p.display()
                else:
                    d={}
                    d["shiptostate"]=self._params.get('shiptostate',"")
                    d["registrantId"]=self._params.get('registrantId',"")
                    d["shiptoname"]=self._params.get('shiptoname',"")
                    d["szAuthorizationDeclinedMessage"]=self._params.get('szAuthorizationDeclinedMessage',"")
                    d["streetaddress"]=self._params.get('streetaddress',"")
                    d["szTransactionFileName"]=self._params.get('szTransactionFileName',"")
                    d["year"]=self._params.get('year',"")
                    d["szAuthorizationResponseCode"]=self._params.get('szAuthorizationResponseCode',"")
                    d["streetaddress2"]=self._params.get('streetaddress2',"")
                    d["szOrderNumber"]=self._params.get('szOrderNumber',"")
                    d["accountnumber"]=self._params.get('accountnumber',"")
                    d["zipcode"]=self._params.get('zipcode',"")
                    d["szAVSResponseCode"]=self._params.get('szAVSResponseCode',"")
                    d["szCVV2ResponseCode"]=self._params.get('szCVV2ResponseCode',"")
                    d["Phone"]=self._params.get('Phone',"")
                    d["state"]=self._params.get('state',"")
                    d["shiptostreetaddress2"]=self._params.get('shiptostreetaddress2',"")
                    d["shiptozipcode"]=self._params.get('shiptozipcode',"")
                    d["transactionamount"]=self._params.get('transactionamount',"")
                    d["sjname"]=self._params.get('sjname',"")
                    d["szCVV2ResponseMessage"]=self._params.get('szCVV2ResponseMessage',"")
                    d["shiptocity"]=self._params.get('shiptocity',"")
                    d["orderstring"]=self._params.get('orderstring',"")
                    d["szAVSResponseMessage"]=self._params.get('szAVSResponseMessage',"")
                    d["szCAVVResponseCode"]=self._params.get('szCAVVResponseCode',"")
                    d["shiptophone"]=self._params.get('shiptophone',"")
                    d["month"]=self._params.get('month',"")
                    d["country"]=self._params.get('country',"")
                    d["shiptostreetaddress"]=self._params.get('shiptostreetaddress',"")
                    d["szTransactionAmount"]=self._params.get('szTransactionAmount',"")
                    d["email"]=self._params.get('email',"")
                    d["city"]=self._params.get('city',"")
                    d["requestTag"]=self._params.get('requestTag',"")
                    p = ePayments.WPEPaymentSkipjackCancelled(self, self._conf, self._registrant, d["szAuthorizationDeclinedMessage"])
                    return p.display()