aboutsummaryrefslogtreecommitdiffstats
path: root/config/pfblockerng/pfblockerng_log.php
diff options
context:
space:
mode:
authorBBcan177 <bbcan177@gmail.com>2015-05-23 16:45:07 -0400
committerBBcan177 <bbcan177@gmail.com>2015-05-23 16:45:07 -0400
commit7ac5dc3d8c7a5d4807f1004ca08e3bdd433af7c5 (patch)
tree36a962afb5860a07441a166713615a233d6e0bdd /config/pfblockerng/pfblockerng_log.php
parente80da3c57d0501d7a5962fcacd6416d47385e86a (diff)
downloadpfsense-packages-7ac5dc3d8c7a5d4807f1004ca08e3bdd433af7c5.tar.gz
pfsense-packages-7ac5dc3d8c7a5d4807f1004ca08e3bdd433af7c5.tar.bz2
pfsense-packages-7ac5dc3d8c7a5d4807f1004ca08e3bdd433af7c5.zip
pfBlockerNG v1.09 Code Style Changes
Diffstat (limited to 'config/pfblockerng/pfblockerng_log.php')
-rw-r--r--config/pfblockerng/pfblockerng_log.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/config/pfblockerng/pfblockerng_log.php b/config/pfblockerng/pfblockerng_log.php
index 4c25ce29..a235f20a 100644
--- a/config/pfblockerng/pfblockerng_log.php
+++ b/config/pfblockerng/pfblockerng_log.php
@@ -52,13 +52,13 @@ require_once("/usr/local/pkg/pfblockerng/pfblockerng.inc");
pfb_global();
-# Get log files from directory
+// Get log files from directory
function getlogs($logdir, $log_extentions = array('log')) {
if (!is_array($log_extentions)) {
$log_extentions = array($log_extentions);
}
- # Get logfiles
+ // Get logfiles
$log_filenames = array();
foreach ($log_extentions as $extention) {
if ($extention <> '*') {
@@ -68,7 +68,7 @@ function getlogs($logdir, $log_extentions = array('log')) {
}
}
- # Convert to filenames only
+ // Convert to filenames only
if (count($log_filenames) > 0) {
$log_totalfiles = count($log_filenames);
for ($cnt = 0; $cnt < $log_totalfiles; $cnt++) {
@@ -76,18 +76,19 @@ function getlogs($logdir, $log_extentions = array('log')) {
}
}
- # Sort the filename
+ // Sort the filename
asort($log_filenames);
- # Done
+ // Done
return $log_filenames;
}
-# Define logtypes
-# name => Displayname of the type
-# ext => Log extentions (array for multiple extentions)
-# logdir=> Log directory
-# clear => Add clear button (TRUE/FALSE)
+/* Define logtypes:
+ name => Displayname of the type
+ ext => Log extentions (array for multiple extentions)
+ logdir => Log directory
+ clear => Add clear button (TRUE/FALSE) */
+
$pfb_logtypes = array( 'defaultlogs' => array('name' => 'Log Files',
'logdir' => "{$pfb['logdir']}/",
'logs' => array("pfblockerng.log", "error.log", "geoip.log", "maxmind_ver"),
@@ -153,7 +154,7 @@ $pfb_logtypes = array( 'defaultlogs' => array('name' => 'Log Files',
)
);
-# Check logtypes
+// Check logtypes
$logtypeid = 'defaultlogs';
if (isset($_POST['logtype'])) {
$logtypeid = $_POST['logtype'];
@@ -161,13 +162,13 @@ if (isset($_POST['logtype'])) {
$logtypeid = htmlspecialchars($_GET['logtype']);
}
-# Check if POST has been set
+// Check if POST has been set
if (isset($_POST['file'])) {
clearstatcache();
$pfb_logfilename = $_POST['file'];
$pfb_ext = pathinfo($pfb_logfilename, PATHINFO_EXTENSION);
- # Load log
+ // Load log
if ($_POST['action'] == 'load') {
if (!is_file($pfb_logfilename)) {
echo "|3|" . gettext("Log file is empty or does not exist") . ".|";
@@ -187,12 +188,12 @@ if (isset($_POST['file'])) {
if (isset($_POST['logFile'])) {
$s_logfile = $_POST['logFile'];
- # Clear selected file
+ // Clear selected file
if (isset($_POST['clear'])) {
unlink_if_exists($s_logfile);
}
- # Download log
+ // Download log
if (isset($_POST['download'])) {
if (file_exists($s_logfile)) {
ob_start(); //important or other posts will fail