Lines 353-364
def samaccountname_dn_mapping(s4connector, given_object, dn_mapping_stored, ucso
|
Link Here
|
---|
|
353 |
newdn = unicode(result[0][0], 'utf8') |
353 |
newdn = unicode(result[0][0], 'utf8') |
354 |
else: |
354 |
else: |
355 |
s4_rdn = ldap.dn.str2dn(result[0][0])[0] |
355 |
s4_rdn = ldap.dn.str2dn(result[0][0])[0] |
356 |
new_s4_dn = unicode(ldap.dn.dn2str([s4_rdn] + exploded_dn[1:]), 'utf8') |
356 |
tmp_dn_string = unicode(ldap.dn.dn2str([s4_rdn] + exploded_dn[1:]), 'utf8') |
357 |
pos = new_s4_dn.lower().rfind(s4connector.lo_s4.base.lower()) |
357 |
pos = tmp_dn_string.lower().rfind(s4connector.lo.base.lower()) |
358 |
newdn = new_s4_dn[:pos] + s4connector.lo.base |
358 |
newdn = tmp_dn_string[:pos] + s4connector.lo_s4.base |
359 |
else: |
359 |
else: |
360 |
newdn_rdn = [('cn', fst_rdn_value_utf8, ldap.AVA_STRING)] |
360 |
newdn_rdn = [('cn', fst_rdn_value_utf8, ldap.AVA_STRING)] |
361 |
newdn = unicode(ldap.dn.dn2str([newdn_rdn] + exploded_dn[1:]), 'utf8') # new object, don't need to change |
361 |
tmp_dn_string = unicode(ldap.dn.dn2str([newdn_rdn] + exploded_dn[1:]), 'utf8') # new object, don't need to change |
|
|
362 |
pos = tmp_dn_string.lower().rfind(s4connector.lo.base.lower()) |
363 |
newdn = tmp_dn_string[:pos] + s4connector.lo_s4.base |
362 |
ud.debug(ud.LDAP, ud.INFO, "samaccount_dn_mapping: newdn: %s" % newdn) |
364 |
ud.debug(ud.LDAP, ud.INFO, "samaccount_dn_mapping: newdn: %s" % newdn) |
363 |
else: |
365 |
else: |
364 |
# get the object to read the sAMAccountName in S4 and use it as name |
366 |
# get the object to read the sAMAccountName in S4 and use it as name |
Lines 2453-2460
class s4(univention.s4connector.ucs):
|
Link Here
|
---|
|
2453 |
old_dn = tmp_object['dn'] |
2455 |
old_dn = tmp_object['dn'] |
2454 |
if hasattr(self.property[property_type], 'position_mapping'): |
2456 |
if hasattr(self.property[property_type], 'position_mapping'): |
2455 |
for mapping in self.property[property_type].position_mapping: |
2457 |
for mapping in self.property[property_type].position_mapping: |
2456 |
old_dn = self._subtree_replace(old_dn.lower(), mapping[1].lower(), mapping[0].lower()) |
2458 |
old_dn = self._subtree_replace(old_dn.lower(), mapping[0].lower(), mapping[1].lower()) |
2457 |
old_dn = self._subtree_replace(old_dn, self.lo.base, self.lo_s4.base) |
|
|
2458 |
# the old object was moved in UCS, but does this object exist in S4? |
2459 |
# the old object was moved in UCS, but does this object exist in S4? |
2459 |
try: |
2460 |
try: |
2460 |
old_object = self.lo_s4.lo.search_ext_s(compatible_modstring(old_dn), ldap.SCOPE_BASE, 'objectClass=*', timeout=-1, sizelimit=0) |
2461 |
old_object = self.lo_s4.lo.search_ext_s(compatible_modstring(old_dn), ldap.SCOPE_BASE, 'objectClass=*', timeout=-1, sizelimit=0) |