<div> <?php if (NConf_DEBUG::status("INFO")) { echo NConf_HTML::title("Info:", 2); echo NConf_DEBUG::show_debug("INFO"); echo NConf_HTML::line(); } // Display jQuery/ajax errors echo '<div id="jquery_error" class="ui-state-error" style="display: none">'; echo '<span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"> </span>'; echo NConf_HTML::title("Error:", 2); echo '</div>'; if (NConf_DEBUG::status("ERROR")) { echo NConf_HTML::title("Error:", 2); echo '<font color="red">'; echo NConf_DEBUG::show_debug("ERROR"); echo '</font>'; echo NConf_HTML::line(); } if (DEBUG_MODE == 1) { echo '<div id="jquery_console_parent" style="padding: 0; display: none">'; echo NConf_HTML::swap_content('<div id="jquery_console"></div>', "<b>jQuery debugging</b>", FALSE, FALSE); echo '</div>'; NConf_DEBUG::display(); } ?> </div> </div> <!-- END OF DIV "footer" -->
$content_button = ' <form name="delete_item" action="delete_item.php?item=' . $class . '" method="post"> <input type="hidden" name="ids" value="' . $id_list . '"> <input type="hidden" name="from" value="' . $url . '"> <input type="hidden" name="delete" value="yes"> <div id=buttons><br>'; $content_button .= '<input type="Submit" value="Delete" name="submit" align="middle" '; if (DB_NO_WRITES == 1) { $content_button .= 'disabled'; } $content_button .= '> '; $content_button .= '<input type=button onClick="window.location.href=\'' . $_SESSION["go_back_page"] . '\'" value="Back">'; $content_button .= '</form>'; echo NConf_HTML::limit_space(NConf_HTML::show_highlight('WARNING', $content . $content_button)); if (DB_NO_WRITES == 1) { echo NConf_DEBUG::show_debug('INFO', TRUE); } foreach ($ids as $id) { # Delete Services if item = host $item_class = db_templates("class_name", $id); if ($item_class == "host") { # WARN services linked to host $get_srv_query = 'SELECT attr_value, ConfigValues.fk_id_item AS item_id,"service" AS config_class, "service name" AS friendly_name FROM ConfigValues, ConfigAttrs, ConfigClasses, ItemLinks WHERE id_attr = ConfigValues.fk_id_attr AND naming_attr = "yes" AND id_class = fk_id_class AND config_class = "service" AND ConfigValues.fk_id_item = ItemLinks.fk_id_item AND fk_item_linked2 = ' . $id . '
} } } ### # Info/Warning in the top right corner ### echo '<h2>Edit static config files</h2>'; echo '<div class="editor_info">'; if (NConf_DEBUG::status('ERROR')) { $title = 'WARNING'; $content = NConf_DEBUG::show_debug('ERROR', TRUE); $content .= '<br>The webserver user must have write permissions for your config directory, <br>otherwise NConf cannot save your changes.'; echo NConf_HTML::show_error($title, $content); } elseif (NConf_DEBUG::status('INFO') and !empty($saved)) { $title = 'Successfully saved file'; $content = ICON_TRUE . NConf_DEBUG::show_debug('INFO', TRUE); echo NConf_HTML::show_highlight($title, $content); } else { $title = 'Info'; $content = 'This mask allows administrators to modify static Nagios configuration files.'; echo NConf_HTML::show_highlight($title, $content); } echo '</div>'; echo '<form name="editor" action="' . $request_url . '" method="post"> <fieldset class="inline"> <legend>choose a file</legend> <table> <colgroup> <col width="70"> <col>
public static function show_error($title = "Error:", $content = '') { $output = ''; $output .= '<div class="ui-state-error ui-corner-all fg-error">'; $output .= '<span style="float: left; margin-right: 0.3em;" class="ui-icon ui-icon-alert"> </span>'; $output .= NConf_HTML::title($title, 2); if (!empty($content)) { $output .= $content; } else { $output .= NConf_DEBUG::show_debug('ERROR', TRUE); } $output .= '</div>'; return $output; }
if (isset($vererben2)) { unset($vererben2); } $vererben2_result = db_templates("vererben", $id); while ($row = mysql_fetch_assoc($vererben2_result)) { $vererben2[$row["item_id"]] = $row["attr_name"]; } if ($vererben1 !== $vererben2) { $ask_vererben = 1; } } ### # end of write2db ### if (NConf_DEBUG::status('ERROR')) { echo NConf_DEBUG::show_debug('ERROR', TRUE); echo "<br><br>"; echo NConf_HTML::back_button($_SESSION["go_back_page"]); // Cache $_SESSION["cache"]["use_cache"] = TRUE; foreach ($_POST as $key => $value) { $_SESSION["cache"]["handle"][$key] = $value; } } else { if (isset($_SESSION["cache"]["handle"])) { unset($_SESSION["cache"]["handle"]); } # get inheritance table for this host $preview[$name] = inheritance_HostToService($id, "preview"); } }
} } } # get also the debug informations if ($debug == 'yes' and $json == 'no') { $title = 'Load file "' . $file_path . '" @ ' . date("H:i:s"); // set ERROR if (NConf_DEBUG::status('ERROR')) { echo '<div id="ajax_error">'; echo NConf_DEBUG::show_debug('ERROR', TRUE); echo '</div>'; } // set DEBUG if (NConf_DEBUG::status('DEBUG')) { echo '<div id="ajax_debug">'; echo NConf_HTML::swap_content(NConf_DEBUG::show_debug('DEBUG', TRUE), $title, FALSE, FALSE, 'color_list3'); echo '</div>'; } if (!empty($ajax) and $ajax == 'yes') { ?> <!-- jQuery part --> <script type="text/javascript"> $(document).ready(function(){ // fetch ERROR part and give to footer and display it $("#jquery_error").append( $("#ajax_error") ); $("#ajax_error").parent("#jquery_error").show("blind"); // fetch DEBUG part and give to footer (will be displayed if debug is enabled) $("#ajax_debug").prependTo( $("#jquery_console") ); $("#jquery_console_parent").fadeIn("slow"); });
# feedback for clone2hosts if ($_POST["action"] == "clone2hosts") { $host_name = db_templates("get_value", $destination_host_id, "host_name"); $host_link = '<a href="modify_item_service.php?id=' . $destination_host_id . '"><span class="link_with_tag">' . $host_name . '</span></a>'; NConf_DEBUG::set("<i>" . $new_service_name . "</i>", 'INFO', $host_link); if (NConf_DEBUG::status('ERROR')) { $service_link = '<a href="detail.php?id=' . $new_service_id . '" target="_blank" class="link_with_tag">' . $new_service_name . '</a>'; NConf_DEBUG::set($service_link, 'ERROR', "failed with service"); } } } if ($_POST["action"] == "cloneONhost") { // give new ID back echo '<div id="clone_success">' . $new_service_id . '</div>'; } } # output for clone2hosts if ($_POST["action"] == "clone2hosts") { $source_service_name = db_templates("get_value", $_POST["service_id"], "service_description"); if (NConf_DEBUG::status('ERROR')) { # error $feedback = "Failed, see debug for details."; echo '<div id="clone_error">' . $feedback; echo NConf_DEBUG::show_debug('INFO', TRUE); echo '</div>'; } else { $feedback .= 'Successfully cloned to the following hosts:</b><br>'; $feedback .= NConf_DEBUG::show_debug('INFO', TRUE); echo '<div id="clone_success" class="feedback">' . $feedback . '</div>'; } }
<br>- UPDATE <br>- UPDATE.php <br> '); } else { # config not available, first run INSTALL.php require_once NCONFDIR . "/include/menu/menu_start.html"; require_once NCONFDIR . "/include/menu/menu_install.php"; require_once NCONFDIR . "/include/menu/menu_end.php"; echo '<div id="maincontent">'; message($critical, 'Setup required. To install NConf <b><a href="INSTALL.php">click here</a></b><br>'); } } # Check for critical error, continue or abort if (NConf_DEBUG::status('CRITICAL')) { $msg_critical = NConf_DEBUG::show_debug('CRITICAL'); echo NConf_HTML::show_error('Error', $msg_critical); require_once NCONFDIR . '/include/foot.php'; exit; } ### ## Page authorisation check ### require_once NCONFDIR . '/include/access_rules.php'; # Show page or EXIT the script ? (based on above auth-checks) if ($NConf_PERMISSIONS->checkPageAccess() === TRUE and $NConf_PERMISSIONS->checkIdAuthorization() !== FALSE) { NConf_DEBUG::set("Access granted", 'DEBUG', "ACL"); # go ahead in file } elseif (!isset($_SESSION["group"]) and empty($_GET["goto"])) { # not logged in # Go to login page, and redirect it to called page
WHERE fk_item_linked2 = ' . $service_tpl["fk_id_item"] . ' ORDER BY fk_id_item'; $linkedAsChild_items = db_handler($query, "array", "for history: get linked as child items"); foreach ($linkedAsChild_items as $entry) { history_add("assigned", $entry["fk_id_attr"], $new_service_id, $entry["fk_id_item"], "resolve_assignment"); } } //foreach ############# # show success message echo '<b>Successfully cloned selected host to "' . $_POST["hostname"] . '"</b>'; echo '<br><br>Click for details: '; echo '<a href="detail.php?id=' . $new_host_id . '">' . $_POST["hostname"] . '</a>'; } else { # else of write2db // Cache foreach ($_POST as $key => $value) { $_SESSION["cache"]["clone"][$key] = $value; } // Error message echo NConf_DEBUG::show_debug('ERROR', TRUE, $_SESSION["go_back_page"]); } # end of write2db ?> </td> </tr> </table> <?php } // END Entry exists ? mysql_close($dbh); require_once 'include/foot.php';