summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 41e22fd)
raw | patch | inline | side by side (parent: 41e22fd)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 17 Oct 2005 09:13:01 +0000 (09:13 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 17 Oct 2005 09:13:01 +0000 (09:13 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1580 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 6a0406689a5d95926492710656cb83041688a833..f9548a12c6657a4bb99e2be759f3da5c2ac758c2 100644 (file)
var $gotoFilesystem= array();
var $gotoTerminalPath= "";
var $FAIstatus= "";
- var $FAIclass= "";
+ var $FAIclass = array();
+ var $FAIclasses = array();
+ var $FAIclassInfo = array();
+
/* attribute list for save action */
var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare");
$this->gotoShareSelections= $config->getShareList(true);
$this->gotoAvailableShares= $config->getShareList(false);
+ $ldap = $this->config->get_ldap_link();
+ $ldap->search("(objectClass=FAIprofile)",array("*"));
+ while($attr = $ldap->fetch()){
+ $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
+ $base = "ou=fai,".preg_replace("/^.*ou=fai,/","",$attr['dn']);
+ $cn = $attr['cn'][0];
+ $tmp[$cn] = $base;
+ }
+
+ foreach($tmp as $cn => $base){
+
+ $ldap->cd($base);
+ $ldap->search("(&(objectClass=*)(cn=".$cn."))",array("objectClass","cn"));
+ while($attr = $ldap->fetch()){
+
+ if(in_array('FAIpackageList',$attr['objectClass'])){
+ $tmp2[$cn]['FAIpackageList']['obj'] = 'FAIpackageList';
+ $tmp2[$cn]['FAIpackageList']['kzl'] = 'P';
+ }
+ if(in_array('FAItemplate',$attr['objectClass'])){
+ $tmp2[$cn]['FAItemplate']['obj'] = 'FAItemplate';
+ $tmp2[$cn]['FAItemplate']['kzl'] = 'T';
+ }
+ if(in_array('FAIvariable',$attr['objectClass'])){
+ $tmp2[$cn]['FAIvariable']['obj'] = 'FAIvariable';
+ $tmp2[$cn]['FAIvariable']['kzl'] = 'V';
+ }
+ if(in_array('FAIscript',$attr['objectClass'])){
+ $tmp2[$cn]['FAIscript']['obj'] = 'FAIscript';
+ $tmp2[$cn]['FAIscript']['kzl'] = 'S';
+ }
+ if(in_array('FAIhook',$attr['objectClass'])){
+ $tmp2[$cn]['FAIhook']['obj'] = 'FAIhook';
+ $tmp2[$cn]['FAIhook']['kzl'] = 'H';
+ }
+ if(in_array('FAIpartitionTable',$attr['objectClass'])){
+ $tmp2[$cn]['FAIpartitionTable']['obj']= 'FAIpartitionTable';
+ $tmp2[$cn]['FAIpartitionTable']['kzl']= 'Pt';
+ }
+ }
+ }
+
+ $this->FAIclassInfo = $tmp2;
+
+ if(isset($this->attrs['FAIclass'])){
+ $tmp = array();
+ $tmp2 = $this->attrs['FAIclass'];
+ unset($tmp2['count']);
+ foreach($tmp2 as $class){
+ $tmp[$class] = $class;
+ }
+ $this->FAIclass = $tmp;
+ }
+
+ if(!is_array($this->FAIclass)){
+ $this->FAIclass = array();
+ }
+
+
$this->orig_dn= $this->dn;
}
+ function selectFriendlyClasses(){
+ $tmp=array();
+ foreach($this->FAIclasses as $class){
+ $str = "";
+ if(isset($this->FAIclassInfo[$class])){
+ foreach($this->FAIclassInfo[$class] as $objs){
+ $str .= $objs['kzl']." ";
+ }
+ }
+ $tmp[$class] = $class." [".$str."]";
+ }
+ return($tmp);
+ }
+
function execute()
{
/* Do we need to flip is_account state? */
$this->is_account= !$this->is_account;
}
+
/* Do we represent a valid terminal? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
}
}
+ /* FAI class management */
+
+ if((isset($_POST['AddClass']))&&(isset($_POST['FAIclassesSel']))){
+ $this->FAIclass[$_POST['FAIclassesSel']]=$_POST['FAIclassesSel'];
+ }
+
+
+ if((isset($_POST['DelClass']))&&(isset($_POST['FAIclassSel']))){
+ if(isset($this->FAIclass[$_POST['FAIclassSel']])){
+ unset($this->FAIclass[$_POST['FAIclassSel']]);
+ }
+ }
+
+
+
+
+
+
+
+
+
+
/* Show main page */
$smarty= get_smarty();
}
/* Values */
- foreach(array("gotoBootKernel", "customParameters", "gotoShare") as $val){
+ foreach(array("gotoBootKernel", "customParameters", "gotoShare","FAIclasses","FAIclass") as $val){
$smarty->assign($val, $this->$val);
$smarty->assign($val."ACL", chkacl($this->acl, $val));
}
+
+
+ $smarty->assign("FAIclasses",$this->selectFriendlyClasses());
+ $smarty->assign("FAIclassesKeys",array_flip($this->selectFriendlyClasses()));
+ $smarty->assign("FAIclassKeys",$this->FAIclass);
/* Radio button group */
if (preg_match("/G/", $this->bootmode)) {
}
/* ACL's */
- foreach (array("gotoKernelParameters", "gotoModules", "gotoFilesystem") as $value){
+ foreach (array("gotoKernelParameters", "gotoModules", "gotoFilesystem","FAIclass") as $value){
$smarty->assign($value."ACL", chkacl($this->acl, "$value"));
}
$this->gotoKernelParameters.= " o ".$this->customParameters;
}
+ $tmp = array();
+ foreach($this->FAIclass as $class){
+ $tmp[] = $class;
+ }
+ $this->FAIclass = $tmp;
+
plugin::save();
/* Add missing arrays */
}
if(!isset($this->attrs["$val"])) $this->attrs["$val"]=array();
}
-
/* Strip out 'default' values */
if ($this->attrs['gotoLdapServer'] == "default"){
unset ($this->attrs['gotoLdapServer']);
}
+ $tmp = array();
+ foreach($this->FAIclass as $class){
+ $tmp[] = $class;
+ }
+ $this->FAIclass = $tmp;
/* Write back to ldap */
+
+
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->dn);
$ldap->modify($this->attrs);
diff --git a/plugins/admin/systems/workstationStartup.tpl b/plugins/admin/systems/workstationStartup.tpl
index 48c75bb36116e71452bc43c18fdf523473d7fb9e..3c0bd3edfbb0be8fd1f0624d352497c9228a206e 100644 (file)
</td>
<td style="vertical-align:top;">
- {t}Installation server{/t} [.........]<br>
- <br>
{t}Assigned FAI classes{/t}<br>
- [..........................]<br>
- [..........................]<br>
- [..........................]<br>
- [..........................]<br>
- [Add] [Remove]
+ <select name="FAIclassSel" {$FAIclassACL} multiple style="width:200px;height:50px;">
+ {html_options values=$FAIclass output=$FAIclassKeys}
+ <option disabled> </option>
+ </select>
+ <br>
+ <select name="FAIclassesSel" {$FAIclassACL}>
+ {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>
</table>