| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147 |
- <?php
- require_once ($_SERVER['DOCUMENT_ROOT']."/inc/auth.php");
- require_once ($_SERVER['DOCUMENT_ROOT']."/inc/languages/" . HTML_LANG . ".php");
- if (isset($_POST["set_workmode_on"])) {
- run_sql($db_link,"DELETE FROM config WHERE option_id=68");
- $new['option_id'] = 68;
- $new['value'] = 1;
- insert_record($db_link, "config", $new);
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["set_workmode_off"])) {
- run_sql($db_link,"DELETE FROM config WHERE option_id=68");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["recheck_ip"]) and is_option($db_link, 37)) {
- $run_cmd = get_option($db_link, 37);
- $result = shell_exec("/usr/bin/sudo ".escapeshellcmd($run_cmd)." >/dev/null 2>/dev/null &");
- LOG_VERBOSE($db_link, "Run command: $run_cmd ");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["refresh_dhcp"]) and is_option($db_link, 38)) {
- $run_cmd = get_option($db_link, 38);
- $result = shell_exec("/usr/bin/sudo ".escapeshellcmd($run_cmd)." >/dev/null 2>/dev/null &");
- LOG_VERBOSE($db_link, "Run command: $run_cmd ");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["refresh_nagios"]) and is_option($db_link, 40)) {
- $run_cmd = get_option($db_link, 40);
- $result = shell_exec("/usr/bin/sudo ".escapeshellcmd($run_cmd)." >/dev/null 2>/dev/null &");
- LOG_VERBOSE($db_link, "Run command: $run_cmd ");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["up_nagios"])) {
- run_sql($db_link,"UPDATE user_auth SET nagios_status='UP'");
- run_sql($db_link,"UPDATE devices SET nagios_status='UP'");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["refresh_dns"]) and is_option($db_link, 39)) {
- $run_cmd = get_option($db_link, 39);
- $result = shell_exec("/usr/bin/sudo ".escapeshellcmd($run_cmd)." >/dev/null 2>/dev/null &");
- LOG_VERBOSE($db_link, "Run command: $run_cmd ");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["discovery"]) and is_option($db_link, 41)) {
- $run_cmd = get_option($db_link, 41);
- $result = shell_exec("/usr/bin/sudo ".escapeshellcmd($run_cmd)." >/dev/null 2>/dev/null &");
- LOG_VERBOSE($db_link, "Run command: $run_cmd ");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["discovery2"]) and is_option($db_link, 41)) {
- $run_cmd = get_option($db_link, 41);
- $result = shell_exec("/usr/bin/sudo ".escapeshellcmd($run_cmd)." force >/dev/null 2>/dev/null &");
- LOG_VERBOSE($db_link, "Run command: $run_cmd force");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (!empty($_POST["save_traf_all"]) and $_POST["save_traf_all"]) {
- run_sql($db_link, 'Update user_auth SET save_traf=1');
- LOG_INFO($db_link, "Enable save traffic for all!");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (!empty($_POST["not_save_traf_all"]) and $_POST["not_save_traf_all"]) {
- run_sql($db_link, 'Update user_auth SET save_traf=0');
- LOG_INFO($db_link, "Disable save traffic for all!");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- if (isset($_POST["clean_cache"])) {
- LOG_VERBOSE($db_link, "Clean dns cache");
- run_sql($db_link,"DELETE FROM dns_cache");
- header("Location: " . $_SERVER["REQUEST_URI"]);
- exit;
- }
- unset($_POST);
- require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php");
- print_control_submenu($page_url);
- ?>
- <div id="cont">
- <br>
- <form name="def" action="control.php" method="post">
- <table class="data">
- <?php
- if (get_option($db_link, 68)) {
- print "<tr><td align=right>".WEB_control_edit_mode." <input type=submit name='set_workmode_off' value='".WEB_btn_off."' style='background-color:red'></td></tr>";
- } else {
- print "<tr><td align=right>".WEB_control_edit_mode." <input type=submit name='set_workmode_on' value='".WEB_btn_on."'></td></tr>";
- }
- if (is_option($db_link, 37)) {
- print "<tr><td align=right>".WEB_control_access." <input type=submit name='recheck_ip' value='".WEB_btn_refresh."'></td></tr>";
- }
- if (is_option($db_link, 38)) {
- print "<tr><td align=right>".WEB_control_dhcp." <input type=submit name='refresh_dhcp' value='".WEB_btn_refresh."' ></td></tr>";
- }
- if (is_option($db_link, 39)) {
- print "<tr><td align=right>".WEB_control_dns." <input type=submit name='refresh_dns' value='".WEB_btn_refresh."' ></td></tr>";
- }
- if (is_option($db_link, 40)) {
- print "<tr><td align=right>".WEB_control_nagios." <input type=submit name='refresh_nagios' value='".WEB_btn_refresh."'></td></tr>";
- print "<tr><td align=right>".WEB_control_nagios_clear_alarm." <input type=submit name='up_nagios' value='".WEB_btn_run."'></td></tr>";
- }
- if (is_option($db_link, 41)) {
- print "<tr><td align=right>".WEB_control_scan_network." <input type=submit name='discovery' value='".WEB_btn_run."'></td></tr>";
- }
- if (is_option($db_link, 41)) {
- print "<tr><td align=right>".WEB_control_fping_scan_network." <input type=submit name='discovery2' value='".WEB_btn_run."'></td></tr>";
- }
- if (get_option($db_link, 23)) {
- print "<tr><td align=right>".WEB_control_log_traffic_on." <input type=submit name='save_traf_all' value='".WEB_btn_run."'></td></tr>";
- print "<tr><td align=right>".WEB_control_log_traffic_off." <input type=submit name='not_save_traf_all' value='".WEB_btn_run."'></td></tr>";
- }
- print "<tr><td align=right>".WEB_control_clear_dns_cache." <input type=submit name='clean_cache' value='".WEB_btn_run."'></td></tr>";
- ?>
- <tr>
- <td align=right><a href="ipcam.php"><?php echo WEB_control_port_off; ?></a></td>
- </tr>
- </table>
- </form>
- <?php
- require_once ($_SERVER['DOCUMENT_ROOT']."/inc/footer.php");
- ?>
|