summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aa9a03d)
raw | patch | inline | side by side (parent: aa9a03d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 29 May 2006 08:27:56 +0000 (08:27 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 29 May 2006 08:27:56 +0000 (08:27 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3537 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_workstationStartup.inc | patch | blob | history | |
plugins/admin/systems/workstationStartup.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc
index c5f1cd00cd6f06f1695867b83e23dd4c76718ffa..ad9077747ed8082abc1b2b88b64c8e4e44e5e396 100644 (file)
var $FAIrelease = "";
var $FAIdebianMirror = "auto";
+
+ /* FAI class selection */
+ var $FAIinherit = false;
+ var $InheritedFAIclass = array();
+ var $InheritedFAIrelease = "";
+ var $InheritedFAIdebianMirror = "auto";
+
/* Contains all possible server/release/class settings */
var $FAIServRepConfig = array();
$ldap->cd($this->config->current['BASE']);
$ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
if ($ldap->count() == 1){
- $map= array("gotoLdapServer","gotoBootKernel");
+ $map= array("gotoLdapServer","gotoBootKernel","FAIclass","FAIdebianMirror");
$attrs= $ldap->fetch();
foreach ($map as $name){
$this->gotoBootKernels['%default%']= _("inherited").' ['.$attrs[$name][0].']' ;
break;
+ case 'FAIclass':
+ $str = split(":",$attrs[$name][0]);
+ $this->InheritedFAIclass = split("\ ",trim($str[0]));
+ $this->InheritedFAIrelease = trim($str[1]);
+ break;
+
+ case 'FAIdebianMirror':
+ $this->InheritedFAIdebianMirror = $attrs[$name][0];
+ break;
}
}
}
+
/* Get list of boot kernels */
if (isset($this->config->data['TABS'])){
$command= search_config($this->config->data['TABS'], get_class($this), "KERNELS");
}
}
-
+ if(count($this->FAIclass)==0 && $this->FAIrelease == ""){
+ $this->FAIinherit =true;
+ }
}
$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");
$div -> SetHeight("110");
$str_empty = " <img src='images/empty.png' alt=\"\" width='7'>";
$i = 1;
- foreach($this->FAIclass as $class){
- if($i==1){
- $str = $str_empty.$str_down.$str_remove;
- }elseif($i == count($this->FAIclass)){
- $str = $str_up.$str_empty.$str_remove;
+
+ if($this->FAIinherit){
+ $tmp = $this->InheritedFAIclass;
+ }else{
+ $tmp = $this->FAIclass;
+ }
+
+ foreach($tmp as $class){
+
+ if($this->FAIinherit){
+ $str = "";
}else{
- $str = $str_up.$str_down.$str_remove;
+ if($i==1){
+ $str = $str_empty.$str_down.$str_remove;
+ }elseif($i == count($this->FAIclass)){
+ $str = $str_up.$str_empty.$str_remove;
+ }else{
+ $str = $str_up.$str_down.$str_remove;
+ }
}
$i ++ ;
if (chkacl ($this->acl, "gotoKernelParameters") == "" && isset($_POST["customParameters"])){
$this->customParameters= $_POST["customParameters"];
}
+
+ if(isset($_POST['WorkstationStarttabPosted'])){
+ if(isset($_POST['FAIinherit'])){
+ $this->FAIinherit = true;
+ }else{
+ $this->FAIinherit = false;
+ }
+ }
}
unset( $this->attrs['FAIrelease'] );
$str = "";
- foreach($this->FAIclass as $class){
- $str .= $class." ";
- }
- $str .= ":" . $this->FAIrelease;
- $this->attrs['FAIclass']= "";
- $this->attrs['FAIclass']= trim($str);
- if(empty($this->attrs['FAIclass'])){
- $this->attrs['FAIclass'] = array();
+ if($this->FAIinherit){
+
+ $this->attrs['FAIclass'] = $this->attrs['FAIrelease'] = $this->attrs['FAIdebianMirror'] = array();
+
+ }else{
+
+ foreach($this->FAIclass as $class){
+ $str .= $class." ";
+ }
+ $str .= ":" . $this->FAIrelease;
+ $this->attrs['FAIclass']= "";
+ $this->attrs['FAIclass']= trim($str);
+
+ if(empty($this->attrs['FAIclass'])){
+ $this->attrs['FAIclass'] = array();
+ }
}
/* Add missing arrays */
diff --git a/plugins/admin/systems/workstationStartup.tpl b/plugins/admin/systems/workstationStartup.tpl
index e9ae1070d655960d3d7b25c8072b7b655405132f..d27ce0b5df605114a52e93b79783205a09b17551 100644 (file)
</td>
<td style="vertical-align:top;">
- <table><tr>
- <td>
- <h2><img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}FAI server{/t}</h2></td>
- <td>
- <h2><img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}Release{/t}</h2></td>
- </tr><tr>
- <td>
- <select name="FAIdebianMirror" {$FAIdebianMirrorACL} onchange='document.mainform.submit()'>
- {html_options options=$FAIdebianMirrors output=$FAIdebianMirrors selected=$FAIdebianMirror}
- <option disabled> </option>
- </select>
- <!--<input type="submit" value="{t}set{/t}" name="refresh">-->
- </td><td>
- <select name="FAIrelease" onchange='document.mainform.submit()'>
- {html_options options=$FAIreleases output=$FAIreleases selected=$FAIrelease}
- </select>
- </td>
- </tr></table>
- <h2><img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}Assigned FAI classes{/t}</h2>
+
+ {if $FAIinherit == true}
+
+ <table>
+ <tr>
+ <td>
+ <input type="checkbox" value="1" name="FAIinherit" {if $FAIinherit == true} checked {/if}
+ onClick="mainform.submit();">{t}Inherit FAI settings{/t}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h2><img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}FAI server{/t}
+ </h2>
+ </td>
+ <td>
+ <h2><img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}Release{/t}
+ </h2>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select name="FAIdebianMirror" disabled>
+ {html_options options=$InheritedFAIdebianMirror output=$InheritedFAIdebianMirror selected=$InheritedFAIdebianMirror}
+ </select>
+ </td>
+ <td>
+ <select name="FAIrelease" disabled>
+ {html_options options=$InheritedFAIrelease output=$InheritedFAIrelease selected=$InheritedFAIrelease}
+ </select>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ <img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}Assigned FAI classes{/t}
+ </h2>
+ {$FAIScriptlist}
+ {else}
+
+ <table>
+ <tr>
+ <td>
+ <input type="checkbox" value="1" name="FAIinherit" {if $FAIinherit == true} checked {/if}
+ onClick="mainform.submit();">{t}Inherit FAI settings{/t}
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h2><img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}FAI server{/t}
+ </h2>
+ </td>
+ <td>
+ <h2><img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}Release{/t}
+ </h2>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <select name="FAIdebianMirror" {$FAIdebianMirrorACL} onchange='document.mainform.submit()'>
+ {html_options options=$FAIdebianMirrors output=$FAIdebianMirrors selected=$FAIdebianMirror}
+ <option disabled> </option>
+ </select>
+ <!--<input type="submit" value="{t}set{/t}" name="refresh">-->
+ </td>
+ <td>
+ <select name="FAIrelease" onchange='document.mainform.submit()'>
+ {html_options options=$FAIreleases output=$FAIreleases selected=$FAIrelease}
+ </select>
+ </td>
+ </tr>
+ </table>
+ <h2>
+ <img class="center" alt="" align="middle" src="images/fai_profile.png"> {t}Assigned FAI classes{/t}
+ </h2>
{$FAIScriptlist}
<select name="FAIclassesSel" {$FAIclassACL}>
- {html_options values=$FAIclassesKeys output=$FAIclasses}
- <option disabled> </option>
+ {html_options values=$FAIclassesKeys output=$FAIclasses}
+ <option disabled> </option>
</select>
- <input name="AddClass" value="{t}Add{/t}" type="submit">
- <input name="DelClass" value="{t}Delete{/t}" type="submit">
- </td>
- </tr>
+ <input name="AddClass" value="{t}Add{/t}" type="submit">
+ <input name="DelClass" value="{t}Delete{/t}" type="submit">
+ {/if}
+ </td>
+ </tr>
</table>
<table summary="" style="width:100%;">
</td>
</tr>
</table>
-
+<input name="WorkstationStarttabPosted" type="hidden" value="1">
<!-- Place cursor -->
<script language="JavaScript" type="text/javascript">
<!-- // First input field on page
document.mainform.gotoLdapServer.focus();
-->
-</script>