Code

Ensure that fai departments exists, when creating a new release
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Sep 2007 09:37:28 +0000 (09:37 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 27 Sep 2007 09:37:28 +0000 (09:37 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7422 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiManagement.inc

index ee8a813e53bfd6a32a10d1461650b5bc4cea2c28..578a961d57393c37307d085523cb1284070dbcf0 100644 (file)
@@ -509,6 +509,15 @@ class faiManagement extends plugin
         $mimesrc = preg_replace("/ou=fai,ou=configs,ou=systems,/","ou=mime,",$baseToUse); 
         $mimedst = preg_replace("/ou=fai,ou=configs,ou=systems,/","ou=mime,","ou=".$name.",".$baseToUse) ; 
 
+        /* Check if source depeartments exist */
+        foreach(array($baseToUse,$appsrc,$mimesrc) as $dep){
+          $ldap->cd($this->config->current['BASE']);
+          $ldap->cat($dep);
+          if(!$ldap->count()){
+            $ldap->create_missing_trees($dep);
+          }
+        }
+
         /* Print header to have styles included */
         echo '  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
           <html>