diff -ur admin.o/handlers/dns/forward_zone.py admin/handlers/dns/forward_zone.py --- admin.o/handlers/dns/forward_zone.py 2011-10-13 10:12:44.000000000 +0200 +++ admin/handlers/dns/forward_zone.py 2011-10-13 10:13:31.000000000 +0200 @@ -54,7 +54,7 @@ 'zone': univention.admin.property( short_description=_('Zone name'), long_description='', - syntax=univention.admin.syntax.string, + syntax=univention.admin.syntax.dnsZone, multivalue=0, options=[], required=1, diff -ur admin.o/syntax.py admin/syntax.py --- admin.o/syntax.py 2011-10-13 10:12:44.000000000 +0200 +++ admin/syntax.py 2011-10-13 10:15:47.000000000 +0200 @@ -937,6 +937,21 @@ return text 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\"") +class dnsZone(simple): + name='dnsZone' + _re = re.compile(r'^[a-zA-Z](:?(:?[a-zA-Z0-9-]{0,63})*\.?)*[a-zA-Z0-9]$') + + def parse(self, text): + if text is None: + raise univention.admin.uexceptions.valueError(_("Missing value!")) + if len(text) >= 255: + raise univention.admin.uexceptions.valueError(_("Value may not be longer than 255 chars!")) + if self._re.match(text) is not None: + return text + elif max(map(len, text.split('.'))) >= 63: + raise univention.admin.uexceptions.valueError(_("Value may not longer than 63 chars between dots!")) + raise univention.admin.uexceptions.valueError(_("Value may not contain other than numbers, letters and dots and may not end with a dot!")) + class dnsName(simple): name='dnsName' _re = re.compile('^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9.]$')