|
Lines 311-331
def update_extended_attributes(lo, module, position):
Link Here
|
| 311 |
ud.debug(ud.ADMIN, ud.ERROR, 'modules update_extended_attributes: ERROR: processing univentionUDMPropertyDoNotSearch throwed exception - assuming doNotSearch=0') |
311 |
ud.debug(ud.ADMIN, ud.ERROR, 'modules update_extended_attributes: ERROR: processing univentionUDMPropertyDoNotSearch throwed exception - assuming doNotSearch=0') |
| 312 |
doNotSearch = 0 |
312 |
doNotSearch = 0 |
| 313 |
|
313 |
|
|
|
314 |
map_method = '' |
| 315 |
unmap_method = '' |
| 316 |
|
| 314 |
# check if CA is multivalue property |
317 |
# check if CA is multivalue property |
| 315 |
if attrs.get('univentionUDMPropertyMultivalue', [''])[0] == '1': |
318 |
multivalue = attrs.get('univentionUDMPropertyMultivalue', [''])[0] == '1' |
| 316 |
multivalue = 1 |
319 |
if not multivalue: |
| 317 |
map_method = None |
320 |
map_method = 'ListToString' |
| 318 |
unmap_method = None |
|
|
| 319 |
else: |
| 320 |
multivalue = 0 |
| 321 |
map_method = univention.admin.mapping.ListToString |
| 322 |
unmap_method = None |
| 323 |
if propertySyntaxString == 'boolean': |
321 |
if propertySyntaxString == 'boolean': |
| 324 |
map_method = univention.admin.mapping.BooleanListToString |
322 |
map_method = 'BooleanListToString' |
| 325 |
unmap_method = univention.admin.mapping.BooleanUnMap |
323 |
unmap_method = 'BooleanUnMap' |
| 326 |
# single value ==> use only first value |
324 |
# single value ==> use only first value |
| 327 |
propertyDefault = propertyDefault[0] |
325 |
propertyDefault = propertyDefault[0] |
| 328 |
|
326 |
|
|
|
327 |
# extended attribute for objectClass should not be mapped to any attribute/property |
| 328 |
if attrs['univentionUDMPropertyLdapMapping'][0].lower() == 'objectClass'.lower(): |
| 329 |
map_method = 'nothing' |
| 330 |
unmap_method = 'nothing' |
| 331 |
|
| 332 |
map_method = getattr(univention.admin.mapping, attrs.get('univentionUDMPropertyMapMethod', [map_method])[0], None) |
| 333 |
unmap_method = getattr(univention.admin.mapping, attrs.get('univentionUDMPropertyUnMapMethod', [unmap_method])[0], None) |
| 334 |
|
| 329 |
# Show this attribute in UDM/UMC? |
335 |
# Show this attribute in UDM/UMC? |
| 330 |
if attrs.get('univentionUDMPropertyLayoutDisable', [''])[0] == '1': |
336 |
if attrs.get('univentionUDMPropertyLayoutDisable', [''])[0] == '1': |
| 331 |
layoutDisabled = True |
337 |
layoutDisabled = True |
|
Lines 363-372
def update_extended_attributes(lo, module, position):
Link Here
|
| 363 |
) |
369 |
) |
| 364 |
|
370 |
|
| 365 |
# add LDAP mapping |
371 |
# add LDAP mapping |
| 366 |
if attrs['univentionUDMPropertyLdapMapping'][0].lower() != 'objectClass'.lower(): |
372 |
module.mapping.register(pname, attrs['univentionUDMPropertyLdapMapping'][0], unmap_method, map_method) |
| 367 |
module.mapping.register(pname, attrs['univentionUDMPropertyLdapMapping'][0], unmap_method, map_method) |
|
|
| 368 |
else: |
| 369 |
module.mapping.register(pname, attrs['univentionUDMPropertyLdapMapping'][0], univention.admin.mapping.nothing, univention.admin.mapping.nothing) |
| 370 |
|
373 |
|
| 371 |
if hasattr(module, 'layout'): |
374 |
if hasattr(module, 'layout'): |
| 372 |
tabname = attrs.get('univentionUDMPropertyTranslationTabName;entry-%s' % lang, attrs.get('univentionUDMPropertyLayoutTabName', [_('Custom')]))[0] |
375 |
tabname = attrs.get('univentionUDMPropertyTranslationTabName;entry-%s' % lang, attrs.get('univentionUDMPropertyLayoutTabName', [_('Custom')]))[0] |