示例#1
0
文件: validation.py 项目: mcdonc/ptah
    def update(self):
        super(ValidationTemplate, self).update()

        self.url = '%s/validateaccount.html?token=%s'%(
            self.request.application_url, self.token)

        principal = self.context
        self.to_address = mail.formataddr((principal.name, self.email))
示例#2
0
    def update(self):
        super(ResetPasswordTemplate, self).update()

        request = self.request

        self.date = datetime.now()

        remoteAddr = request.get("REMOTE_ADDR", "")
        forwardedFor = request.get("HTTP_X_FORWARDED_FOR", None)

        self.from_ip = forwardedFor and "%s/%s" % (remoteAddr, forwardedFor) or remoteAddr

        self.url = "%s/resetpasswordform.html?passcode=%s" % (request.application_url, self.passcode)

        info = self.context

        self.to_address = mail.formataddr((info.name, info.login))
示例#3
0
    def update(self):
        super(ResetPasswordTemplate, self).update()

        request = self.request

        self.date = datetime.now()

        remoteAddr = request.get('REMOTE_ADDR', '')
        forwardedFor = request.get('HTTP_X_FORWARDED_FOR', None)

        self.from_ip = (forwardedFor and '%s/%s' %
                        (remoteAddr, forwardedFor) or remoteAddr)

        self.url = '%s/resetpassword.html/%s/'%(
            request.application_url, self.passcode)

        info = self.context

        self.to_address = mail.formataddr((info.name, info.login))