X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fsystems%2Fclass_workstationStartup.inc;h=0f7f3d37cde59dad074c0a1d37c5a322ea7cc0a0;hb=499786c811063a46a322b65d28c19234800e4262;hp=a0f6199070612e57ac007ed79b109691cdaa5c94;hpb=0299eb76eb453ecd5faa8d3a9107ef14577315d2;p=gosa.git diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index a0f619907..0f7f3d37c 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -56,6 +56,8 @@ class workstartup extends plugin var $fai_activated = FALSE; + var $member_of_ogroup = FALSE; + function workstartup ($config, $dn= NULL, $parent= NULL) { /* Check if FAI is active */ @@ -69,6 +71,13 @@ class workstartup extends plugin plugin::plugin ($config, $dn, $parent); + if(!isset($this->parent->by_object['ogroup'])){ + $ldap = $this->config->get_ldap_link(); + $ldap->cd ($this->config->current['BASE']); + $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))",array("cn")); + $this->member_of_ogroup = $ldap->count() >= 1; + } + /* Creating a list of valid Mirrors * none will not be saved to ldap. */ @@ -290,10 +299,11 @@ class workstartup extends plugin $this->gotoBootKernels= array("default-inherited" => '['._("inherited").']'); /* Load hardware list */ - $ldap= $this->config->get_ldap_link(); - $ldap->cd($this->config->current['BASE']); - $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))"); - if ($ldap->count() == 1){ + if ($this->member_of_ogroup){ + + if(count($this->FAIclass)==0 && $this->FAIrelease == ""){ + $this->FAIdebianMirror = "inherited"; + } if($this->fai_activated){ $map= array("gotoLdapServer","FAIclass","FAIdebianMirror"); @@ -359,10 +369,6 @@ class workstartup extends plugin } } - if(count($this->FAIclass)==0 && $this->FAIrelease == ""){ - $this->FAIdebianMirror = "inherited"; - } - /* Turn to default, if we've nothing to inherit */ if (!isset($this->gotoBootKernels['default-inherited']) && $this->gotoBootKernel == "default-inherited"){ $this->gotoBootKernel= "default"; @@ -832,7 +838,13 @@ class workstartup extends plugin function getFAIdebianMirrors() { $ret = array(); - $ret['inherited']="["._("inherited")."]"; + + /* Only add inherit option, if we are part in an object group + */ + if($this->member_of_ogroup) { + $ret['inherited']="["._("inherited")."]"; + } + $ret['auto']=_("automatic"); $secs = array(); @@ -1163,35 +1175,14 @@ class workstartup extends plugin { plugin::PrepareForCopyPaste($source); - - /* Get arrays */ - foreach (array("gotoModules", "gotoAutoFs", "gotoFilesystem","gotoKernelParameters") as $val){ - $this->$val = array(); - if (isset($source["$val"]["count"])){ - for ($i= 0; $i<$source["count"]; $i++){ - if (isset($source["$val"][$i])){ - array_push($this->$val, $source["$val"][$i]); - } - } - } - sort ($this->$val); - $this->$val= array_unique($this->$val); - } - - /* Prepare Shares */ - if((isset($source['gotoShare']))&&(is_array($source['gotoShare']))){ - unset($source['gotoShare']['count']); - foreach($source['gotoShare'] as $share){ - $tmp = $tmp2 = array(); - $tmp = split("\|",$share); - $tmp2['server'] =$tmp[0]; - $tmp2['name'] =$tmp[1]; - $tmp2['mountPoint'] =$tmp[2]; - $this->gotoShares[$tmp[1]."|".$tmp[0]]=$tmp2; - } + $source_o = new workstartup ($this->config, $source['dn']); + + foreach(array("gotoModules", "gotoAutoFs", "gotoFilesystem","gotoKernelParameters","gotoShares","customParameters") as $attr){ + $this->$attr = $source_o->$attr; } } + /* Return plugin informations for acl handling */ function plInfo() {