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

(-)a/services/univention-ad-connector/modules/univention/connector/__init__.py (-9 / +12 lines)
 Lines 320-326   class configsaver: Link Here 
320
320
321
class attribute:
321
class attribute:
322
322
323
	def __init__(self, ucs_attribute='', ldap_attribute='', con_attribute='', con_other_attribute='', required=0, compare_function='', con_value_map_function='', ucs_value_map_function='', mapping=(), reverse_attribute_check=False):
323
	def __init__(self, ucs_attribute='', ldap_attribute='', con_attribute='', con_other_attribute='', required=0, compare_function='', con_value_map_function='', ucs_value_map_function='', mapping=(), reverse_attribute_check=False, sync_mode='sync'):
324
		self.ucs_attribute = ucs_attribute
324
		self.ucs_attribute = ucs_attribute
325
		self.ldap_attribute = ldap_attribute
325
		self.ldap_attribute = ldap_attribute
326
		self.con_attribute = con_attribute
326
		self.con_attribute = con_attribute
 Lines 339-344   class attribute: Link Here 
339
		# Seee https://forge.univention.org/bugzilla/show_bug.cgi?id=25823
339
		# Seee https://forge.univention.org/bugzilla/show_bug.cgi?id=25823
340
		self.reverse_attribute_check = reverse_attribute_check
340
		self.reverse_attribute_check = reverse_attribute_check
341
341
342
		self.sync_mode = sync_mode
343
342
344
343
class property:
345
class property:
344
346
 Lines 1096-1102   class ucs: Link Here 
1096
							ud.debug(ud.LDAP, ud.WARN, '__set_values: The attributes for %s have not been removed as it represents a mandatory attribute' % ucs_key)
1098
							ud.debug(ud.LDAP, ud.WARN, '__set_values: The attributes for %s have not been removed as it represents a mandatory attribute' % ucs_key)
1097
1099
1098
		for attr_key in self.property[property_type].attributes.keys():
1100
		for attr_key in self.property[property_type].attributes.keys():
1099
			set_values(self.property[property_type].attributes[attr_key])
1101
			if self.property[property_type].attributes[attr_key].sync_mode in ['read', 'sync']:
1102
				set_values(self.property[property_type].attributes[attr_key])
1100
1103
1101
		# post-values
1104
		# post-values
1102
		if not self.property[property_type].post_attributes:
1105
		if not self.property[property_type].post_attributes:
 Lines 1106-1118   class ucs: Link Here 
1106
			if hasattr(self.property[property_type].post_attributes[attr_key], 'mapping'):
1109
			if hasattr(self.property[property_type].post_attributes[attr_key], 'mapping'):
1107
				set_values(self.property[property_type].post_attributes[attr_key].mapping[1](self, property_type, object))
1110
				set_values(self.property[property_type].post_attributes[attr_key].mapping[1](self, property_type, object))
1108
			else:
1111
			else:
1109
				if self.property[property_type].post_attributes[attr_key].reverse_attribute_check:
1112
				if self.property[property_type].post_attributes[attr_key].sync_mode in ['read', 'sync']:
1110
					if object['attributes'].get(self.property[property_type].post_attributes[attr_key].ldap_attribute):
1113
					if self.property[property_type].post_attributes[attr_key].reverse_attribute_check:
1111
						set_values(self.property[property_type].post_attributes[attr_key])
1114
						if object['attributes'].get(self.property[property_type].post_attributes[attr_key].ldap_attribute):
1115
							set_values(self.property[property_type].post_attributes[attr_key])
1116
						else:
1117
							ucs_object[self.property[property_type].post_attributes[attr_key].ucs_attribute] = ''
1112
					else:
1118
					else:
1113
						ucs_object[self.property[property_type].post_attributes[attr_key].ucs_attribute] = ''
1119
						set_values(self.property[property_type].post_attributes[attr_key])
1114
				else:
1115
					set_values(self.property[property_type].post_attributes[attr_key])
1116
1120
1117
	def __modify_custom_attributes(self, property_type, object, ucs_object, module, position, modtype="modify"):
1121
	def __modify_custom_attributes(self, property_type, object, ucs_object, module, position, modtype="modify"):
1118
		if 'custom_attributes' in object:
1122
		if 'custom_attributes' in object:
1119
- 

Return to bug 42618