Code

Some update
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jan 2006 06:46:39 +0000 (06:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jan 2006 06:46:39 +0000 (06:46 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2481 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_glpi.inc

index 207a9c388ed218d41faafe52f0d77bdf0b31ecf7..eb8c5fe95b79b8d2aa7505bf904763f368f3ff89 100644 (file)
@@ -825,12 +825,14 @@ class glpiDB{
 
        }
 
-       function removeComputerInformations($id)
+       function removeComputerInformations($name)
        {
-/*             
                if($this->is_connected){
-                       $tmp = $this->query("SELECT * FROM glpi_computers WHERE ID=".$id.";");
+                       $tmp = $this->query("SELECT * FROM glpi_computers WHERE name='".$name."';");
                        if(isset($tmp[0])){
+                               $id = $tmp[0]['ID'];
+                               $this->query("DELETE FROM glpi_connect_wire WHERE end2=".$id.";");
+                               $this->query("DELETE FROM glpi_computer_device WHERE FK_computers=".$id.";");
                                return($this->query("DELETE FROM glpi_computers WHERE ID=".$id.";"));
                        }else{
                                echo "can't remove not existing entry";
@@ -840,7 +842,6 @@ class glpiDB{
                        echo "not connected";
                        return(false);
                }
-*/
        }
 
        function is_connected()