Changeset 6697
- Timestamp:
- 10/02/08 18:14:53 (7 weeks ago)
- Location:
- trunk/centreon/www/include/configuration/configObject
- Files:
-
- 9 modified
-
contact/DB-Func.php (modified) (3 diffs)
-
contactgroup/DB-Func.php (modified) (3 diffs)
-
escalation/DB-Func.php (modified) (8 diffs)
-
host_dependency/DB-Func.php (modified) (8 diffs)
-
hostgroup/DB-Func.php (modified) (5 diffs)
-
hostgroup_dependency/DB-Func.php (modified) (8 diffs)
-
servicegroup/DB-Func.php (modified) (7 diffs)
-
traps-manufacturer/DB-Func.php (modified) (7 diffs)
-
traps/DB-Func.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/centreon/www/include/configuration/configObject/contact/DB-Func.php
r6693 r6697 158 158 $maxId =& $DBRESULT->fetchRow(); 159 159 if (isset($maxId["MAX(contact_id)"])) { 160 $oreon->CentreonLogAction->insertLog("contact", $maxId["MAX(contact_id)"], $contact_name, "a", $fields);161 160 $DBRESULT =& $pearDB->query("SELECT DISTINCT command_command_id FROM contact_hostcommands_relation WHERE contact_contact_id = '".$key."'"); 162 161 if (PEAR::isError($DBRESULT)) 163 162 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 163 $fields["contact_hostNotifCmds"] = ""; 164 164 while($hostCmd =& $DBRESULT->fetchRow()) { 165 165 $DBRESULT2 =& $pearDB->query("INSERT INTO contact_hostcommands_relation VALUES ('', '".$maxId["MAX(contact_id)"]."', '".$hostCmd["command_command_id"]."')"); 166 166 if (PEAR::isError($DBRESULT2)) 167 167 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 168 $fields["contact_hostNotifCmds"] .= $hostCmd["command_command_id"] . ","; 168 169 } 170 $fields["contact_hostNotifCmds"] = trim($fields["contact_hostNotifCmds"], ","); 169 171 $DBRESULT =& $pearDB->query("SELECT DISTINCT command_command_id FROM contact_servicecommands_relation WHERE contact_contact_id = '".$key."'"); 170 172 if (PEAR::isError($DBRESULT)) 171 173 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 174 $fields["contact_svNotifCmds"] = ""; 172 175 while($serviceCmd =& $DBRESULT->fetchRow()) { 173 176 $DBRESULT2 =& $pearDB->query("INSERT INTO contact_servicecommands_relation VALUES ('', '".$maxId["MAX(contact_id)"]."', '".$serviceCmd["command_command_id"]."')"); 174 177 if (PEAR::isError($DBRESULT2)) 175 178 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 179 $fields["contact_svNotifCmds"] .= $serviceCmd["command_command_id"] . ","; 176 180 } 181 $fields["contact_svNotifCmds"] = trim($fields["contact_svNotifCmds"], ","); 177 182 $DBRESULT =& $pearDB->query("SELECT DISTINCT contactgroup_cg_id FROM contactgroup_contact_relation WHERE contact_contact_id = '".$key."'"); 178 183 if (PEAR::isError($DBRESULT)) 179 184 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 185 $fields["contact_cgNotif"] = ""; 180 186 while($Cg =& $DBRESULT->fetchRow()) { 181 187 $DBRESULT2 =& $pearDB->query("INSERT INTO contactgroup_contact_relation VALUES ('', '".$maxId["MAX(contact_id)"]."', '".$Cg["contactgroup_cg_id"]."')"); 182 188 if (PEAR::isError($DBRESULT2)) 183 189 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 190 $fields["contact_cgNotif"] .= $Cg["contactgroup_cg_id"] . ","; 184 191 } 192 $fields["contact_cgNotif"] = trim($fields["contact_cgNotif"], ","); 193 $oreon->CentreonLogAction->insertLog("contact", $maxId["MAX(contact_id)"], $contact_name, "a", $fields); 185 194 } 186 195 } … … 297 306 $fields["contact_ldap_dn"] = $ret["contact_ldap_dn"]; 298 307 $fields["contact_location"] = $ret["contact_location"]; 308 $fields["contact_hostNotifCmds"] = implode(",", $ret["contact_hostNotifCmds"]); 309 $fields["contact_svNotifCmds"] = implode(",", $ret["contact_svNotifCmds"]); 310 $fields["contact_cgNotif"] = implode(",", $ret["contact_cgNotif"]); 299 311 $oreon->CentreonLogAction->insertLog("contact", $contact_id["MAX(contact_id)"], $ret["contact_name"], "a", $fields); 300 312 … … 373 385 $fields["contact_ldap_dn"] = $ret["contact_ldap_dn"]; 374 386 $fields["contact_location"] = $ret["contact_location"]; 387 $fields["contact_hostNotifCmds"] = implode(",", $ret["contact_hostNotifCmds"]); 388 $fields["contact_svNotifCmds"] = implode(",", $ret["contact_svNotifCmds"]); 389 $fields["contact_cgNotif"] = implode(",", $ret["contact_cgNotif"]); 375 390 $oreon->CentreonLogAction->insertLog("contact", $contact_id, $ret["contact_name"], "c", $fields); 376 391 } -
trunk/centreon/www/include/configuration/configObject/contactgroup/DB-Func.php
r6665 r6697 121 121 $maxId =& $DBRESULT->fetchRow(); 122 122 123 if (isset($maxId["MAX(cg_id)"])) { 124 $oreon->CentreonLogAction->insertLog("contactgroup", $maxId["MAX(cg_id)"], $cg_name, "a", $fields); 123 if (isset($maxId["MAX(cg_id)"])) { 125 124 $DBRESULT =& $pearDB->query("SELECT DISTINCT `cgcr`.`contact_contact_id` FROM `contactgroup_contact_relation` `cgcr` WHERE `cgcr`.`contactgroup_cg_id` = '".$key."'"); 126 125 if (PEAR::isError($DBRESULT)) 127 126 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 127 $fields["cg_contacts"] = ""; 128 128 while($cct =& $DBRESULT->fetchRow()) { 129 129 $DBRESULT2 =& $pearDB->query("INSERT INTO `contactgroup_contact_relation` VALUES ('', '".$cct["contact_contact_id"]."', '".$maxId["MAX(cg_id)"]."')"); 130 130 if (PEAR::isError($DBRESULT2)) 131 131 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 132 $fields["cg_contacts"] .= $cct["contact_contact_id"] . ","; 132 133 } 134 $fields["cg_contacts"] = trim($fields["cg_contacts"], ","); 135 $oreon->CentreonLogAction->insertLog("contactgroup", $maxId["MAX(cg_id)"], $cg_name, "a", $fields); 133 136 } 134 137 } … … 163 166 $fields["cg_comment"] = htmlentities($ret["cg_comment"], ENT_QUOTES); 164 167 $fields["cg_activate"] = $ret["cg_activate"]["cg_activate"]; 168 $fields["cg_contacts"] = implode(",", $ret["cg_contacts"]); 165 169 $oreon->CentreonLogAction->insertLog("contactgroup", $cg_id["MAX(cg_id)"], htmlentities($ret["cg_name"], ENT_QUOTES), "a", $fields); 166 170 return ($cg_id["MAX(cg_id)"]); … … 193 197 $fields["cg_comment"] = htmlentities($ret["cg_comment"], ENT_QUOTES); 194 198 $fields["cg_activate"] = $ret["cg_activate"]["cg_activate"]; 199 $fields["cg_contacts"] = implode(",", $ret["cg_contacts"]); 195 200 $oreon->CentreonLogAction->insertLog("contactgroup", $cg_id, htmlentities($ret["cg_name"], ENT_QUOTES), "c", $fields); 196 201 } -
trunk/centreon/www/include/configuration/configObject/escalation/DB-Func.php
r6646 r6697 40 40 41 41 function deleteEscalationInDB ($escalations = array()) { 42 global $pearDB ;42 global $pearDB, $oreon; 43 43 foreach($escalations as $key=>$value) { 44 $DBRESULT2 =& $pearDB->query("SELECT esc_name FROM `escalation` WHERE `esc_id` = '".$key."' LIMIT 1"); 45 if (PEAR::isError($DBRESULT2)) 46 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 47 $row = $DBRESULT2->fetchRow(); 48 44 49 $DBRESULT =& $pearDB->query("DELETE FROM escalation WHERE esc_id = '".$key."'"); 45 50 if (PEAR::isError($DBRESULT)) 46 51 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 52 $oreon->CentreonLogAction->insertLog("escalation", $key, $row['esc_name'], "d"); 47 53 } 48 54 } … … 50 56 function multipleEscalationInDB ($escalations = array(), $nbrDup = array()) { 51 57 foreach($escalations as $key=>$value) { 52 global $pearDB ;58 global $pearDB, $oreon; 53 59 $DBRESULT =& $pearDB->query("SELECT * FROM escalation WHERE esc_id = '".$key."' LIMIT 1"); 54 60 if (PEAR::isError($DBRESULT)) … … 61 67 $key2 == "esc_name" ? ($esc_name = $value2 = $value2." ".$i) : null; 62 68 $val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL"); 69 if ($key2 != "esc_id") 70 $fields[$key2] = $value2; 71 $fields["esc_name"] = $esc_name; 63 72 } 64 73 if (testExistence($esc_name)) { … … 75 84 if (PEAR::isError($DBRESULT)) 76 85 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 86 $fields["esc_cgs"] = ""; 77 87 while($cg =& $DBRESULT->fetchRow()) { 78 88 $DBRESULT2 =& $pearDB->query("INSERT INTO escalation_contactgroup_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$cg["contactgroup_cg_id"]."')"); 79 89 if (PEAR::isError($DBRESULT2)) 80 90 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 81 } 91 $fields["esc_cgs"] .= $cg["contactgroup_cg_id"] . ","; 92 } 93 $fields["esc_cgs"] = trim($fields["esc_cgs"], ","); 82 94 $DBRESULT =& $pearDB->query("SELECT DISTINCT host_host_id FROM escalation_host_relation WHERE escalation_esc_id = '".$key."'"); 83 95 if (PEAR::isError($DBRESULT)) 84 96 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 97 $fields["esc_hosts"] = ""; 85 98 while($host =& $DBRESULT->fetchRow()) { 86 99 $DBRESULT2 =& $pearDB->query("INSERT INTO escalation_host_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$host["host_host_id"]."')"); 87 100 if (PEAR::isError($DBRESULT2)) 88 101 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 89 } 102 $fields["esc_hosts"] .= $host["host_host_id"] . ","; 103 } 104 $fields["esc_hosts"] = trim($fields["esc_hosts"], ","); 90 105 $DBRESULT =& $pearDB->query("SELECT DISTINCT hostgroup_hg_id FROM escalation_hostgroup_relation WHERE escalation_esc_id = '".$key."'"); 91 106 if (PEAR::isError($DBRESULT)) 92 107 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 108 $fields["esc_hgs"] = ""; 93 109 while($hg =& $DBRESULT->fetchRow()) { 94 110 $DBRESULT2 =& $pearDB->query("INSERT INTO escalation_hostgroup_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$hg["hostgroup_hg_id"]."')"); 95 111 if (PEAR::isError($DBRESULT2)) 96 112 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 97 } 113 $fields["esc_hgs"] .= $hg["hostgroup_hg_id"] . ","; 114 } 115 $fields["esc_hgs"] = trim($fields["esc_hgs"], ","); 98 116 $DBRESULT =& $pearDB->query("SELECT DISTINCT servicegroup_sg_id FROM escalation_servicegroup_relation WHERE escalation_esc_id = '".$key."'"); 99 117 if (PEAR::isError($DBRESULT)) 100 118 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 119 $fields["esc_sgs"] = ""; 101 120 while($sg =& $DBRESULT->fetchRow()) { 102 121 $DBRESULT2 =& $pearDB->query("INSERT INTO escalation_servicegroup_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$sg["servicegroup_sg_id"]."')"); 103 122 if (PEAR::isError($DBRESULT2)) 104 123 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 105 } 124 $fields["esc_sgs"] .= $sg["servicegroup_sg_id"] . ","; 125 } 126 $fields["esc_sgs"] = trim($fields["esc_sgs"], ","); 106 127 $DBRESULT =& $pearDB->query("SELECT * FROM escalation_service_relation WHERE escalation_esc_id = '".$key."'"); 107 128 if (PEAR::isError($DBRESULT)) 108 129 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 130 $fields["esc_hServices"] = ""; 109 131 while($sv =& $DBRESULT->fetchRow()) { 110 132 $DBRESULT2 =& $pearDB->query("INSERT INTO escalation_service_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$sv["service_service_id"]."', '".$sv["host_host_id"]."')"); 111 133 if (PEAR::isError($DBRESULT2)) 112 134 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 113 } 135 $fields["esc_hServices"] .= $sv["service_service_id"] . ","; 136 } 137 $fields["esc_hServices"] = trim($fields["esc_hServices"], ","); 114 138 $DBRESULT =& $pearDB->query("SELECT DISTINCT meta_service_meta_id FROM escalation_meta_service_relation WHERE escalation_esc_id = '".$key."'"); 115 139 if (PEAR::isError($DBRESULT)) 116 140 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 141 $fields["esc_metas"] = ""; 117 142 while($sv =& $DBRESULT->fetchRow()) { 118 143 $DBRESULT2 =& $pearDB->query("INSERT INTO escalation_meta_service_relation VALUES ('', '".$maxId["MAX(esc_id)"]."', '".$sv["meta_service_meta_id"]."')"); 119 144 if (PEAR::isError($DBRESULT2)) 120 145 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 121 } 146 $fields["esc_metas"] .= $sv["meta_service_meta_id"] . ","; 147 } 148 $fields["esc_metas"] = trim($fields["esc_metas"], ","); 149 $oreon->CentreonLogAction->insertLog("escalation", $maxId["MAX(esc_id)"], $esc_name, "a"); 122 150 } 123 151 } … … 150 178 function insertEscalation() { 151 179 global $form; 152 global $pearDB ;180 global $pearDB, $oreon; 153 181 $ret = array(); 154 182 $ret = $form->getSubmitValues(); … … 173 201 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 174 202 $esc_id = $DBRESULT->fetchRow(); 203 $fields["esc_name"] = htmlentities($ret["esc_name"], ENT_QUOTES); 204 $fields["esc_alias"] = htmlentities($ret["esc_alias"], ENT_QUOTES); 205 $fields["first_notification"] = htmlentities($ret["first_notification"], ENT_QUOTES); 206 $fields["last_notification"] = htmlentities($ret["last_notification"], ENT_QUOTES); 207 $fields["notification_interval"] = htmlentities($ret["notification_interval"], ENT_QUOTES); 208 $fields["escalation_period"] = htmlentities($ret["escalation_period"], ENT_QUOTES); 209 $fields["escalation_options1"] = implode(",", array_keys($ret["escalation_options1"])); 210 $fields["escalation_options2"] = implode(",", array_keys($ret["escalation_options2"])); 211 $fields["esc_comment"] = htmlentities($ret["esc_comment"], ENT_QUOTES); 212 $fields["esc_cgs"] = ""; 213 if (isset($ret["esc_cgs"])) 214 $fields["esc_cgs"] = implode(",", $ret["esc_cgs"]); 215 $fields["esc_hosts"] = ""; 216 if (isset($ret["esc_hosts"])) 217 $fields["esc_hosts"] = implode(",", $ret["esc_hosts"]); 218 $fields["esc_hgs"] = ""; 219 if (isset($ret["esc_hgs"])) 220 $fields["esc_hgs"] = implode(",", $ret["esc_hgs"]); 221 $fields["esc_sgs"] = ""; 222 if (isset($ret["esc_sgs"])) 223 $fields["esc_sgs"] = implode(",", $ret["esc_sgs"]); 224 $fields["esc_hServices"] = ""; 225 if (isset($ret["esc_hServices"])) 226 $fields["esc_hServices"] = implode(",", $ret["esc_hServices"]); 227 $fields["esc_metas"] = ""; 228 if (isset($ret["esc_metas"])) 229 $fields["esc_metas"] = implode(",", $ret["esc_metas"]); 230 $oreon->CentreonLogAction->insertLog("escalation", $esc_id["MAX(esc_id)"], htmlentities($ret["esc_name"], ENT_QUOTES), "a", $fields); 175 231 return ($esc_id["MAX(esc_id)"]); 176 232 } … … 179 235 if (!$esc_id) exit(); 180 236 global $form; 181 global $pearDB ;237 global $pearDB, $oreon; 182 238 $ret = array(); 183 239 $ret = $form->getSubmitValues(); … … 205 261 if (PEAR::isError($DBRESULT)) 206 262 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 263 $fields["esc_name"] = htmlentities($ret["esc_name"], ENT_QUOTES); 264 $fields["esc_alias"] = htmlentities($ret["esc_alias"], ENT_QUOTES); 265 $fields["first_notification"] = htmlentities($ret["first_notification"], ENT_QUOTES); 266 $fields["last_notification"] = htmlentities($ret["last_notification"], ENT_QUOTES); 267 $fields["notification_interval"] = htmlentities($ret["notification_interval"], ENT_QUOTES); 268 $fields["escalation_period"] = htmlentities($ret["escalation_period"], ENT_QUOTES); 269 $fields["escalation_options1"] = implode(",", array_keys($ret["escalation_options1"])); 270 $fields["escalation_options2"] = implode(",", array_keys($ret["escalation_options2"])); 271 $fields["esc_comment"] = htmlentities($ret["esc_comment"], ENT_QUOTES); 272 $fields["esc_cgs"] = ""; 273 if (isset($ret["esc_cgs"])) 274 $fields["esc_cgs"] = implode(",", $ret["esc_cgs"]); 275 $fields["esc_hosts"] = ""; 276 if (isset($ret["esc_hosts"])) 277 $fields["esc_hosts"] = implode(",", $ret["esc_hosts"]); 278 $fields["esc_hgs"] = ""; 279 if (isset($ret["esc_hgs"])) 280 $fields["esc_hgs"] = implode(",", $ret["esc_hgs"]); 281 $fields["esc_sgs"] = ""; 282 if (isset($ret["esc_sgs"])) 283 $fields["esc_sgs"] = implode(",", $ret["esc_sgs"]); 284 $fields["esc_hServices"] = ""; 285 if (isset($ret["esc_hServices"])) 286 $fields["esc_hServices"] = implode(",", $ret["esc_hServices"]); 287 $fields["esc_metas"] = ""; 288 if (isset($ret["esc_metas"])) 289 $fields["esc_metas"] = implode(",", $ret["esc_metas"]); 290 $oreon->CentreonLogAction->insertLog("escalation", $esc_id["MAX(esc_id)"], htmlentities($ret["esc_name"], ENT_QUOTES), "c", $fields); 207 291 } 208 292 -
trunk/centreon/www/include/configuration/configObject/host_dependency/DB-Func.php
r6646 r6697 57 57 58 58 function deleteHostDependencyInDB ($dependencies = array()) { 59 global $pearDB ;59 global $pearDB, $oreon; 60 60 foreach($dependencies as $key=>$value) { 61 $DBRESULT2 =& $pearDB->query("SELECT dep_name FROM `dependency` WHERE `dep_id` = '".$key."' LIMIT 1"); 62 if (PEAR::isError($DBRESULT2)) 63 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 64 $row = $DBRESULT2->fetchRow(); 65 61 66 $DBRESULT =& $pearDB->query("DELETE FROM dependency WHERE dep_id = '".$key."'"); 62 67 if (PEAR::isError($DBRESULT)) 63 68 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 69 $oreon->CentreonLogAction->insertLog("dependency", $key, $row['dep_name'], "d"); 64 70 } 65 71 } … … 67 73 function multipleHostDependencyInDB ($dependencies = array(), $nbrDup = array()) { 68 74 foreach($dependencies as $key=>$value) { 69 global $pearDB ;75 global $pearDB, $oreon; 70 76 $DBRESULT =& $pearDB->query("SELECT * FROM dependency WHERE dep_id = '".$key."' LIMIT 1"); 71 77 if (PEAR::isError($DBRESULT)) … … 78 84 $key2 == "dep_name" ? ($dep_name = $value2 = $value2."_".$i) : null; 79 85 $val ? $val .= ($value2!=NULL?(", '".$value2."'"):", NULL") : $val .= ($value2!=NULL?("'".$value2."'"):"NULL"); 86 if ($key2 != "dep_id") 87 $fields[$key2] = $value2; 88 $fields["dep_name"] = $dep_name; 80 89 } 81 90 if (testHostDependencyExistence($dep_name)) { … … 92 101 if (PEAR::isError($DBRESULT)) 93 102 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 103 $fields["dep_hostParents"] = ""; 94 104 while($host =& $DBRESULT->fetchRow()) { 95 105 $DBRESULT2 =& $pearDB->query("INSERT INTO dependency_hostParent_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$host["host_host_id"]."')"); 96 106 if (PEAR::isError($DBRESULT2)) 97 107 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 108 $fields["dep_hostParents"] .= $host["host_host_id"] . ","; 98 109 } 110 $fields["dep_hostParents"] = trim($fields["dep_hostParents"], ","); 99 111 $DBRESULT->free(); 100 112 $DBRESULT =& $pearDB->query("SELECT DISTINCT host_host_id FROM dependency_hostChild_relation WHERE dependency_dep_id = '".$key."'"); 101 113 if (PEAR::isError($DBRESULT)) 102 114 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 115 $fields["dep_hostChilds"] = ""; 103 116 while($host =& $DBRESULT->fetchRow()) { 104 117 $DBRESULT2 =& $pearDB->query("INSERT INTO dependency_hostChild_relation VALUES ('', '".$maxId["MAX(dep_id)"]."', '".$host["host_host_id"]."')"); 105 118 if (PEAR::isError($DBRESULT2)) 106 119 print "DB Error : ".$DBRESULT2->getDebugInfo()."<br />"; 120 $fields["dep_hostChilds"] .= $host["host_host_id"] . ","; 107 121 } 122 $fields["dep_hostChilds"] = trim($fields["dep_hostChilds"], ","); 108 123 $DBRESULT->free(); 124 $oreon->CentreonLogAction->insertLog("dependency", $maxId["MAX(dep_id)"], $dep_name, "a", $fields); 109 125 } 110 126 } … … 129 145 function insertHostDependency($ret = array()) { 130 146 global $form; 131 global $pearDB ;147 global $pearDB, $oreon; 132 148 if (!count($ret)) 133 149 $ret = $form->getSubmitValues(); … … 149 165 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 150 166 $dep_id = $DBRESULT->fetchRow(); 167 $fields["dep_name"] = htmlentities($ret["dep_name"], ENT_QUOTES); 168 $fields["dep_description"] = htmlentities($ret["dep_description"], ENT_QUOTES); 169 $fields["inherits_parent"] = $ret["inherits_parent"]["inherits_parent"]; 170 $fields["execution_failure_criteria"] = implode(",", array_keys($ret["execution_failure_criteria"])); 171 $fields["notification_failure_criteria"] = implode(",", array_keys($ret["notification_failure_criteria"])); 172 $fields["dep_comment"] = htmlentities($ret["dep_comment"], ENT_QUOTES); 173 $fields["dep_hostParents"] = ""; 174 if (isset($ret["dep_hostParents"])) 175 $fields["dep_hostParents"] = implode(",", $ret["dep_hostParents"]); 176 $fields["dep_hostChilds"] = ""; 177 if (isset($ret["dep_hostChilds"])) 178 $fields["dep_hostChilds"] = implode(",", $ret["dep_hostChilds"]); 179 $oreon->CentreonLogAction->insertLog("dependency", $dep_id["MAX(dep_id)"], htmlentities($ret["dep_name"], ENT_QUOTES), "a", $fields); 151 180 return ($dep_id["MAX(dep_id)"]); 152 181 } … … 155 184 if (!$dep_id) exit(); 156 185 global $form; 157 global $pearDB ;186 global $pearDB, $oreon; 158 187 $ret = array(); 159 188 $ret = $form->getSubmitValues(); … … 175 204 if (PEAR::isError($DBRESULT)) 176 205 print "DB
