From 592be50a0f9cc0985f29b126a711d0aaeb577cd9 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 15 Sep 2005 06:36:02 +0000 Subject: [PATCH] Fixed template Better check for undefined index goExportEntry in constructor Buttons wasn't disabled / enabled correctly with the checkbox goShareServer git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1365 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/systems/class_servService.inc | 32 ++++++++++++++++----- plugins/admin/systems/main.inc | 3 ++ plugins/admin/systems/servservice.tpl | 6 ++-- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/plugins/admin/systems/class_servService.inc b/plugins/admin/systems/class_servService.inc index 850a95515..2ee9fc90b 100644 --- a/plugins/admin/systems/class_servService.inc +++ b/plugins/admin/systems/class_servService.inc @@ -13,7 +13,7 @@ class servservice extends plugin var $goXdmcpIsEnabled = ""; var $goFontPath = ""; var $goNTPServer = ""; - var $goShareServer = ""; + var $goShareServer = false; var $goLdapServer = ""; var $goTerminalServer = ""; var $goSyslogServer = ""; @@ -57,17 +57,25 @@ class servservice extends plugin $tmp =array(); $tmp2=array(); - unset($this->attrs['goExportEntry']['count']); - if((isset($this->attrs['goExportEntry']))&&(isset($this->attrs['goExportEntry']))){ - foreach($this->attrs['goExportEntry'] as $entry){ - $tmp2= split("\|",$entry); - $tmp[$tmp2[0]]= $entry; + if(isset($this->attrs['goExportEntry'])){ + unset($this->attrs['goExportEntry']['count']); + if((isset($this->attrs['goExportEntry']))&&(isset($this->attrs['goExportEntry']))){ + foreach($this->attrs['goExportEntry'] as $entry){ + $tmp2= split("\|",$entry); + $tmp[$tmp2[0]]= $entry; + } } } $this->goExportEntry = $tmp; /* Always is account... */ $this->is_account= TRUE; + + if(is_array($this->attrs['objectClass'])){ + if(in_array("goShareServer",$this->attrs['objectClass'])){ + $this->goShareServer = true; + } + } } function addToList($entry){ @@ -182,8 +190,12 @@ class servservice extends plugin } } - if(!count($this->goExportEntry)){ + if(!$this->goShareServer){ $smarty->assign("goShareServerState", " disabled "); + $smarty->assign("goExportEntryACL", " disabled "); + }else{ + $smarty->assign("goShareServerState", " "); + $smarty->assign("goExportEntryACL", " "); } /* Different handling for checkbox */ @@ -227,6 +239,12 @@ class servservice extends plugin $this->goXdmcpIsEnabled= "false"; } + /* Save xdmcp is enabled flag */ + if (isset($_POST['goShareServer'])){ + $this->goShareServer = true; + } else { + $this->goShareServer = false; + } } } diff --git a/plugins/admin/systems/main.inc b/plugins/admin/systems/main.inc index a0f26d1cc..d4939a122 100644 --- a/plugins/admin/systems/main.inc +++ b/plugins/admin/systems/main.inc @@ -49,6 +49,9 @@ if ($remove_lock){ /* Show and save dialog */ $display.= $output; + $display.=""; $_SESSION['systems']= $systems; } diff --git a/plugins/admin/systems/servservice.tpl b/plugins/admin/systems/servservice.tpl index 9877289a3..ee52e76dd 100644 --- a/plugins/admin/systems/servservice.tpl +++ b/plugins/admin/systems/servservice.tpl @@ -2,8 +2,8 @@ - @@ -18,7 +18,7 @@
- + -- 2.30.2