Code

PHP Fehler "array_flip(): The argument should be an array"
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Nov 2005 12:55:59 +0000 (12:55 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Nov 2005 12:55:59 +0000 (12:55 +0000)
---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
plugins/admin/applications/class_applicationGeneric.inc
plugins/admin/systems/class_printGeneric.inc

index d44ef604eef6dab10d3e69797cea4652240ae507..1b09debc06fbfa04d3ca3f92f7cac2c85413d415 100644 (file)
@@ -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);
index 7c4c2c41b703857cbb0c1a937975eab30675c428..e5f4ec7b3ae995e16fd418c68527ece304cb9556 100644 (file)
@@ -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));
                }
        }
index 2641ae79e3ba78efd04eb48479f55c47fbb0e024..cdac388b00b7e25c6df545f46312cfb7c8adad01 100644 (file)
@@ -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