From 6f781aad660a629494ac231fe23b900966165108 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 17 Oct 2005 09:41:54 +0000 Subject: [PATCH] A little bit better. Check for partition table entries. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1581 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../systems/class_workstationStartup.inc | 45 +++++++++++++------ plugins/admin/systems/workstationStartup.tpl | 2 +- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index f9548a12c..b994a16c5 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -192,11 +192,26 @@ class workstartup extends plugin } /* FAI class management */ - if((isset($_POST['AddClass']))&&(isset($_POST['FAIclassesSel']))){ - $this->FAIclass[$_POST['FAIclassesSel']]=$_POST['FAIclassesSel']; - } + $found = 0 ; + + foreach($this->FAIclass as $name){ + if(isset($this->FAIclassInfo[$name])){ + foreach($this->FAIclassInfo[$name] as $atr){ + if($atr['obj'] == "FAIpartitionTable"){ + $found ++ ; + } + } + } + } + + if((isset($this->FAIclassInfo[$_POST['FAIclassesSel']]['FAIpackageList']))&&($found>0)){ + print_red(_("There is already a profile in your selection that contain partition table configuratons.")); + }else{ + $this->FAIclass[$_POST['FAIclassesSel']]=$_POST['FAIclassesSel']; + } + } if((isset($_POST['DelClass']))&&(isset($_POST['FAIclassSel']))){ if(isset($this->FAIclass[$_POST['FAIclassSel']])){ @@ -204,15 +219,6 @@ class workstartup extends plugin } } - - - - - - - - - /* Show main page */ $smarty= get_smarty(); @@ -397,9 +403,20 @@ class workstartup extends plugin foreach($this->FAIclass as $class){ $tmp[] = $class; } - $this->FAIclass = $tmp; + $this->attrs['FAIclass'] = $tmp; /* Write back to ldap */ - + + if(count($this->attrs['FAIclass'])==0){ + $tmp = array(); + foreach($this->attrs['objectClass'] as $class){ + if($class != "FAIobject"){ + $tmp[] = $class; + } + } + $this->attrs['objectClass'] = $tmp; + $this->attrs['FAIclass'] = array();; + } + $ldap= $this->config->get_ldap_link(); $ldap->cd($this->dn); diff --git a/plugins/admin/systems/workstationStartup.tpl b/plugins/admin/systems/workstationStartup.tpl index 3c0bd3edf..2fcb2918c 100644 --- a/plugins/admin/systems/workstationStartup.tpl +++ b/plugins/admin/systems/workstationStartup.tpl @@ -33,7 +33,7 @@ {t}Assigned FAI classes{/t}
- {html_options values=$FAIclass output=$FAIclassKeys} -- 2.30.2