Code

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

plugins/admin/users/class_userManagement.inc

index 3035d85141db10113f731c651b45193f8c1ec457..1b81ca4dbbbb92b9e90c39e3b69ec6fdb4532420 100644 (file)
@@ -768,10 +768,14 @@ class userManagement extends plugin
       /* 
         If you want to disable the status pictures, just comment out the next line
       */
-      $r_con= @mysql_pconnect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']);
-      // Check if we are  connected correctly
-      if($r_con){
-        $r_db  =  @mysql_select_db($a_SETUP['DB'],$r_con);
+      $r_con = false;
+      $r_db  = false;
+      if(is_callable("mysql_pconnect")){
+        $r_con= @mysql_pconnect($a_SETUP['SERVER'],$a_SETUP['LOGIN'],$a_SETUP['PASSWORD']);
+        // Check if we are  connected correctly
+        if($r_con){
+          $r_db  =  @mysql_select_db($a_SETUP['DB'],$r_con);
+        }
       }
     }
 
@@ -787,7 +791,7 @@ class userManagement extends plugin
         $fonac = preg_replace("/%title%/", "", $fonac);
 
         /* Database connection is ok ?*/
-        if($r_db){
+        if(($r_db)&&(is_callable("mysql_query"))){
           $res= @mysql_query("SELECT regseconds,name,port,ipaddr FROM ".$a_SETUP['SIP_TABLE']." WHERE (name='".$val['uid'][0]."')");
           $mysql_entry = @mysql_fetch_row($res);
           if(is_array($mysql_entry)){
@@ -913,7 +917,9 @@ class userManagement extends plugin
     $smarty->assign("alphabet", generate_alphabet());
     $smarty->assign("hint", print_sizelimit_warning());
 
-    @mysql_close($r_con);
+    if((is_callable("mysql_close"))&&($r_con)){
+      @mysql_close($r_con);
+    }
     return ($smarty->fetch(get_template_path('headpage.tpl', TRUE)));
   }