Beispiel #1
0
    def invoke(self, _clerk, _user, domain, rectype, value, priority=0, ID=None):
        try:
            dom = safety.safeDomain(_user, domain)
            if ID:
                rec = safety.safeDNSRec(dom, ID)
            else:
                rec = DNSRec()
            
            if rec.domain is not dom:
                dom.dnsrecs << rec

            rec.rectype = rectype
            rec.priority = priority # field might be disabled
            rec.value = value
            
            #@TODO: this is kludgy, but i can't put this in set_value
            # ...unless I split DNSRec into two classes...
            # ALSO, these should generally have a "." at the end!!
            from cornerhost.schema.Domain import reDomain
            if rectype=="MX" and not reDomain.match(rec.value):
                raise ValueError('value',rec.value)
            _clerk.store(rec)
            
        except (ValueError, TypeError), e:
            raise Intercept(e)
Beispiel #2
0
    def invoke(self,
               _clerk,
               _user,
               domain,
               rectype,
               value,
               priority=0,
               ID=None):
        try:
            dom = safety.safeDomain(_user, domain)
            if ID:
                rec = safety.safeDNSRec(dom, ID)
            else:
                rec = DNSRec()

            if rec.domain is not dom:
                dom.dnsrecs << rec

            rec.rectype = rectype
            rec.priority = priority  # field might be disabled
            rec.value = value

            #@TODO: this is kludgy, but i can't put this in set_value
            # ...unless I split DNSRec into two classes...
            # ALSO, these should generally have a "." at the end!!
            from cornerhost.schema.Domain import reDomain
            if rectype == "MX" and not reDomain.match(rec.value):
                raise ValueError('value', rec.value)
            _clerk.store(rec)

        except (ValueError, TypeError), e:
            raise Intercept(e)
Beispiel #3
0
 def invoke(self, _clerk, _user, domain_in, ID):
     rec = safety.safeDNSRec(safety.safeDomain(_user, domain_in), ID)
     _clerk.delete(DNSRec, rec.ID)
Beispiel #4
0
 def invoke(self, _clerk, _user, domain_in, ID):
     rec = safety.safeDNSRec(safety.safeDomain(_user, domain_in), ID)
     _clerk.delete(DNSRec, rec.ID)