Code

Fixed white page if no mysql extension was present
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 18 Nov 2005 06:06:33 +0000 (06:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 18 Nov 2005 06:06:33 +0000 (06:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1965 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/logview/class_logview.inc

index d716acf479998f5b5ca21073ec75fe6d917e7414..e97f68b7e786236275beb3f1a1d50fe8e371ebeb 100644 (file)
@@ -36,7 +36,11 @@ class logview extends plugin
                print_red (_("No LOG servers defined!"));
                return;
        }
-       
+
+       if(!is_callable("mysql_connect")){
+               return;
+       }
+
        $cfg= $this->config->data['SERVERS']['LOG'];
        $tmp= set_error_handler('dummy_error_handler');
        $link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);
@@ -94,6 +98,13 @@ class logview extends plugin
                return;
        }
 
+    if(!is_callable("mysql_connect")){
+        print_red(_("There is no mysql extension available in your php setup, can't perform any query."));
+        return;
+    }
+
+
+
         /* Save data */
         $logfilter= get_global("logfilter");
         foreach( array("host", "time", "log_level", "regex") as $type){