Code

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

plugins/gofax/reports/class_faxreport.inc

index fe0153c415f26dd76feb33cbb97609a091bb6350..0bddbf0ed62575f4d47601391adc615d340d5269 100644 (file)
@@ -95,6 +95,12 @@ class faxreport extends plugin
 
                /* Connecting, selecting database */
                $cfg= $this->config->data['SERVERS']['FAX'];
+
+               if(!is_callable("mysql_connect")){
+                       print_red(_("There is no mysql extension available, please check your php setup."));    
+                       return; 
+               }               
+
                $link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);
                if ($link === FALSE){
                        print_red(_("Can't connect to fax database, no reports can be shown!"));
@@ -200,6 +206,11 @@ class faxreport extends plugin
                        "WHERE ( ".$this->userfilter." ) AND queuing_time <= $end AND ".
                        "queuing_time >= $start ORDER BY ".$this->fields[$this->sort]." $desc;";
 
+               if(!is_callable("mysql_connect")){
+                       print_red("There is no mysql extension configured in your php setup.");
+                       return;
+               }
+
                /* Connecting, selecting database */
                $cfg= $this->config->data['SERVERS']['FAX'];
                $link = @mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD']);