diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc
index ac0077fd9ea1796481211dc733f751698b51e8c4..c5ca3cced69af4ac1b745a1d9c8278a580342e18 100644 (file)
/* Search all FAI objects */
$ldap->search("(| (objectClass=FAIpackageList)(objectClass=FAItemplate)
- (objectClass=FAIvariable)(objectClass=FAIscript')(objectClass=FAIhook)
+ (objectClass=FAIvariable)(objectClass=FAIscript)(objectClass=FAIhook)(objectClass=FAIprofile)
(objectClass=FAIpartitionTable))",array("objectClass","cn"),true);
/* Sort all entries, and attach elementtype.
* To be able to show the types in the listbox.
$cn = $attr['cn'][0];
if(in_array('FAIpackageList',$attr['objectClass'])){
$tmp2[$cn]['FAIpackageList']['obj'] = 'FAIpackageList';
- $tmp2[$cn]['FAIpackageList']['kzl'] = 'P';
+ $tmp2[$cn]['FAIpackageList']['kzl'] = 'Pl';
$this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
}
if(in_array('FAItemplate',$attr['objectClass'])){
$tmp2[$cn]['FAIpartitionTable']['kzl']= 'Pt';
$this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
}
+ if(in_array('FAIprofile',$attr['objectClass'])){
+ $tmp2[$cn]['FAIprofile']['obj']= 'FAIprofile';
+ $tmp2[$cn]['FAIprofile']['kzl']= 'P';
+ $this->FAIclasses[$attr['cn'][0]]=$attr['cn'][0];
+ }
}
$this->FAIclassInfo = $tmp2;
- if(isset($this->attrs['FAIclass'])){
+ if((isset($this->FAIclass))&&(!is_array($this->FAIclass))){
$tmp = array();
- $tmp2 = $this->attrs['FAIclass'];
- unset($tmp2['count']);
- foreach($tmp2 as $class){
- $tmp[$class] = $class;
+ $tmp = split(" ",$this->FAIclass);
+ $tmp2 =array();
+
+ foreach($tmp as $class){
+ $tmp2[$class] = $class;
}
- $this->FAIclass = $tmp;
+ $this->FAIclass = $tmp2;
}
if(!is_array($this->FAIclass)){
- $this->FAIclass = array();
+ $this->FAIclass =array();
}
-
$this->orig_dn= $this->dn;
}
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'.");
function execute()
{
+ /* Call parent execute */
+ plugin::execute();
+
/* Do we need to flip is_account state? */
if (isset($_POST['modify_state'])){
$this->is_account= !$this->is_account;
}
}
- if((isset($this->FAIclassInfo[$_POST['FAIclassesSel']]['FAIpackageList']))&&($found>0)){
- print_red(_("There is already a profile in your selection that contain partition table configuratons."));
+ if((isset($this->FAIclassInfo[$_POST['FAIclassesSel']]['FAIpartitionTable']))&&($found>0)){
+ print_red(_("There is already a profile in your selection that contain partition table configurations."));
}else{
$this->FAIclass[$_POST['FAIclassesSel']]=$_POST['FAIclassesSel'];
}
$a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']];
$s_mount = $_POST['gotoShareMountPoint'];
/* Preparing the new assignment */
- $this->gotoShares[$a_share['name']]=$a_share;
- $this->gotoShares[$a_share['name']]['mountPoint']=$s_mount;
+ $this->gotoShares[$a_share['name']."|".$a_share['server']]=$a_share;
+ $this->gotoShares[$a_share['name']."|".$a_share['server']]['mountPoint']=$s_mount;
}
}
$ldap= $this->config->get_ldap_link();
plugin::remove_from_parent();
-
+
+ /* Remove additional attributes.*/
foreach(array("gotoModules", "gotoAutoFs", "gotoFilesystem") as $attr){
$this->attrs [$attr] = array();
}
$this->gotoKernelParameters.= " o ".$this->customParameters;
}
- /* Create numeric index for our classes */
- $tmp = array();
+ plugin::save();
+
+ $str = "";
foreach($this->FAIclass as $class){
- $tmp[] = $class;
+ $str .= $class." ";
}
- $this->FAIclass = $tmp;
+ $this->attrs['FAIclass']= "";
+ $this->attrs['FAIclass']= trim($str);
- plugin::save();
+ if(empty($this->attrs['FAIclass'])){
+ $this->attrs['FAIclass'] = array();
+ }
/* Add missing arrays */
foreach (array("gotoFilesystem", "gotoAutoFs", "gotoModules") as $val){
unset ($this->attrs['gotoLdapServer']);
}
- $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 = "";
/* prepare share settings */
$tmp = array();
foreach($this->gotoShares as $name => $settings){
+ $tmp2= split("\|",$name);
+ $name = $tmp2[0];
$tmp[] = $settings['server']."|".$name."|".$settings['mountPoint'];
}
$this->attrs['gotoShare']=$tmp;