Code

Added check to preent white screen
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 May 2006 11:07:40 +0000 (11:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 3 May 2006 11:07:40 +0000 (11:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3194 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_glpiAccount.inc

index 353bf8e3fdf74250df6f0b08b8ac1baf18b9e098..0f8733c95fc264f5fb6b15c8577578215151bb5f 100644 (file)
@@ -652,9 +652,16 @@ class glpiAccount extends plugin
 
   function remove_from_parent()
   {
-    $this->handle = new glpiDB($this->data['SERVER'],$this->data['LOGIN'],$this->data['PASSWORD'],$this->data['DB']);
-    if($this->initialy_was_account){
-      $this->handle->removeComputerInformations($this->dn); 
+    if(!$this->initialy_was_account){
+      return;
+    }
+    if(function_exists("mysql_pconnect")){
+      $this->handle = new glpiDB($this->data['SERVER'],$this->data['LOGIN'],$this->data['PASSWORD'],$this->data['DB']);
+      if($this->initialy_was_account){
+        $this->handle->removeComputerInformations($this->dn); 
+      }
+    }else{
+      print_red(_("Can't remove glpi account, while mysql extension is missing."));
     }
   
   }