View | Details | Raw Unified | Return to bug 50347
Collapse All | Expand All

(-)a/services/univention-s4-connector/modules/univention/s4connector/__init__.py (-10 / +12 lines)
 Lines 1158-1168   class ucs: Link Here 
1158
					value = object['attributes'][attributes.ldap_attribute]
1158
					value = object['attributes'][attributes.ldap_attribute]
1159
					ud.debug(ud.LDAP, ud.INFO, '__set_values: set attribute, ucs_key: %s - value: %s' % (ucs_key, value))
1159
					ud.debug(ud.LDAP, ud.INFO, '__set_values: set attribute, ucs_key: %s - value: %s' % (ucs_key, value))
1160
1160
1161
					ucs_module = self.modules[property_type]
1162
					position = univention.admin.uldap.position(self.lo.base)
1163
					position.setDn(object['dn'])
1164
					univention.admin.modules.init(self.lo, position, ucs_module)
1165
1166
					if isinstance(value, type(types.ListType())) and len(value) == 1:
1161
					if isinstance(value, type(types.ListType())) and len(value) == 1:
1167
						value = value[0]
1162
						value = value[0]
1168
1163
 Lines 1200-1210   class ucs: Link Here 
1200
1195
1201
				ucs_key = attributes.ucs_attribute
1196
				ucs_key = attributes.ucs_attribute
1202
				if ucs_object.has_property(ucs_key):
1197
				if ucs_object.has_property(ucs_key):
1203
					ucs_module = self.modules[property_type]
1204
					position = univention.admin.uldap.position(self.lo.base)
1205
					position.setDn(object['dn'])
1206
					univention.admin.modules.init(self.lo, position, ucs_module)
1207
1208
					# Special handling for con other attributes, see Bug #20599
1198
					# Special handling for con other attributes, see Bug #20599
1209
					if attributes.con_other_attribute:
1199
					if attributes.con_other_attribute:
1210
						if object['attributes'].get(attributes.con_other_attribute):
1200
						if object['attributes'].get(attributes.con_other_attribute):
 Lines 1259-1264   class ucs: Link Here 
1259
1249
1260
	def add_in_ucs(self, property_type, object, module, position):
1250
	def add_in_ucs(self, property_type, object, module, position):
1261
		_d = ud.function('ldap.add_in_ucs')  # noqa: F841
1251
		_d = ud.function('ldap.add_in_ucs')  # noqa: F841
1252
1253
		# reload extended attributes  # FIXME: maybe not necessary
1254
		ucs_module = self.modules[property_type]
1255
		position = univention.admin.uldap.position(self.lo.base)
1256
		univention.admin.modules.init(self.lo, position, ucs_module)
1257
1262
		ucs_object = module.object(None, self.lo, position=position)
1258
		ucs_object = module.object(None, self.lo, position=position)
1263
		if property_type == 'group':
1259
		if property_type == 'group':
1264
			ucs_object.open()
1260
			ucs_object.open()
 Lines 1266-1271   class ucs: Link Here 
1266
			self.group_members_cache_ucs[object['dn'].lower()] = []
1262
			self.group_members_cache_ucs[object['dn'].lower()] = []
1267
		else:
1263
		else:
1268
			ucs_object.open()
1264
			ucs_object.open()
1265
1269
		self.__set_values(property_type, object, ucs_object, modtype='add')
1266
		self.__set_values(property_type, object, ucs_object, modtype='add')
1270
		for function in self.property[property_type].ucs_create_functions:
1267
		for function in self.property[property_type].ucs_create_functions:
1271
			function(self, property_type, ucs_object)
1268
			function(self, property_type, ucs_object)
 Lines 1287-1292   class ucs: Link Here 
1287
	def modify_in_ucs(self, property_type, object, module, position):
1284
	def modify_in_ucs(self, property_type, object, module, position):
1288
		_d = ud.function('ldap.modify_in_ucs')  # noqa: F841
1285
		_d = ud.function('ldap.modify_in_ucs')  # noqa: F841
1289
1286
1287
		# reload extended attributes  # FIXME: maybe not necessary
1288
		ucs_module = self.modules[property_type]
1289
		position = univention.admin.uldap.position(self.lo.base)
1290
		univention.admin.modules.init(self.lo, position, ucs_module)
1291
1290
		ucs_object_dn = object.get('olddn', object['dn'])
1292
		ucs_object_dn = object.get('olddn', object['dn'])
1291
		ucs_object = univention.admin.objects.get(module, None, self.lo, dn=ucs_object_dn, position='')
1293
		ucs_object = univention.admin.objects.get(module, None, self.lo, dn=ucs_object_dn, position='')
1292
		self.__set_values(property_type, object, ucs_object)
1294
		self.__set_values(property_type, object, ucs_object)

Return to bug 50347