View | Details | Raw Unified | Return to bug 19557 | Differences between
and this patch

Collapse All | Expand All

(-)admin.o/handlers/dns/forward_zone.py (-1 / +1 lines)
 Lines 54-60    Link Here 
54
	'zone': univention.admin.property(
54
	'zone': univention.admin.property(
55
			short_description=_('Zone name'),
55
			short_description=_('Zone name'),
56
			long_description='',
56
			long_description='',
57
			syntax=univention.admin.syntax.string,
57
			syntax=univention.admin.syntax.dnsZone,
58
			multivalue=0,
58
			multivalue=0,
59
			options=[],
59
			options=[],
60
			required=1,
60
			required=1,
(-)admin.o/syntax.py (+15 lines)
 Lines 937-942    Link Here 
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.]$')

Return to bug 19557