From: hickert Date: Mon, 29 May 2006 09:18:50 +0000 (+0000) Subject: Added check to avoid adding empty share X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=85babad2e528330fd6e24dafec86a05bd9c85798;p=gosa.git Added check to avoid adding empty share git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3539 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index cf53ff272..5f1952d12 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -609,11 +609,13 @@ class workstartup extends plugin if((!isset($_POST['gotoShareMountPoint']))||(empty($_POST['gotoShareMountPoint']))||(preg_match("/[\|]/i",$_POST['gotoShareMountPoint']))){ print_red(_("You must specify a valid mount point.")); }else{ - $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']]; - $s_mount = $_POST['gotoShareMountPoint']; - /* Preparing the new assignment */ - $this->gotoShares[$a_share['name']."|".$a_share['server']]=$a_share; - $this->gotoShares[$a_share['name']."|".$a_share['server']]['mountPoint']=$s_mount; + if(count($this->gotoAvailableShares)){ + $a_share = $this->gotoAvailableShares[$_POST['gotoShareSelection']]; + $s_mount = $_POST['gotoShareMountPoint']; + /* Preparing the new assignment */ + $this->gotoShares[$a_share['name']."|".$a_share['server']]=$a_share; + $this->gotoShares[$a_share['name']."|".$a_share['server']]['mountPoint']=$s_mount; + } } } @@ -625,6 +627,7 @@ class workstartup extends plugin } $smarty->assign("gotoShares",$this->printOutAssignedShares()); + $smarty->assign("gotoSharesCount",count($this->printOutAssignedShares())); $smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares())); $smarty->assign("gotoBootKernels",$this->gotoBootKernels); diff --git a/plugins/admin/systems/workstationStartup.tpl b/plugins/admin/systems/workstationStartup.tpl index 9466a5092..7c4c25397 100644 --- a/plugins/admin/systems/workstationStartup.tpl +++ b/plugins/admin/systems/workstationStartup.tpl @@ -131,17 +131,17 @@
- +