summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4a6dab8)
raw | patch | inline | side by side (parent: 4a6dab8)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 18 Oct 2005 11:50:25 +0000 (11:50 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 18 Oct 2005 11:50:25 +0000 (11:50 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1605 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 c4ca71b12f149b18f477d175f45a8e9ecfeac48a..e6b415d376670c8e47f4e256c2f2949f63b3146a 100644 (file)
{
plugin::plugin ($config, $dn);
- // Create Mirror
- $this->FAIdebianMirrors=array();
- $path = "/etc/gosa/fai/";
- $suffix = "http://";
- if(is_readable($path)){
- $od= opendir($path);
- if($od){
- while($dir = readdir($od)){
- if((is_dir($path.$dir))&&($dir[0]!=".")){
- $this->FAIdebianMirrors[$suffix.$dir]=$suffix.$dir;
- }
- }
+ $this->FAIdebianMirrors= array("none"=>_("none"));
+ $ldap = $this->config->get_ldap_link();
+ $ldap->search("(objectClass=FAIrepository)",array("FAIdebianMirror"));
+ while($attr = $ldap->fetch()){
+ if(isset($attr['FAIdebianMirror'])){
+ $this->FAIdebianMirrors[$attr['FAIdebianMirror'][0]]=$attr['FAIdebianMirror'][0];
}
- }
-
+ }
+
+
/* Get arrays */
foreach (array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $val){
if (isset($this->attrs["$val"]["count"])){
$ldap->search("(|(objectClass=FAIpackageList)(objectClass=FAItemplate)
(objectClass=FAIvariable)(objectClass=FAIscript')(objectClass=FAIhook)
(objectClass=FAIpartitionTable))",array("objectClass","cn"),true);
+ $test_dns = array();
while($attr = $ldap->fetch()){
$cn = $attr['cn'][0];
if(in_array('FAIpackageList',$attr['objectClass'])){
$tmp2[$cn]['FAIpackageList']['obj'] = 'FAIpackageList';
- $tmp2[$cn]['FAIpackageList']['kzl'] = 'P';
+ $tmp2[$cn]['FAIpackageList']['kzl'] = 'P';
+ $tmp2[$cn]['FAIpackageList']['dn'] = $attr['dn'];
+ $test_dns[$cn]=$attr['dn'];
$this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
}
if(in_array('FAItemplate',$attr['objectClass'])){
}
}
+ foreach($test_dns as $cn => $dn){
+ $entry = $ldap->cat($dn);
+ $attr = $ldap->fetch();
+ $mirror = $attr['FAIdebianMirror'][0];
+ $tmp2[$cn]['FAIpackageList']['mirror']= $mirror;
+ }
+
$this->FAIclassInfo = $tmp2;
if(isset($this->attrs['FAIclass'])){
$tmp=array();
foreach($this->FAIclasses as $class){
$str = "";
+ $skip = false;
if(isset($this->FAIclassInfo[$class])){
foreach($this->FAIclassInfo[$class] as $objs){
$str .= $objs['kzl']." ";
}
}
- $tmp[$class] = $class." [".$str."]";
+ $tmp[$class] = $class." [".$str."]";
}
- return($tmp);
+ return($tmp);
+ }
+
+ function check()
+ {
+ $messages = array();
+
+ if(($this->FAIdebianMirror == "none")&&(count($this->FAIclass)>0)){
+ $messages[]=_("Please select a 'FAI server' or remove the 'FAI classes'.");
+ }
+ return($messages);
}
function execute()
$smarty->assign($val."ACL", chkacl($this->acl, $val));
}
+
$smarty->assign("FAIdebianMirrors",$this->FAIdebianMirrors);
-
$smarty->assign("FAIclasses",$this->selectFriendlyClasses());
$smarty->assign("FAIclassesKeys",array_flip($this->selectFriendlyClasses()));
$smarty->assign("FAIclassKeys",$this->FAIclass);
}
$this->attrs['FAIclass'] = $tmp;
/* Write back to ldap */
+
+ if($this->FAIdebianMirror == "none"){
+ $this->FAIdebianMirror = "";
+ }
if((count($this->attrs['FAIclass'])==0)&&(empty($this->FAIdebianMirror))){
$tmp = array();
}
$this->attrs['objectClass'] = $tmp;
$this->attrs['FAIclass'] = array();;
+ $this->attrs['FAIdebianMirror'] = array();;
}
$ldap= $this->config->get_ldap_link();
diff --git a/plugins/admin/systems/workstationStartup.tpl b/plugins/admin/systems/workstationStartup.tpl
index 7c463a0b18df42ef795181661c106db6f0564c31..a898c13fc96f30a6969c6d7f7b64596c6fdc4c21 100644 (file)
<td style="vertical-align:top;">
<h2><img alt="" align="middle" src="images/fai_profile.png"> {t}FAI server{/t}</h2>
+ <!--<select name="FAIdebianMirror" {$FAIdebianMirrorACL} onchange="document.mainform.submit();">-->
<select name="FAIdebianMirror" {$FAIdebianMirrorACL}>
{html_options options=$FAIdebianMirrors output=$FAIdebianMirrors selected=$FAIdebianMirror}
<option disabled> </option>
</select>
-
+ <!--<input type="submit" value="{t}set{/t}" name="refresh">-->
<h2><img alt="" align="middle" src="images/fai_profile.png"> {t}Assigned FAI classes{/t}</h2>
<select name="FAIclassSel" {$FAIclassACL} multiple style="width:100%;height:100px;">
{html_options values=$FAIclass output=$FAIclassKeys}