From: hickert Date: Fri, 19 Nov 2010 16:26:38 +0000 (+0000) Subject: Only check for roles that have to moved, if the role extension is enabled. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=61baae60c76e23e420485127473ca824c0c2e68e;p=gosa.git Only check for roles that have to moved, if the role extension is enabled. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20304 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 4b11cc4ef..f932dd3f2 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -965,16 +965,18 @@ class plugin } /* Update roles to use the new entry dn */ - $roles = get_sub_list("(&(objectClass=organizationalRole)(roleOccupant=".LDAP::prepare4filter(LDAP::fix($src_dn))."))","roles", array(get_ou("roleGeneric", "roleRDN")),$this->config->current['BASE'],array("dn"), GL_SUBSEARCH | GL_NO_ACL_CHECK); - - // Walk through all roles - foreach($roles as $role){ - $role = new roleGeneric($this->config,$role['dn']); - $key= array_search($src_dn, $role->roleOccupant); - if($key !== FALSE){ - $role->roleOccupant[$key] = $dst_dn; - $role->save(); - } + if(class_available('roleGeneric')){ + $roles = get_sub_list("(&(objectClass=organizationalRole)(roleOccupant=".LDAP::prepare4filter(LDAP::fix($src_dn))."))","roles", array(get_ou("roleGeneric", "roleRDN")),$this->config->current['BASE'],array("dn"), GL_SUBSEARCH | GL_NO_ACL_CHECK); + + // Walk through all roles + foreach($roles as $role){ + $role = new roleGeneric($this->config,$role['dn']); + $key= array_search($src_dn, $role->roleOccupant); + if($key !== FALSE){ + $role->roleOccupant[$key] = $dst_dn; + $role->save(); + } + } } // Update 'manager' attributes from gosaDepartment and inetOrgPerson