|
1027 |
return text |
1027 |
return text |
1028 |
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\"") |
1028 |
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\"") |
1029 |
|
1029 |
|
|
|
1030 |
class dnsZone(simple): |
1031 |
_re = re.compile(r'^[a-zA-Z](:?(:?[a-zA-Z0-9-]{0,63})*\.?)*[a-zA-Z0-9]$') |
1032 |
|
1033 |
@classmethod |
1034 |
def parse(self, text): |
1035 |
if text is None: |
1036 |
raise univention.admin.uexceptions.valueError(_("Missing value!")) |
1037 |
if len(text) >= 255: |
1038 |
raise univention.admin.uexceptions.valueError(_("Value may not be longer than 255 chars!")) |
1039 |
if self._re.match(text) is not None: |
1040 |
return text |
1041 |
elif max(map(len, text.split('.'))) >= 63: |
1042 |
raise univention.admin.uexceptions.valueError(_("Value may not longer than 63 chars between dots!")) |
1043 |
|
1044 |
raise univention.admin.uexceptions.valueError(_("Value may not contain other than numbers, letters and dots and may not end with a dot!")) |
1045 |
|
1030 |
class dnsName(simple): |
1046 |
class dnsName(simple): |
1031 |
_re = re.compile('^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9.]$') |
1047 |
_re = re.compile('^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9.]$') |
1032 |
|
1048 |
|