From: hickert Date: Thu, 10 Jan 2008 14:13:28 +0000 (+0000) Subject: Updated workstation startup X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2f041e707410452bb17b9d0864dc1334164874f5;p=gosa.git Updated workstation startup git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8293 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/functions_FAI.inc b/gosa-core/include/functions_FAI.inc index 7b2b6170f..03cde0637 100644 --- a/gosa-core/include/functions_FAI.inc +++ b/gosa-core/include/functions_FAI.inc @@ -37,7 +37,8 @@ function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false) foreach($deps_to_search as $fai_base){ /* Ldap search for fai classes specified in this release */ - $res_tmp = get_list($filter,"fai",$fai_base,array("dn","objectClass","FAIstate"),GL_SUBSEARCH | GL_SIZELIMIT); + $attributes = array("dn","objectClass","FAIstate","cn","FAIdebianSection"); + $res_tmp = get_list($filter,"fai",$fai_base,$attributes,GL_SUBSEARCH | GL_SIZELIMIT); /* check the returned objects, and add/replace them in our return variable */ foreach($res_tmp as $attr){ @@ -54,7 +55,6 @@ function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false) } } - /* In detailed mode are some additonal informations visible */ if($detailed){ @@ -67,8 +67,12 @@ function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false) } /* Append objectClass to resulsts */ - $buffer['objectClass'] = $attr['objectClass']; - unset($buffer['objectClass'][0]); + foreach($attributes as $val){ + if(isset($attr[$val])){ + $buffer[$val] = $attr[$val]; + } + } + unset($buffer['objectClass']['count']); } /* Add this object to our list */ diff --git a/gosa-core/plugins/admin/systems/class_workstationStartup.inc b/gosa-core/plugins/admin/systems/class_workstationStartup.inc index c0373ee3d..e67633463 100644 --- a/gosa-core/plugins/admin/systems/class_workstationStartup.inc +++ b/gosa-core/plugins/admin/systems/class_workstationStartup.inc @@ -1068,7 +1068,12 @@ class workstartup extends plugin /* Get classes for release from cache. * Or build cache */ - if($force || !isset($this->cache['CLASSES'][$this->FAIrelease])){ + if($this->FAIdebianMirror == "inherited"){ + $release = $this->InheritedFAIrelease; + }else{ + $release = $this->FAIrelease; + } + if($force || !isset($this->cache['CLASSES'][$release])){ /* Create a list of available releases. * $this->cache['RELEASE_DNS'][ou=siga...,c=de] = "siga"; @@ -1089,25 +1094,23 @@ class workstartup extends plugin /* Create list of available classes for the currenlty selected release. */ - foreach(array($this->FAIrelease,$this->InheritedFAIrelease) as $release){ - $base = array_search($release,$this->cache['RELEASE_DNS']); - $this->cache['CLASSES'][$release] = array(); - if(!empty($base)){ - $ldap = $this->config->get_ldap_link(); - $ldap->cd($base); - $ldap->search("(|(objectClass=FAIpackageList)(objectClass=FAItemplate)(objectClass=FAIvariable)". - "(objectClass=FAIscript)(objectClass=FAIhook)(objectClass=FAIprofile)". - "(objectClass=FAIpartitionTable))",array("cn","objectClass","FAIdebianSection",'description')); - - while($attrs = $ldap->fetch()){ - $info = $this->analyse_fai_object($attrs); - if(count($info)){ - $this->cache['CLASSES'][$release][$attrs['cn'][0]][] = $info; - } + $base = array_search($release,$this->cache['RELEASE_DNS']); + $this->cache['CLASSES'][$release] = array(); + + if(!empty($base)){ + $filter = "(|(objectClass=FAIpackageList)(objectClass=FAItemplate)(objectClass=FAIvariable)". + "(objectClass=FAIscript)(objectClass=FAIhook)(objectClass=FAIprofile)". + "(objectClass=FAIpartitionTable))"; + $list = get_all_objects_for_given_base($base,$filter,TRUE); + foreach($list as $attrs){ + $info = $this->analyse_fai_object($attrs); + if(count($info)){ + $this->cache['CLASSES'][$release][$attrs['cn'][0]][] = $info; } } } + /* Add object caught from external hook */ $lines= $this->GetHookElements();