Code

Only check for roles that have to moved, if the role extension is enabled.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Nov 2010 16:26:38 +0000 (16:26 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Nov 2010 16:26:38 +0000 (16:26 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20304 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_plugin.inc

index 4b11cc4ef9646dd81a47e4936287a2750043719d..f932dd3f23b44e789e7d5cdebc636aae649fb29f 100644 (file)
@@ -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