|
937 |
return text |
937 |
return text |
938 |
raise univention.admin.uexceptions.valueError,_("The name of a reverse zone consists of the reversed subnet address followed by .in-addr.arpa. Example: \"0.168.192.in-addr.arpa\"") |
938 |
raise univention.admin.uexceptions.valueError,_("The name of a reverse zone consists of the reversed subnet address followed by .in-addr.arpa. Example: \"0.168.192.in-addr.arpa\"") |
939 |
|
939 |
|
|
|
940 |
class dnsZone(simple): |
941 |
name='dnsZone' |
942 |
_re = re.compile(r'^[a-zA-Z](:?(:?[a-zA-Z0-9-]{0,63})*\.?)*[a-zA-Z0-9]$') |
943 |
|
944 |
def parse(self, text): |
945 |
if text is None: |
946 |
raise univention.admin.uexceptions.valueError(_("Missing value!")) |
947 |
if len(text) >= 255: |
948 |
raise univention.admin.uexceptions.valueError(_("Value may not be longer than 255 chars!")) |
949 |
if self._re.match(text) is not None: |
950 |
return text |
951 |
elif max(map(len, text.split('.'))) >= 63: |
952 |
raise univention.admin.uexceptions.valueError(_("Value may not longer than 63 chars between dots!")) |
953 |
raise univention.admin.uexceptions.valueError(_("Value may not contain other than numbers, letters and dots and may not end with a dot!")) |
954 |
|
940 |
class dnsName(simple): |
955 |
class dnsName(simple): |
941 |
name='dnsName' |
956 |
name='dnsName' |
942 |
_re = re.compile('^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9.]$') |
957 |
_re = re.compile('^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9.]$') |