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 58-64    Link Here 
58
	'zone': univention.admin.property(
58
	'zone': univention.admin.property(
59
			short_description=_('Zone name'),
59
			short_description=_('Zone name'),
60
			long_description='',
60
			long_description='',
61
			syntax=univention.admin.syntax.string,
61
			syntax=univention.admin.syntax.dnsZone,
62
			multivalue=0,
62
			multivalue=0,
63
			options=[],
63
			options=[],
64
			required=1,
64
			required=1,
(-)admin.o//syntax.py (+16 lines)
 Lines 1027-1032    Link Here 
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

Return to bug 19557