|
683 |
# evaluate extended attributes |
683 |
# evaluate extended attributes |
684 |
ocs = set() |
684 |
ocs = set() |
685 |
for prop in getattr(m, 'extended_udm_attributes', []): |
685 |
for prop in getattr(m, 'extended_udm_attributes', []): |
686 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'simpleLdap._create: prop.objClass = %s, prop.name = %s'% (prop.objClass, prop.name)) |
686 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'simpleLdap._create: info[%s]:%r = %r'% (prop.name, self.has_key(prop.name), self.info.get(prop.name))) |
687 |
if not self.info.get(prop.name): |
687 |
if self.has_key(prop.name) and self.info.get(prop.name): |
688 |
continue |
|
|
689 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'simpleLdap._create: prop.name: info[%s] = %s'% (prop.name, self.info.get(prop.name))) |
690 |
|
691 |
# do not add object class and value if syntax is boolean and checkbox is disabled |
692 |
if prop.syntax == 'boolean' and self.info.get(prop.name) == '0': |
693 |
al = [x for x in al if x[0].lower() != prop.ldapMapping.lower()] |
694 |
continue |
695 |
|
696 |
# in all other cases add object class |
697 |
if self.has_key(prop.name): |
698 |
ocs.add(prop.objClass) |
688 |
ocs.add(prop.objClass) |
699 |
|
689 |
|
700 |
# add object classes of (especially extended) options |
690 |
# add object classes of (especially extended) options |
Lines 805-818
def _ldap_object_classes(self, ml):
|
Link Here
|
---|
|
805 |
for prop in getattr(m, 'extended_udm_attributes', []): |
795 |
for prop in getattr(m, 'extended_udm_attributes', []): |
806 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'simpleLdap._modify: extended attribute=%r oc=%r'% (prop.name, prop.objClass)) |
796 |
univention.debug.debug(univention.debug.ADMIN, univention.debug.INFO, 'simpleLdap._modify: extended attribute=%r oc=%r'% (prop.name, prop.objClass)) |
807 |
|
797 |
|
808 |
if self.__ea_value_is_set(prop.name): |
798 |
if self.has_key(prop.name) and self.info.get(prop.name): |
809 |
required_ocs |= set([prop.objClass]) |
799 |
required_ocs |= set([prop.objClass]) |
810 |
continue |
800 |
continue |
811 |
|
801 |
|
812 |
if prop.deleteObjClass: |
802 |
if prop.deleteObjClass: |
813 |
unneeded_ocs |= set([prop.objClass]) |
803 |
unneeded_ocs |= set([prop.objClass]) |
814 |
|
804 |
|
815 |
# if the value is unset (or a boolean attribute with value == 0) we need to remove the attribute completely |
805 |
# if the value is unset we need to remove the attribute completely |
816 |
if self.oldattr.get(prop.ldapMapping): |
806 |
if self.oldattr.get(prop.ldapMapping): |
817 |
ml = [x for x in ml if x[0].lower() != prop.ldapMapping.lower()] |
807 |
ml = [x for x in ml if x[0].lower() != prop.ldapMapping.lower()] |
818 |
ml.append((prop.ldapMapping, self.oldattr.get(prop.ldapMapping), '')) |
808 |
ml.append((prop.ldapMapping, self.oldattr.get(prop.ldapMapping), '')) |
Lines 868-880
def _ldap_object_classes(self, ml):
|
Link Here
|
---|
|
868 |
|
858 |
|
869 |
return ml |
859 |
return ml |
870 |
|
860 |
|
871 |
def __ea_value_is_set(self, name): |
|
|
872 |
if not self.has_key(name): |
873 |
return False |
874 |
if self.descriptions[name].syntax == 'boolean' and self.info.get(name) == '0': |
875 |
return False |
876 |
return self.info.get(name) |
877 |
|
878 |
def _move_in_subordinates(self, olddn): |
861 |
def _move_in_subordinates(self, olddn): |
879 |
result = self.lo.search(base=self.lo.base, filter=filter_format('(&(objectclass=person)(secretary=%s))', [olddn]), attr=['dn']) |
862 |
result = self.lo.search(base=self.lo.base, filter=filter_format('(&(objectclass=person)(secretary=%s))', [olddn]), attr=['dn']) |
880 |
for subordinate, attr in result: |
863 |
for subordinate, attr in result: |