diff options
-rw-r--r-- | packages/snort/snort_download_rules.php | 23 | ||||
-rw-r--r-- | packages/snort/snort_rulesets.php | 33 |
2 files changed, 33 insertions, 23 deletions
diff --git a/packages/snort/snort_download_rules.php b/packages/snort/snort_download_rules.php index 7e7761c5..af87fc1a 100644 --- a/packages/snort/snort_download_rules.php +++ b/packages/snort/snort_download_rules.php @@ -39,14 +39,13 @@ include("head.inc"); <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> <?php include("fbegin.inc"); ?> -<p class="pgtitle"><?=$pgtitle?></p> <form action="snort_download_rules.php" method="post"> <div id="inputerrors"></div> <?php if(!$_GET['start'] && !$_POST['start']) { - echo "Press <a href='snort_download_rules.php?start=yes'>here</a> to start download.<br>"; + echo "Press <a href='snort_download_rules.php?start=yes'>here</a> to start download.<br />"; include("fend.inc"); exit; } @@ -162,12 +161,20 @@ function check_for_common_errors($filename) { if(stristr($contents, "You don't have permission")) { update_all_status("An error occured. Scroll down to inspect it's contents."); hide_progress_bar_status(); - echo "<center><div id='error' style='background:white;width:90%'>"; - echo " <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p> <p>"; - echo "The following error occured while downloading the snort rules file from snort.org:<p>"; - echo $contents; - echo " <p> <p> <p> <p> <p> <p>"; - echo "</div></center>"; + echo " + <center> + <div id='error' style='background:white;width:90%'> + <!-- TODO: The below paragraphs are kind of stupid. Use CSS instead --> + <p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p> + <p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p> + <p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p> + <p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p> + <p>The following error occured while downloading the snort rules file from snort.org:</p> + {$contents} + <p> </p><p> </p><p> </p><p> </p><p> </p><p> </p><p> </p> + </div> + </center> + "; scroll_down_to_bottom_of_page(); exit; } diff --git a/packages/snort/snort_rulesets.php b/packages/snort/snort_rulesets.php index a84fafc2..b60318f4 100644 --- a/packages/snort/snort_rulesets.php +++ b/packages/snort/snort_rulesets.php @@ -56,10 +56,8 @@ include("head.inc"); <body link="#000000" vlink="#000000" alink="#000000"> <?php include("fbegin.inc"); ?> -<p class="pgtitle"><?=$pgtitle?></font></p> -<form action="snort_rulesets.php" method="post" name="iform"> -<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script> -<script src="/javascript/scriptaculous/scriptaculous.js" type="text/javascript"></script> + +<form action="snort_rulesets.php" method="post" name="iform" id="iform"> <script src="/row_toggle.js" type="text/javascript"></script> <script src="/javascript/sorttable.js" type="text/javascript"></script> <?php if ($savemsg) print_info_box($savemsg); ?> @@ -78,10 +76,10 @@ include("head.inc"); <tr> <td> <div id="mainarea"> - <table id="maintable" name="maintable" class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> + <table id="maintable" class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td> - <table id="sortabletable1" name="sortabletable1" class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0"> + <table id="sortabletable1" class="sortable" width="100%" border="0" cellpadding="0" cellspacing="0"> <tr id="frheader"> <td width="5%" class="listhdrr">Enabled</td> <td class="listhdrr">Ruleset</td> @@ -90,23 +88,30 @@ include("head.inc"); <?php $dir = "/usr/local/etc/snort/rules/"; $dh = opendir($dir); - while (false !== ($filename = readdir($dh))) + while (false !== ($filename = readdir($dh))) { $files[] = $filename; + } sort($files); foreach($files as $file) { if(!stristr($file, ".rules")) continue; echo "<tr>"; - if(in_array($file, $enabled_rulesets_array)) - $CHECKED = " CHECKED"; - else + echo "<td align=\"center\" valign=\"top\">"; + if(in_array($file, $enabled_rulesets_array)) { + $CHECKED = " checked=\"checked\""; + } else { $CHECKED = ""; - echo "<td align=\"center\" valign=\"top\"><input type='checkbox' name='toenable[]' value='$file'{$CHECKED}></td>"; - echo "<td>{$file}</td>"; + } + echo " <input type='checkbox' name='toenable[]' value='$file' {$CHECKED} />"; + echo "</td>"; + echo "<td>"; + echo "{$file}"; + echo "</td>"; //echo "<td>"; //echo "description"; //echo "</td>"; } + ?> </table> </td> @@ -114,7 +119,7 @@ include("head.inc"); <tr><td> </td></tr> <tr><td>Check the rulesets that you would like Snort to load at startup.</td></tr> <tr><td> </td></tr> - <tr><td><input value="Save" type="submit"></td></tr> + <tr><td><input value="Save" type="submit" name="save" id="save" /></td></tr> </table> </div> </td> @@ -123,8 +128,6 @@ include("head.inc"); </form> -<br> - <?php include("fend.inc"); ?> </body> |