Code

Updated functions for FAI
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Jul 2006 08:12:22 +0000 (08:12 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 10 Jul 2006 08:12:22 +0000 (08:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4059 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions_FAI.inc

index 5bb4da912b19fc5f37c89bf30e76c18e6854b3fd..056e78ce906482492a96fa81fb2065173aa7079b 100644 (file)
@@ -116,7 +116,7 @@ function get_FAI_departments($suffix = "")
 
 
 /* Return all releases within the given base */
-function get_all_releases_from_base($dn)
+function get_all_releases_from_base($dn,$appendedName)
 {
   global $config;
   $base = "ou=fai,ou=configs,ou=systems,".$dn;
@@ -126,8 +126,12 @@ function get_all_releases_from_base($dn)
   $ldap->cd($base);
   $ldap->search("(objectClass=FAIbranch)",array("ou","dn"));
   while($attrs = $ldap->fetch()){
-    $res[$attrs['dn']] = $attrs['ou'][0];
-  } 
+    if($appendedName){
+      $res[$attrs['dn']] = convert_department_dn(preg_replace("/,ou=fai,ou=configs,ou=system.*$/","",$attrs['dn']));
+    }else{
+      $res[$attrs['dn']] = $attrs['ou'][0];
+    }
+  }
   return($res);
 }