Changeset 5850
- Timestamp:
- 07/23/08 16:20:57 (3 months ago)
- Location:
- trunk/centreon/www/include/configuration
- Files:
-
- 3 modified
-
configLoad/DB-Func.php (modified) (2 diffs)
-
configNagios/DB-Func.php (modified) (1 diff)
-
configObject/host/DB-Func.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/centreon/www/include/configuration/configLoad/DB-Func.php
r5397 r5850 553 553 foreach ($tmpConf as $key=>$value) { 554 554 switch($key) { 555 case "use" : $use = trim($tmpConf[$key]); unset ($tmpConf[$key]); break;555 case "use" : $use = trim($tmpConf[$key]); /*unset ($tmpConf[$key])*/; break; 556 556 case "name" : $tmpConf["host_name"] = $tmpConf[$key]; unset ($tmpConf[$key]); break; 557 557 case "alias" : $tmpConf["host_alias"] = $tmpConf[$key]; unset ($tmpConf[$key]); break; … … 644 644 $tmpConf["ehi_statusmap_image"] = NULL; 645 645 $tmpConf["ehi_2d_coords"] = NULL; 646 $tmpConf["ehi_3d_coords"] = NULL; 646 $tmpConf["ehi_3d_coords"] = NULL; 647 647 $useTpl[0] = insertHostInDB($tmpConf); 648 648 $useTpl[1] = $use; -
trunk/centreon/www/include/configuration/configNagios/DB-Func.php
r5499 r5850 272 272 isset($ret["use_regexp_matching"]["use_regexp_matching"]) && $ret["use_regexp_matching"]["use_regexp_matching"] != 2 ? $rq .= "'".$ret["use_regexp_matching"]["use_regexp_matching"]."', " : $rq .= "'2', "; 273 273 isset($ret["use_true_regexp_matching"]["use_true_regexp_matching"]) && $ret["use_true_regexp_matching"]["use_true_regexp_matching"] != 2 ? $rq .= "'".$ret["use_true_regexp_matching"]["use_true_regexp_matching"]."', " : $rq .= "'2', "; 274 isset($ret["admin_email"]) && $ret["admin_email"] != NULL ? $rq .= "'".htmlentities($ret["admin_email"], ENT_QUOTES)."', " : $rq .= "NULL, ";274 isset($ret["admin_email"]) && $ret["admin_email"] != NULL ? $rq .= "'".htmlentities($ret["admin_email"], ENT_QUOTES)."', " : $rq .= "NULL, "; 275 275 isset($ret["admin_pager"]) && $ret["admin_pager"] != NULL ? $rq .= "'".htmlentities($ret["admin_pager"], ENT_QUOTES)."', " : $rq .= "NULL, "; 276 276 isset($ret["nagios_comment"]) && $ret["nagios_comment"] != NULL ? $rq .= "'".htmlentities($ret["nagios_comment"], ENT_QUOTES)."', " : $rq .= "NULL, "; 277 277 isset($ret["nagios_activate"]["nagios_activate"]) && $ret["nagios_activate"]["nagios_activate"] != NULL ? $rq .= "'".$ret["nagios_activate"]["nagios_activate"]."'," : $rq .= "'0',"; 278 278 isset($ret["broker_module"]) && $ret["broker_module"] != NULL ? $rq .= "'".htmlentities($ret["broker_module"], ENT_QUOTES)."', " : $rq .= "NULL, "; 279 isset($ret["event_broker_options"]) && $ret["event_broker_options"] != NULL ? $rq .= "'".htmlentities($ret["event_broker_options"], ENT_QUOTES)."' )" : $rq .= "NULL, ";279 isset($ret["event_broker_options"]) && $ret["event_broker_options"] != NULL ? $rq .= "'".htmlentities($ret["event_broker_options"], ENT_QUOTES)."', " : $rq .= "NULL, "; 280 280 isset($ret["enable_embedded_perl"]["enable_embedded_perl"]) && $ret["enable_embedded_perl"]["enable_embedded_perl"] != 2 ? $rq .= "'".$ret["enable_embedded_perl"]["enable_embedded_perl"]."', " : $rq .= "'2', "; 281 isset($ret["use_embedded_perl_implicitly"]["use_embedded_perl_implicitly"]) && $ret["use_embedded_perl_implicitly"]["use_embedded_perl_implicitly"] != 2 ? $rq .= "'".$ret["use_embedded_perl_implicitly"]["use_embedded_perl_implicitly"]."' ," : $rq .= "'2' ) ";281 isset($ret["use_embedded_perl_implicitly"]["use_embedded_perl_implicitly"]) && $ret["use_embedded_perl_implicitly"]["use_embedded_perl_implicitly"] != 2 ? $rq .= "'".$ret["use_embedded_perl_implicitly"]["use_embedded_perl_implicitly"]."') " : $rq .= "'2' ) "; 282 282 283 283 $DBRESULT =& $pearDB->query($rq); -
trunk/centreon/www/include/configuration/configObject/host/DB-Func.php
r5844 r5850 389 389 function insertHostInDB ($ret = array()) { 390 390 global $oreon; 391 391 392 $host_id = insertHost($ret); 392 393 updateHostHostParent($host_id, $ret); … … 428 429 // For Centreon 2, we no longer need "host_template_model_htm_id" in Nagios 3 429 430 // but we try to keep it compatible with Nagios 2 which needs "host_template_model_htm_id" 430 if (isset($_POST['nbOfSelect']) ) {431 if (isset($_POST['nbOfSelect']) || $oreon->user->get_version() >= 3) { 431 432 $DBRESULT =& $pearDB->query("SELECT host_id FROM `host` WHERE host_register='0' LIMIT 1"); 432 433 if (PEAR::isError($DBRESULT)) … … 490 491 ** Insert multiple templates 491 492 */ 492 if (isset($_POST['nbOfSelect'])) { 493 if (isset($ret["use"]) && $ret["use"]){ 494 $already_stored = array(); 495 $tplTab = split(",", $ret["use"]); 496 $j = 0; 497 foreach ($tplTab as $val) { 498 $tplId = getMyHostID($val); 499 500 if (!isset($already_stored[$tplId]) && $tplId) { 501 $rq = "INSERT INTO host_template_relation (`host_host_id`, `host_tpl_id`, `order`) VALUES (". $host_id['MAX(host_id)'] .", ". $tplId .", ". $j .")"; 502 $DBRESULT =& $pearDB->query($rq); 503 if (PEAR::isError($DBRESULT)) 504 print "DB Error : ".$DBRESULT->getDebugInfo()."<br />"; 505 $j++; 506 $already_stored[$tplId] = 1; 507 } 508 } 509 } 510 elseif (isset($_POST['nbOfSelect']) || $oreon->user->get_version() >= 3) { 493 511 $already_stored = array(); 494 512 for ($i=0, $j = 1;$i <= $_POST['nbOfSelect']; $i++) … … 509 527 * Insert on demand macros 510 528 */ 511 if (isset($_POST['nbOfMacro']) ) {529 if (isset($_POST['nbOfMacro']) || $oreon->user->get_version() >= 3) { 512 530 $already_stored = array(); 513 531 for ($i=0; $i <= $_POST['nbOfMacro']; $i++)
