From 9f1dfac9821b26f4f3f5e7543f0b99b4bd9df69f Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 27 Sep 2007 09:37:28 +0000 Subject: [PATCH] Ensure that fai departments exists, when creating a new release git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7422 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiManagement.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index ee8a813e5..578a961d5 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -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 ' -- 2.30.2