From fd371701caeedb9b860f34d3cf1e086d89e7a181 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 14 Nov 2005 12:55:59 +0000 Subject: [PATCH] PHP Fehler "array_flip(): The argument should be an array" ---This line, and those below, will be ignored-- M plugins/admin/applications/class_applicationGeneric.inc M plugins/admin/systems/class_printGeneric.inc M include/class_ppdManager.inc git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1939 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ppdManager.inc | 7 ++++++- plugins/admin/applications/class_applicationGeneric.inc | 3 ++- plugins/admin/systems/class_printGeneric.inc | 3 +-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/class_ppdManager.inc b/include/class_ppdManager.inc index d44ef604e..1b09debc0 100644 --- a/include/class_ppdManager.inc +++ b/include/class_ppdManager.inc @@ -7,7 +7,12 @@ class ppdManager function ppdManager($path) { + if(is_dir($path)){ $this->path= $path; + }else{ + print_red(sprintf(_("PPD manager : The specified path '%s' doesn't exists."),$path)); + return (false); + } } @@ -234,7 +239,7 @@ class ppdManager $manufacturer= ""; $fh= fopen ($ppdFile, 'r'); - while (!feof($fh)) { + while ((!feof($fh))&&($fh)) { /* Read line */ $line= fgets($fh, 256); diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 7c4c2c41b..e5f4ec7b3 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -17,7 +17,7 @@ class application extends plugin var $gosaApplicationCategory= ""; var $gotoLogonScript =""; var $iconData; - var $Categories; + var $Categories = array();; /* Headpage attributes */ var $last_sorting= "invalid"; @@ -43,6 +43,7 @@ class application extends plugin $tmp->parseMenu($path); $this->Categories = $tmp->GetData(); }else{ + $this->Categories= array(); print_red(sprintf(_("The specified file '%s' for 'KDE_APPLICATIONS_MENU' in your gosa.conf is not accessable."),$path)); } } diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 2641ae79e..cdac388b0 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -522,8 +522,7 @@ class printgeneric extends plugin if(!is_array($this->attrs['gotoPrinterPPD'])) { $this->attrs['gotoPrinterPPD'] = $this->attrs['gotoPrinterPPD']; - $this->attrs['gotoPrinterPPD'] = $method.$_SERVER['SERVER_NAME']."/ppd/". - str_replace("//","/",$this->attrs['gotoPrinterPPD']); + $this->attrs['gotoPrinterPPD'] = $method.str_replace("//","/",$_SERVER['SERVER_NAME']."/ppd/".$this->attrs['gotoPrinterPPD']); } /* Append printer user -- 2.30.2