summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ab7fa43)
raw | patch | inline | side by side (parent: ab7fa43)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Jan 2008 14:28:26 +0000 (14:28 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Jan 2008 14:28:26 +0000 (14:28 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8669 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/glpi/admin/systems/services/glpi/class_glpi.inc | patch | blob | history |
diff --git a/gosa-plugins/glpi/admin/systems/services/glpi/class_glpi.inc b/gosa-plugins/glpi/admin/systems/services/glpi/class_glpi.inc
index 162e0fed6eab5f97e5e5e4e9d4fd7c1300d13381..d66e66352259f454caaec0930da3147d88c207d2 100644 (file)
asort($ret);
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if(isset($tmp[0])){
return($this->query("UPDATE glpi_type_computers SET name='".$name."' WHERE ID=".$id.";"));
}else{
- echo "can't update not existing entry";
+ trigger_error("can't update not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if($this->is_connected){
$tmp = $this->query("SELECT * FROM glpi_type_computers WHERE name='".$name."';");
if(isset($tmp[0])){
- echo "such an entry already exists";
+ trigger_error("such an entry already exists");
return(false);
}else{
return($this->query("INSERT INTO glpi_type_computers (name) VALUES ('".$name."');"));
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if(isset($tmp[0])){
return($this->query("DELETE FROM glpi_type_computers WHERE ID=".$id.";"));
}else{
- echo "can't remove not existing entry";
+ trigger_error("can't remove not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$tmp = $this->query("SELECT * FROM glpi_enterprises WHERE ID=".$id.";");
return($tmp);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
function updateEnterprise($array,$id)
{
if(!is_array($array)){
- echo "updateEnterprisesType: first paraeter must be an array";
+ trigger_error("updateEnterprisesType: first paraeter must be an array");
}elseif($this->is_connected){
$tmp = $this->query("SELECT * FROM glpi_enterprises WHERE ID='".$id."';");
if(isset($tmp[0])){
}
}
if(empty($v)){
- echo "updateEnterprisesType: no attributes given ";
+ trigger_error("updateEnterprisesType: no attributes given ");
return(false);
}else{
$v = preg_replace("/, $/","",$v);
return($this->query("UPDATE glpi_enterprises SET ".$v." WHERE ID='".$id."';"));
}
}else{
- echo "can't update not existing entry";
+ trigger_error("can't update not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
function addEnterprise($array)
{
if(!is_array($array)){
- echo "addUser: first paraeter must be an array";
+ trigger_error("addUser: first paraeter must be an array");
}elseif($this->is_connected){
$atr = array("ID","name","type","address","website","phonenumber","comments","deleted","fax","email");
$v = "";
}
}
if(empty($v)){
- echo "addUser: no attributes given ";
+ trigger_error("addUser: no attributes given ");
return(false);
}else{
$a = preg_replace("/, $/","",$a);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
if(isset($tmp[0])){
return($this->query("DELETE FROM glpi_enterprises WHERE ID=".$id.";"));
}else{
- echo "can't remove not existing entry";
+ trigger_error("can't remove not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if($this->is_connected){
$tmp = $this->query("SELECT * FROM glpi_dropdown_os WHERE name='".$name."';");
if(isset($tmp[0])){
- echo "such an entry already exists";
+ trigger_error("such an entry already exists");
return(false);
}else{
return($this->query("INSERT INTO glpi_dropdown_os (name) VALUES ('".$name."');"));
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if(is_array($tmp[0])){
return($this->query("DELETE FROM glpi_dropdown_os WHERE ID=".$id.";"));
}else{
- echo "can't remove not existing entry";
+ trigger_error("can't remove not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if(isset($tmp[0])){
return($this->query("UPDATE glpi_dropdown_os SET name='".$name."' WHERE ID=".$id.";"));
}else{
- echo "can't update not existing entry";
+ trigger_error("can't update not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
function addUser($array,$dn)
{
if(!is_array($array)){
- echo "addUser: first paraeter must be an array";
+ trigger_error("addUser: first paraeter must be an array");
}elseif($this->is_connected){
$array['name']=$dn;
$atr = array("name","phone","email");
}
}
if(empty($v)){
- echo "addUser: no attributes given ";
+ trigger_error("addUser: no attributes given ");
return(false);
}else{
$a = preg_replace("/, $/","",$a);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
function updateUser($array,$dn)
{
if(!is_array($array)){
- echo "updateUser: first paraeter must be an array";
+ trigger_error("updateUser: first paraeter must be an array");
}elseif($this->is_connected){
$tmp = $this->query("SELECT * FROM glpi_users WHERE name='".$dn."';");
if(isset($tmp[0])){
}
}
if(empty($v)){
- echo "UpdateUser: no attributes given ";
+ trigger_error("UpdateUser: no attributes given ");
return(false);
}else{
$v = preg_replace("/, $/","",$v);
return($this->query("UPDATE glpi_users SET ".$v." WHERE name='".$dn."';"));
}
}else{
- echo "can't update not existing entry";
+ trigger_error("can't update not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
$ret = $this->query("SELECT * FROM glpi_computers WHERE name='".$name."';");
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
function updateComputerInformations($array,$name)
{
if(!is_array($array)){
- echo "updateComputerInformations: first paraeter must be an array";
+ trigger_error("updateComputerInformations: first paraeter must be an array");
}elseif($this->is_connected){
$tmp = $this->query("SELECT * FROM glpi_computers WHERE name='".$name."';");
if(isset($tmp[0])){
}
}
if(empty($v)){
- echo "updateComputerInformations: no attributes given ";
+ trigger_error("updateComputerInformations: no attributes given ");
return(false);
}else{
$v = preg_replace("/, $/","",$v);
return($this->query("UPDATE glpi_computers SET ".$v." WHERE name='".$name."';"));
}
}else{
- echo "can't update not existing entry";
+ trigger_error("can't update not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
function addComputerInformations($array)
{
if(!is_array($array)){
- echo "updateComputerInformations: first paraeter must be an array";
+ trigger_error("updateComputerInformations: first paraeter must be an array");
}elseif($this->is_connected){
$atr = array( "ID","name","serial","otherserial","contact","contact_num",
"tech_num","comments","date_mod","os","location","domain","network",
}
}
if(empty($v)){
- echo "updateComputerInformations: no attributes given ";
+ trigger_error("updateComputerInformations: no attributes given ");
return(false);
}else{
$a = preg_replace("/, $/","",$a);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
return($ret);//count($this->query($str)));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
$this->query("DELETE FROM ".$tbl_name." WHERE ID=".$attr['ID'].";");
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$str .= " WHERE ID=".$attr['ID'].";";
$this->query($str);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$v .= "'".$value."', ";
}
if(empty($v)){
- echo "addDevice: no attributes given ";
+ trigger_error("addDevice: no attributes given ");
return(false);
}else{
$a = preg_replace("/, $/","",$a);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($res);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
$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";
+ trigger_error("can't remove not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$this->query($str);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$ret = $this->query($qry);
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$qry = "DELETE FROM glpi_docs WHERE ID=".$id."";
$this->query($qry);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$this->query($str);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
// return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
// return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$qry= "DELETE FROM glpi_monitors WHERE ID=".$id.";";
$this->query($qry);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$qry= "SELECT * FROM glpi_dropdown_state;";
return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$ret = $this->query("SELECT * FROM glpi_printers WHERE name='".$name."';");
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$ret = $this->query($qry);
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if($this->is_connected){
$tmp = $this->query("SELECT * FROM glpi_type_printers WHERE name='".$name."';");
if(isset($tmp[0])){
- //echo "such an entry already exists";
+ //trigger_error("such an entry already exists");
return(false);
}else{
return($this->query("INSERT INTO glpi_type_printers (name) VALUES ('".$name."');"));
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if(isset($tmp[0])){
return($this->query("DELETE FROM glpi_type_printers WHERE ID=".$id.";"));
}else{
- echo "can't remove not existing entry";
+ trigger_error("can't remove not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if(isset($tmp[0])){
return($this->query("UPDATE glpi_type_printers SET name='".$name."' WHERE ID=".$id.";"));
}else{
- echo "can't update not existing entry";
+ trigger_error("can't update not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
function updatePrinterInformations($array,$name)
{
if(!is_array($array)){
- echo "updatePrinterInformations: first paraeter must be an array";
+ trigger_error("updatePrinterInformations: first paraeter must be an array");
}elseif($this->is_connected){
$tmp = $this->query("SELECT * FROM glpi_printers WHERE name='".$name."';");
if(isset($tmp[0])){
}
}
if(empty($v)){
- echo "updateSystemInformations: no attributes given ";
+ trigger_error("updateSystemInformations: no attributes given ");
return(false);
}else{
$v = preg_replace("/, $/","",$v);
return($this->query("UPDATE glpi_printers SET ".$v." WHERE name='".$name."';"));
}
}else{
- echo "can't update not existing entry";
+ trigger_error("can't update not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
function addPrinterInformations($array)
{
if(!is_array($array)){
- echo "updateComputerInformations: first paraeter must be an array";
+ trigger_error("updateComputerInformations: first paraeter must be an array");
}elseif($this->is_connected){
$atr = array( "ID","name","serial","otherserial","contact","contact_num",
"tech_num","comments","date_mod","os","location","domain","network","ramSize","flags_serial","flags_par","flags_usb",
}
}
if(empty($v)){
- echo "updateComputerInformations: no attributes given ";
+ trigger_error("updateComputerInformations: no attributes given ");
return(false);
}else{
$a = preg_replace("/, $/","",$a);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$this->query($str);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$this->query("DELETE FROM glpi_doc_device WHERE FK_device=".$id." AND device_type=3;");
return($this->query("DELETE FROM glpi_printers WHERE ID=".$id.";"));
}else{
- echo "can't remove not existing entry";
+ trigger_error("can't remove not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$qry = "DELETE FROM glpi_cartridges WHERE ID=".$cartridgeID.";";
return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
(".$cartridgeID.",".$printerID.",'".date("Y-m-d")."','".date("Y-m-d")."');";
return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
function Add_UpdateCatrigdeType($array,$array_printer_types)
{
if(!is_array($array)){
- echo "Add_UpdateCatrigdeType: first paraeter must be an array";
+ trigger_error("Add_UpdateCatrigdeType: first paraeter must be an array");
}elseif($this->is_connected){
}
}
if(empty($v)){
- echo "Add_UpdateCatrigdeType: no attributes given ";
+ trigger_error("Add_UpdateCatrigdeType: no attributes given ");
return(false);
}else{
$v = preg_replace("/, $/","",$v);
$this->query($str);
$IDs = $this->query("SELECT ID FROM glpi_cartridges_type WHERE name='".$array['name']."';");
if(count($IDs) > 1){
- echo "internal db error";
+ trigger_error("internal db error");
return;
}
$array['ID'] = $IDs[0]['ID'];
$this->query($qry);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$qry = "DELETE FROM glpi_cartridges_type WHERE ID=".$id.";";
return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
$ret = $this->query($qry);
return($ret);
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if($this->is_connected){
$tmp = $this->query("SELECT * FROM glpi_dropdown_cartridge_type WHERE name='".$name."';");
if(isset($tmp[0])){
- //echo "such an entry already exists";
+ //trigger_error("such an entry already exists");
return(false);
}else{
return($this->query("INSERT INTO glpi_dropdown_cartridge_type (name) VALUES ('".$name."');"));
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if(isset($tmp[0])){
return($this->query("DELETE FROM glpi_dropdown_cartridge_type WHERE ID=".$id.";"));
}else{
- echo "can't remove not existing entry";
+ trigger_error("can't remove not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
if(isset($tmp[0])){
return($this->query("UPDATE glpi_dropdown_cartridge_type SET name='".$name."' WHERE ID=".$id.";"));
}else{
- echo "can't update not existing entry";
+ trigger_error("can't update not existing entry");
return(false);
}
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}
}
return($this->query($qry));
}else{
- echo "not connected";
+ trigger_error("not connected");
return(false);
}
}