|
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 |
|
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 |
|
|
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: |
|
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 |
- |
|
|