diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc
index ad9077747ed8082abc1b2b88b64c8e4e44e5e396..88e4d38c79874a6407dc76556dfed5729f732056 100644 (file)
/* FAI class selection */
- var $FAIinherit = false;
var $InheritedFAIclass = array();
var $InheritedFAIrelease = "";
var $InheritedFAIdebianMirror = "auto";
natcasesort($this->FAIclasses);
}
- $this->FAIclassInfo = $tmp2;
-
+ if(isset($tmp2)){
+ $this->FAIclassInfo = $tmp2;
+ } else {
+ $this->FAIclassInfo = array();
+ }
/* Build up an array like this one :
[$url]['SERVER'] = 'srv1-002';
$ldap->cd($this->config->current['BASE']);
$ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
if ($ldap->count() == 1){
- $map= array("gotoLdapServer","gotoBootKernel","FAIclass","FAIdebianMirror");
+ $map= array("gotoLdapServer","FAIclass","FAIdebianMirror");
$attrs= $ldap->fetch();
foreach ($map as $name){
}
if(count($this->FAIclass)==0 && $this->FAIrelease == ""){
- $this->FAIinherit =true;
+ $this->FAIdebianMirror = "inherited";
}
}
function selectFriendlyClasses(){
$tmp=array();
+ if($this->FAIdebianMirror == "inherited") return($tmp);
+
/* check if the current release exists,
else select the first one ..
*/
if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){
print_red(_("You must specify a valid mount point."));
}else{
- $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']];
- $s_mount = $_POST['gotoShareMountPoint'];
- /* Preparing the new assignment */
- $this->gotoShares[$a_share['name']."|".$a_share['server']]=$a_share;
- $this->gotoShares[$a_share['name']."|".$a_share['server']]['mountPoint']=$s_mount;
+ if(count($this->gotoAvailableShares)){
+ $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']];
+ $s_mount = $_POST['gotoShareMountPoint'];
+ /* Preparing the new assignment */
+ $this->gotoShares[$a_share['name']."|".$a_share['server']]=$a_share;
+ $this->gotoShares[$a_share['name']."|".$a_share['server']]['mountPoint']=$s_mount;
+ }
}
}
}
$smarty->assign("gotoShares",$this->printOutAssignedShares());
+ $smarty->assign("gotoSharesCount",count($this->printOutAssignedShares()));
$smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares()));
$smarty->assign("gotoBootKernels",$this->gotoBootKernels);
$SelectBoxLdapServer->AddEntry(
array(
- array("string"=>$display),
array("string"=>"<input type='radio' name='gotoLdapServer' value='".$key."' ".$use.">",
- "attach"=>"style='border-right:0px;'")
+ "attach"=>"style='border-left:0px;'"),
+ array("string"=>$display)
));
}
$smarty->assign($val."ACL", chkacl($this->acl, $val));
}
- $smarty->assign("FAIinherit",$this->FAIinherit);
$smarty->assign("FAIdebianMirrors",$this->getFAIdebianMirrors());
$smarty->assign("FAIreleases",$this->getFAIreleases());
$smarty->assign("FAIrelease",$this->FAIrelease);
$smarty->assign("FAIclasses",$this->selectFriendlyClasses());
$smarty->assign("FAIclassesKeys",array_flip($this->selectFriendlyClasses()));
$smarty->assign("FAIclassKeys",$this->FAIclass);
- $smarty->assign("InheritedFAIdebianMirror",$this->InheritedFAIdebianMirror);
$smarty->assign("InheritedFAIrelease",$this->InheritedFAIrelease);
$div = new divSelectBox("WSFAIscriptClasses");
$i = 1;
- if($this->FAIinherit){
+ if($this->FAIdebianMirror == "inherited"){
$tmp = $this->InheritedFAIclass;
}else{
$tmp = $this->FAIclass;
foreach($tmp as $class){
- if($this->FAIinherit){
+ if($this->FAIdebianMirror == "inherited"){
$str = "";
}else{
if($i==1){
function getFAIdebianMirrors()
{
$ret = array();
+ $ret['inherited']="["._("inherited")."]";
$ret['auto']=_("automatic");
$secs = array();
{
$ret = array();
+ if($this->FAIdebianMirror == "inherited") return(array());
+
if(!isset($this->FAIServRepConfig[$this->FAIdebianMirror])){
$this->FAIdebianMirror = "auto";
}
$this->customParameters= $_POST["customParameters"];
}
- if(isset($_POST['WorkstationStarttabPosted'])){
- if(isset($_POST['FAIinherit'])){
- $this->FAIinherit = true;
- }else{
- $this->FAIinherit = false;
- }
- }
}
$str = "";
- if($this->FAIinherit){
+ if($this->FAIdebianMirror == "inherited"){
$this->attrs['FAIclass'] = $this->attrs['FAIrelease'] = $this->attrs['FAIdebianMirror'] = array();
$this->FAIdebianMirror = "";
}
+ /* Get FAIstate from object, the generic tab could have changed it during execute */
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd($this->dn);
+ $ldap->cat($this->dn,array("FAIstate"));
+ $checkFAIstate = $ldap->fetch();
+
/* Remove FAI objects if no FAI class is selected */
- if(count($this->FAIclass)==0){
+ if((count($this->FAIclass)==0) && (!isset($checkFAIstate['FAIstate']))){
$tmp = array();
foreach($this->attrs['objectClass'] as $class){
if($class != "FAIobject"){
}
$this->attrs['gotoShare']=$tmp;
- $ldap= $this->config->get_ldap_link();
- $ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);