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

Collapse All | Expand All

(-)umc/python/udm/udm_ldap.py (-17 / +25 lines)
 Lines 1065-1096    Link Here 
1065
1065
1066
	if issubclass( syn.__class__, udm_syntax.UDM_Objects ):
1066
	if issubclass( syn.__class__, udm_syntax.UDM_Objects ):
1067
		syn.choices = []
1067
		syn.choices = []
1068
		def extract_key_label(syn, dn, info):
1069
			key = label = None
1070
			if syn.key == 'dn':
1071
				key = dn
1072
			else:
1073
				try:
1074
					key = syn.key % info
1075
				except KeyError:
1076
					pass
1077
			if syn.label == 'dn':
1078
				label = dn
1079
			elif syn.label is None:
1080
				pass
1081
			else:
1082
				try:
1083
					label = syn.label % info
1084
				except KeyError:
1085
					pass
1086
			return key, label
1068
		def map_choices( obj_list ):
1087
		def map_choices( obj_list ):
1069
			result = []
1088
			result = []
1070
			for obj in obj_list:
1089
			for obj in obj_list:
1071
				obj.open()
1090
				key, label = extract_key_label(syn, obj.dn, obj.info)
1072
1091
				if key is None or label is None:
1073
				if syn.key == 'dn':
1092
					obj.open()
1074
					key = obj.dn
1093
					key, label = extract_key_label(syn, obj.dn, obj.info)
1075
				else:
1094
					if key is None:
1076
					try:
1077
						key = syn.key % obj.info
1078
					except KeyError:
1079
						# ignore the entry as the key is important for a selection, there
1095
						# ignore the entry as the key is important for a selection, there
1080
						# is no sensible fallback for the key (Bug #26994)
1096
						# is no sensible fallback for the key (Bug #26994)
1081
						continue
1097
						continue
1082
				if syn.label is None:
1098
					if label is None:
1083
					label = udm_objects.description( obj )
1084
				elif syn.label == 'dn':
1085
					label = obj.dn
1086
				else:
1087
					try:
1088
						label = syn.label % obj.info
1089
					except KeyError:
1090
						# fallback to the default description as this is just what displayed
1099
						# fallback to the default description as this is just what displayed
1091
						# to the user (Bug #26994)
1100
						# to the user (Bug #26994)
1092
						label = udm_objects.description( obj )
1101
						label = udm_objects.description( obj )
1093
1094
				result.append( (key, label) )
1102
				result.append( (key, label) )
1095
			return result
1103
			return result
1096
1104
(-)modules/univention/admin/handlers/shares/share.py (-1 / +4 lines)
 Lines 827-832    Link Here 
827
			if 'univentionShareNFS' in self.oldattr['objectClass']:
827
			if 'univentionShareNFS' in self.oldattr['objectClass']:
828
				self.options.append( 'nfs' )
828
				self.options.append( 'nfs' )
829
			try:
829
			try:
830
				# ATTENTION: syntax nfsShare wants to use
831
				#   %(printablename)s as label but we changed that because
832
				#   of lookup performance reasons. If you change printablename
833
				#   here, you probably want to change the label of the syntax, too.
830
				self['printablename'] = "%s (%s)" % (self['name'], self['host'])
834
				self['printablename'] = "%s (%s)" % (self['name'], self['host'])
831
			except:
835
			except:
832
				pass
836
				pass
 Lines 900-906    Link Here 
900
		if not hasattr(self,"options"):
904
		if not hasattr(self,"options"):
901
			self.open()
905
			self.open()
902
		if 'nfs' in self.options:
906
		if 'nfs' in self.options:
903
			ulist=[]
904
			searchstring="*"+self['host']+":"+self['path']+"*"
907
			searchstring="*"+self['host']+":"+self['path']+"*"
905
			searchResult=self.lo.searchDn(base=self.position.getDomain(), filter='(&(objectClass=person)(automountInformation=%s))'%searchstring, scope='domain')
908
			searchResult=self.lo.searchDn(base=self.position.getDomain(), filter='(&(objectClass=person)(automountInformation=%s))'%searchstring, scope='domain')
906
			if searchResult:
909
			if searchResult:
