Ejemplo n.º 1
0
echo gettext("Choose a language for the webConfigurator");
?>
                  </strong>
                </div>
              </td>
            </tr>
            <tr>
              <td><a id="help_for_theme" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?php 
echo gettext("Theme");
?>
</td>
              <td>
                <select name="theme" class="selectpicker" data-size="10" data-width="auto">
<?php 
$curtheme = get_current_theme();
foreach (return_dir_as_array('/usr/local/opnsense/www/themes/') as $file) {
    ?>
                  <option <?php 
    echo $file == $curtheme ? "selected=\"selected\"" : "";
    ?>
>
                    <?php 
    echo $file;
    ?>
                  </option>
<?php 
}
?>
                </select>
                <div class="hidden" for="help_for_theme">
                  <strong>
Ejemplo n.º 2
0
			</tr>
			<?php 
if (!$g['disablethemeselection']) {
    ?>
			<tr>
				<td colspan="2" valign="top" class="listtopic"><?php 
    echo gettext("Theme");
    ?>
</td>
			</tr>
			<tr>
				<td width="22%" valign="top" class="vncell">&nbsp;</td>
				<td width="78%" class="vtable">
					<select name="theme">
						<?php 
    $files = return_dir_as_array("/usr/local/www/themes/");
    foreach ($files as $f) {
        if (substr($f, 0, 1) == "_" && !isset($config['system']['developer'])) {
            continue;
        }
        if ($f == "CVS") {
            continue;
        }
        $curtheme = "pfsense";
        if ($config['theme']) {
            $curtheme = $config['theme'];
        }
        $selected = "";
        if ($f == $curtheme) {
            $selected = " selected=\"selected\"";
        }
}
if (isset($_POST['save']) && isset($_POST['iplist_data'])) {
    if (strlen(basename($_POST['iplist_name'])) > 0) {
        $file = $iprep_path . basename($_POST['iplist_name']);
        $data = str_replace("\r\n", "\n", $_POST['iplist_data']);
        file_put_contents($file, $data);
        unset($data);
    } else {
        $input_errors[] = gettext("You must provide a valid filename for the IP List.");
        $iplist_edit_style = "display: table-row-group;";
    }
}
// Get all files in the IP Lists sub-directory as an array
// Leave this as the last thing before spewing the page HTML
// so we can pick up any changes made to files in code above.
$ipfiles = return_dir_as_array($iprep_path);
$pgtitle = gettext("Snort: IP Reputation Lists");
include_once "head.inc";
?>

<body link="#000000" vlink="#000000" alink="#000000">

<?php 
include_once "fbegin.inc";
if ($input_errors) {
    print_input_errors($input_errors);
}
if ($savemsg) {
    print_info_box($savemsg);
}
?>
        header("Content-Type: application/octet-stream");
        header("Content-length: " . filesize("/tmp/{$file_name}"));
        header("Content-disposition: attachment; filename = {$file_name}");
        ob_end_clean();
        //important or other post will fail
        readfile("/tmp/{$file_name}");
        // Clean up the temp file
        unlink_if_exists("/tmp/{$file_name}");
    } else {
        $savemsg = gettext("An error occurred while creating the gzip archive!");
    }
}
// Get all files in the SID Mods Lists sub-directory as an array
// Leave this as the last thing before spewing the page HTML
// so we can pick up any changes made to files in code above.
$sidmodfiles = return_dir_as_array($sidmods_path);
$sidmodselections = array_merge(array("None"), $sidmodfiles);
$pgtitle = gettext("Suricata: SID Management");
include_once "head.inc";
?>

<body link="#000000" vlink="#000000" alink="#000000">

<?php 
include_once "fbegin.inc";
/* Display Alert message, under form tag or no refresh */
if ($input_errors) {
    print_input_errors($input_errors);
}
?>
Ejemplo n.º 5
0
								<strong>
									<?php 
echo gettext("Choose a language for the webConfigurator");
?>
								</strong>
							</td>
						</tr>
						<tr>
							<td width="22%" valign="top" class="vncell"><?php 
echo gettext("Theme");
?>
</td>
							<td width="78%" class="vtable">
								<select name="theme" class="selectpicker" data-style="btn-default" data-width="auto">
									<?php 
$files = return_dir_as_array('/usr/local/opnsense/www/themes/');
$curtheme = get_current_theme();
foreach ($files as $file) {
    $selected = '';
    if ($file == $curtheme) {
        $selected = ' selected="selected"';
    }
    ?>
									<option <?php 
    echo $selected;
    ?>
><?php 
    echo $file;
    ?>
</option>
									<?php 
    </form>
    </td>
   </tr>
   <tr>
    <td class="tabcont" >
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
          <td width="45%" class="listhdrr">IP</td>
          <td width="10%" class="listhdrr">Status</td>
          <td width="15%" class="listhdrr">In Service</td>
		  <td width="15%" class="listhdrr">Monitor ip</td>
          <td width="15%" class="listhdrr">Response time</td>
		</tr>

<?php 
$pingdir = return_dir_as_array("/var/db/pingstatus");
if (file_exists("/var/run/service/tinydns/root/data")) {
    $tinydns_data = file_get_contents("/var/run/service/tinydns/root/data");
} else {
    $tinydns_data = "";
}
if ($config['installedpackages']['tinydnsdomains']) {
    foreach ($config['installedpackages']['tinydnsdomains']['config'] as $ping) {
        if ($ping['recordtype'] == "SOA") {
            continue;
        }
        if (!$ping['row']) {
            continue;
        }
        $ipaddress = $ping['ipaddress'];
        $hostname = $ping['hostname'];
function process_alias_tgz($temp_filename)
{
    mwexec("/bin/mv {$temp_filename}/aliases {$temp_filename}/aliases.tgz");
    mwexec("/usr/bin/tar xzf {$temp_filename}/aliases.tgz -C {$temp_filename}/aliases/");
    unlink("{$temp_filename}/aliases.tgz");
    $files_to_process = return_dir_as_array("{$temp_filename}/");
    /* foreach through all extracted files and build up aliases file */
    $fd = fopen("{$temp_filename}/aliases", "a");
    foreach ($files_to_process as $f2p) {
        $file_contents = file_get_contents($f2p);
        fwrite($fd, $file_contents);
        unlink($f2p);
    }
    fclose($fd);
}