Code

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

plugins/gofon/conference/class_phoneConferenceGeneric.inc

index 17a191c06b1f5deb38fd7928153a8f37fd543d60..555f5e3f932f5b492ca3324ace6983edf0b45040 100644 (file)
@@ -40,6 +40,8 @@ class conference extends plugin
 
   var $goFonConferenceOwner    = "";
 
+  var $error_shown = false;
+
   var $goFonConferenceOptionFormat             = "";
   var $goFonConferenceOptionLifetime   = "";
   var $telephoneNumber                 = "";
@@ -230,6 +232,15 @@ class conference extends plugin
     $a_SETUP = $_SESSION['config']->data['SERVERS']['FON'];
 
     // Connect to DB server
+    $r_con = false;    
+
+    if(!is_callable("mysql_pconnect")){
+      if(!$this->error_shown){
+        print_red(_("Can't save any changes to asterisk database, there is currently no mysql extension available in your php setup."));
+        $this->error_shown = true;
+      }
+      return(true);
+    }
     $r_con =  @mysql_pconnect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']);
 
     // Check if we are  connected correctly
@@ -333,6 +344,13 @@ class conference extends plugin
   }
 
   function SQL_remove_me($save){
+    if(!is_callable("mysql_pconnect")){
+      if(!$this->error_shown){
+        print_red(_("Can't save any changes to asterisk database, there is currently no mysql extension available in your php setup."));
+        $this->error_shown = true;
+      }
+      return(true);
+    }
 
     if($this->old_tele_number){
       // Get Configuration for Mysql database Server