(-)modules/univention/admin/de.po (+4 lines)
 Lines 221-226    Link Here 
221
msgid "cannot find fqdn of "
221
msgid "cannot find fqdn of "
222
msgstr "FQDN konnte nicht gefunden werden: "
222
msgstr "FQDN konnte nicht gefunden werden: "
223
223
224
#: syntax.py:1743
225
msgid "%(name)s (%(path)s on %(host)s)"
226
msgstr "%(name)s (%(path)s auf %(host)s)"
227
224
#: syntax.py:109 syntax.py:162 syntax.py:298
228
#: syntax.py:109 syntax.py:162 syntax.py:298
225
msgid "Invalid value"
229
msgid "Invalid value"
226
msgstr "Ungültiger Wert"
230
msgstr "Ungültiger Wert"
(-)modules/univention/admin/syntax.py (-1 / +6 lines)
 Lines 1603-1611    Link Here 
1603
1603
1604
class GroupDN( UDM_Objects ):
1604
class GroupDN( UDM_Objects ):
1605
	udm_modules = ( 'groups/group', )
1605
	udm_modules = ( 'groups/group', )
1606
	label = '%(name)s' # TODO: may be removed when UDM_Objects is able to extract from DN without initializing object
1606
1607
1607
class UserDN( UDM_Objects ):
1608
class UserDN( UDM_Objects ):
1608
	udm_modules = ( 'users/user', )
1609
	udm_modules = ( 'users/user', )
1610
	label = '%(username)s' # TODO: may be removed when UDM_Objects is able to extract from DN without initializing object
1609
1611
1610
class HostDN( UDM_Objects ):
1612
class HostDN( UDM_Objects ):
1611
	udm_modules = ( 'computers/computer', )
1613
	udm_modules = ( 'computers/computer', )
 Lines 1687-1698    Link Here 
1687
class DNS_ForwardZone( UDM_Objects ):
1689
class DNS_ForwardZone( UDM_Objects ):
1688
 	description=_('DNS forward zone')
1690
 	description=_('DNS forward zone')
1689
	udm_modules = ( 'dns/forward_zone', )
1691
	udm_modules = ( 'dns/forward_zone', )
1692
	label = '%(zone)s'
1690
	empty_value = True
1693
	empty_value = True
1691
	size = 'TwoThirds'
1694
	size = 'TwoThirds'
1692
1695
1693
class DNS_ReverseZone( UDM_Objects ):
1696
class DNS_ReverseZone( UDM_Objects ):
1694
 	description=_('DNS reverse zone')
1697
 	description=_('DNS reverse zone')
1695
	udm_modules = ( 'dns/reverse_zone', )
1698
	udm_modules = ( 'dns/reverse_zone', )
1699
	label = '%(subnet)s'
1696
	empty_value = True
1700
	empty_value = True
1697
	size = 'TwoThirds'
1701
	size = 'TwoThirds'
1698
1702
 Lines 1736-1741    Link Here 
1736
class WritableShare( UDM_Objects ):
1740
class WritableShare( UDM_Objects ):
1737
	udm_modules = ( 'shares/share', )
1741
	udm_modules = ( 'shares/share', )
1738
	udm_filter = 'writeable=1'
1742
	udm_filter = 'writeable=1'
1743
	label = _('%(name)s (%(path)s on %(host)s)') # ldap-optimized for shares/share.description()
1739
	size = 'OneAndAHalf'
1744
	size = 'OneAndAHalf'
1740
	empty_value = True
1745
	empty_value = True
1741
1746
 Lines 2551-2557    Link Here 
2551
class nfsShare(UDM_Objects):
2556
class nfsShare(UDM_Objects):
2552
	udm_modules = ( 'shares/share', )
2557
	udm_modules = ( 'shares/share', )
2553
	key = 'dn'
2558
	key = 'dn'
2554
	label = '%(printablename)s'
2559
	label = '%(name)s (%(host)s)' # ldap-optimized for '%(printablename)s'
2555
	udm_filter = 'objectClass=univentionShareNFS'
2560
	udm_filter = 'objectClass=univentionShareNFS'
2556
2561
2557
class nfsMounts(complex):
2562
class nfsMounts(complex):

Return to bug 30991