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

Collapse All | Expand All

(-)management/univention-directory-manager-modules/modules/univention/admin/de.po (+3 lines)
 Lines 1675-1680   msgstr "" Link Here 
1675
"Ziffer oder einem Buchstaben beginnen und enden, und darf nicht \"admin\" "
1675
"Ziffer oder einem Buchstaben beginnen und enden, und darf nicht \"admin\" "
1676
"sein."
1676
"sein."
1677
1677
1678
msgid "Value out of bounds (%d - %d seconds)"
1679
msgstr "Wert außerhalb des erlaubten Bereichs (%d - %d Sekunden)."
1680
1678
#: modules/univention/admin/uexceptions.py:84
1681
#: modules/univention/admin/uexceptions.py:84
1679
msgid "Values do not match."
1682
msgid "Values do not match."
1680
msgstr "Die Werte sind nicht gleich."
1683
msgstr "Die Werte sind nicht gleich."
(-)management/univention-directory-manager-modules/modules/univention/admin/handlers/settings/sambadomain.py (-2 / +2 lines)
 Lines 145-151   property_descriptions={ Link Here 
145
	'minPasswordAge': univention.admin.property(
145
	'minPasswordAge': univention.admin.property(
146
			short_description=_('Minimum password age'),
146
			short_description=_('Minimum password age'),
147
			long_description='',
147
			long_description='',
148
			syntax=univention.admin.syntax.UNIX_TimeInterval,
148
			syntax=univention.admin.syntax.SambaMinPwdAge,
149
			multivalue=0,
149
			multivalue=0,
150
			options=[],
150
			options=[],
151
			required=0,
151
			required=0,
 Lines 175-181   property_descriptions={ Link Here 
175
	'maxPasswordAge': univention.admin.property(
175
	'maxPasswordAge': univention.admin.property(
176
			short_description=_('Maximum password age'),
176
			short_description=_('Maximum password age'),
177
			long_description='',
177
			long_description='',
178
			syntax=univention.admin.syntax.UNIX_TimeInterval,
178
			syntax=univention.admin.syntax.SambaMaxPwdAge,
179
			multivalue=0,
179
			multivalue=0,
180
			options=[],
180
			options=[],
181
			required=0,
181
			required=0,
(-)management/univention-directory-manager-modules/modules/univention/admin/syntax.py (+38 lines)
 Lines 1331-1336   class UNIX_TimeInterval( complex ): Link Here 
1331
	subsyntaxes = ( ( '', integer ), ( '', TimeUnits ) )
1331
	subsyntaxes = ( ( '', integer ), ( '', TimeUnits ) )
1332
	size = ( 'Half', 'Half' )
1332
	size = ( 'Half', 'Half' )
1333
1333
1334
	@classmethod
1335
	def parse(cls, texts):
1336
		return super(UNIX_TimeInterval, cls).parse(texts)
1337
1338
class UNIX_BoundedTimeInterval( UNIX_TimeInterval ):
1339
	lower_bound = -1 # in seconds, -1 unbounded
1340
	upper_bound = -1 # in seconds, -1 unbounded
1341
	error_message = _ ("Value out of bounds (%d - %d seconds)")
1342
1343
	@classmethod
1344
	def parse(cls, texts):
1345
		parsed = super(UNIX_BoundedTimeInterval, cls).parse(texts)
1346
1347
		in_seconds = int(parsed[0])
1348
		if len(parsed) > 1:
1349
			in_seconds = {
1350
				'seconds': lambda x: x,
1351
				'minutes': lambda x: x * 60,
1352
				'hours': lambda x: x * 60 * 60,
1353
				'days': lambda x: x * 24 * 60 * 60,
1354
			}[parsed[1]](in_seconds)
1355
1356
		msg = cls.error_message % (cls.lower_bound, cls.upper_bound)
1357
		if cls.lower_bound != -1 and in_seconds < cls.lower_bound:
1358
			raise univention.admin.uexceptions.valueError(msg)
1359
		if cls.upper_bound != -1 and in_seconds > cls.upper_bound:
1360
			raise univention.admin.uexceptions.valueError(msg)
1361
1362
		return parsed
1363
1364
class SambaMinPwdAge( UNIX_BoundedTimeInterval ):
1365
	lower_bound = 0
1366
	upper_bound = 998 * 24 * 60 * 60 # 998 days in seconds
1367
1368
class SambaMaxPwdAge( UNIX_BoundedTimeInterval ):
1369
	lower_bound = 0
1370
	upper_bound = 999 * 24 * 60 * 60 # 999 days in seconds
1371
1334
class NetworkType( select ):
1372
class NetworkType( select ):
1335
	choices = ( ( 'ethernet', _( 'Ethernet' ) ), ( 'fddi', _( 'FDDI' ) ), ( 'token-ring', _( 'Token-Ring' ) ) )
1373
	choices = ( ( 'ethernet', _( 'Ethernet' ) ), ( 'fddi', _( 'FDDI' ) ), ( 'token-ring', _( 'Token-Ring' ) ) )
1336
1374

Return to bug 41865