summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ecc17ee)
raw | patch | inline | side by side (parent: ecc17ee)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Oct 2005 06:14:22 +0000 (06:14 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 19 Oct 2005 06:14:22 +0000 (06:14 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1609 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_workstationStartup.inc | patch | blob | history |
diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc
index e6b415d376670c8e47f4e256c2f2949f63b3146a..90afd398c0c7e2b463d4b2c2dc4af46e0557f529 100644 (file)
var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
/* Generic terminal attributes */
- var $bootmode= "G";
- var $goLdapServerList= array("default");
- var $gotoBootKernel= "default";
- var $gotoKernelParameters= "";
- var $gotoLdapServer= "";
- var $gotoModules= array();
- var $gotoAutoFs= array();
- var $gotoFilesystem= array();
- var $gotoTerminalPath= "";
- var $FAIstatus= "";
- var $FAIclass = array();
- var $FAIclasses = array();
- var $FAIclassInfo = array();
- var $FAIdebianMirror = array();
+ var $bootmode = "G";
+ var $goLdapServerList = array("default");
+ var $gotoBootKernel = "default";
+ var $gotoKernelParameters = "";
+ var $gotoLdapServer = "";
+ var $gotoModules = array();
+ var $gotoAutoFs = array();
+ var $gotoFilesystem = array();
+ var $gotoTerminalPath = "";
+ var $FAIstatus = "";
+ var $FAIclass = array();
+ var $FAIclasses = array();
+ var $FAIclassInfo = array();
+ var $FAIdebianMirror = array();
/* attribute list for save action */
- var $attributes= array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror");
- var $objectclasses= array("GOhard", "FAIobject");
+ var $attributes = array("gotoLdapServer", "gotoBootKernel", "gotoKernelParameters", "FAIclass", "FAIstatus", "gotoShare","FAIdebianMirror");
+ var $objectclasses = array("GOhard", "FAIobject");
/* Share */
var $gotoShares = array();// Currently Share Option
var $gotoAvailableShares= array();// Available Shares for this account
/* Helper */
- var $customParameters= "";
- var $orig_dn= "";
- var $ignore_account= TRUE;
- var $FAIdebianMirrors = array();
+ var $customParameters = "";
+ var $orig_dn = "";
+ var $ignore_account = TRUE;
+ var $FAIdebianMirrors = array();
function workstartup ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
-
- $this->FAIdebianMirrors= array("none"=>_("none"));
- $ldap = $this->config->get_ldap_link();
+
+
+ /* Creating a list of valid Mirrors
+ * none will not be saved to ldap.
+ */
+ $this->FAIdebianMirrors = array("none"=>_("none"));
+ $ldap = $this->config->get_ldap_link();
$ldap->search("(objectClass=FAIrepository)",array("FAIdebianMirror"));
+
+ /* attach all attributes with "index => cn" to avoid multiple entries */
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"])){
$this->gotoAvailableShares= $config->getShareList(false);
$tmp2 = array();
- //$ldap->cd($base);
- $ldap = $this->config->get_ldap_link();
+ $ldap = $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
- $ldap->search("(|(objectClass=FAIpackageList)(objectClass=FAItemplate)
+
+ /* Search all FAI objects */
+ $ldap->search("(| (objectClass=FAIpackageList)(objectClass=FAItemplate)
(objectClass=FAIvariable)(objectClass=FAIscript')(objectClass=FAIhook)
(objectClass=FAIpartitionTable))",array("objectClass","cn"),true);
- $test_dns = array();
+ /* Sort all entries, and attach elementtype.
+ * To be able to show the types in the listbox.
+ */
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']['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'])){
$this->orig_dn= $this->dn;
}
+ /* Create array to display available classes/profiles in a selectbox */
function selectFriendlyClasses(){
$tmp=array();
foreach($this->FAIclasses as $class){
return($tmp);
}
+
function check()
{
$messages = array();
-
+
+ /* If there are packages selected, but no mirror show error */
if(($this->FAIdebianMirror == "none")&&(count($this->FAIclass)>0)){
$messages[]=_("Please select a 'FAI server' or remove the 'FAI classes'.");
}
$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']))){
-
$found = 0 ;
+ /* If this new class/profile will attach a second partition table
+ * to our list of classes, abort and show a message.
+ */
foreach($this->FAIclass as $name){
if(isset($this->FAIclassInfo[$name])){
foreach($this->FAIclassInfo[$name] as $atr){
}
}
+ /* Delete selected class from our list */
if((isset($_POST['DelClass']))&&(isset($_POST['FAIclassSel']))){
if(isset($this->FAIclass[$_POST['FAIclassSel']])){
unset($this->FAIclass[$_POST['FAIclassSel']]);
$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()));
$this->gotoKernelParameters.= " o ".$this->customParameters;
}
+ /* Create numeric index for our classes */
$tmp = array();
foreach($this->FAIclass as $class){
$tmp[] = $class;
$this->attrs['FAIclass'] = $tmp;
/* Write back to ldap */
+ /* if mirror == none stop saving this attribute */
if($this->FAIdebianMirror == "none"){
$this->FAIdebianMirror = "";
}
$tmp[] = $class;
}
}
- $this->attrs['objectClass'] = $tmp;
- $this->attrs['FAIclass'] = array();;
- $this->attrs['FAIdebianMirror'] = array();;
+ $this->attrs['objectClass'] = $tmp;
+ $this->attrs['FAIclass'] = array();
+ $this->attrs['FAIdebianMirror'] = array();
}
$ldap= $this->config->get_ldap_link();