From 2e274a95f271133237040d283b45eddc4c5a5518 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 10 Jul 2006 05:58:43 +0000 Subject: [PATCH] Updated workStartab, to handle empty release configurations git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4055 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/systems/class_workstationStartup.inc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/admin/systems/class_workstationStartup.inc b/plugins/admin/systems/class_workstationStartup.inc index a795da93a..7e13a94df 100644 --- a/plugins/admin/systems/class_workstationStartup.inc +++ b/plugins/admin/systems/class_workstationStartup.inc @@ -408,7 +408,7 @@ class workstartup extends plugin if(!in_array($this->FAIrelease, $tmp2)){ $this->FAIrelease = key($tmp2); } - + /* Get all Packages for this server/release combination */ if(!isset($this->FAIServRepConfig[$this->FAIdebianMirror]['RELEASE'][$this->FAIrelease]['PACKAGES'])){ @@ -828,8 +828,9 @@ class workstartup extends plugin $this->FAIdebianMirror = "auto"; } - $errorClasses = ""; - + $errorClasses = array(); + + if(is_array($this->FAIServRepConfig[$this->FAIdebianMirror]['RELEASE'])){ foreach($this->FAIServRepConfig[$this->FAIdebianMirror]['RELEASE'] as $release => $sections){ $use = true; @@ -849,6 +850,7 @@ class workstartup extends plugin $ret[$release]=$release; } } + } if((count($ret) == 0 ) && ($this->FAIdebianMirror != "auto")){ $eClasses = " "; @@ -865,9 +867,13 @@ class workstartup extends plugin foreach($errorClasses as $class){ $eClasses .= $class." "; } - - $this->FAIclass= array(); - print_red(sprintf(_("Can't resolve the given FAIclass(es) [%s] anyway, please check your FAI configurations, possibly some classes where deleted or renamed. !All classes have been removed from this account, press cancel if you don't want this to be saved."),$eClasses)); + + $eClasses = preg_replace("/ */","",$eClasses); + + if(!empty($eClasses)) { + $this->FAIclass= array(); + print_red(sprintf(_("Can't resolve the given FAIclass(es) [%s] anyway, please check your FAI configurations, possibly some classes where deleted or renamed. !All classes have been removed from this account, press cancel if you don't want this to be saved."),$eClasses)); + } } return($ret); } -- 2.30.2