Skip to content

Commit

Permalink
Fix date formatter for snortips logs
Browse files Browse the repository at this point in the history
Fix snort stats submenu
Use https in webalizer top urls
  • Loading branch information
sonertari committed Sep 4, 2017
1 parent 97ace5e commit 43fdd34
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/etc/webalizer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ PageType cgi
# Default is 'no'. This only changes the behaviour of the 'Top
# URL's' table.

#UseHTTPS no
UseHTTPS yes

# DNSCache specifies the DNS cache filename to use for reverse DNS lookups.
# This file must be specified if you wish to perform name lookups on any IP
Expand Down
19 changes: 19 additions & 0 deletions src/Model/snortips.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,25 @@ function ParseLogLine($logline, &$cols)
}
return FALSE;
}

function GetDateRegexp($date)
{
global $MonthNames;

if ($date['Month'] == '') {
$re= '.*';
}
else {
$re= $MonthNames[$date['Month']].'\s+';
if ($date['Day'] == '') {
$re.= '.*';
}
else {
$re.= sprintf('%02d', $date['Day']);
}
}
return $re;
}
}

$ModelConfig = array(
Expand Down
6 changes: 6 additions & 0 deletions src/View/snort/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
'stats' => array(
'Name' => _MENU('Statistics'),
'Perms' => $ALL_USERS,
'SubMenu' => array(
'general' => _MENU('General'),
'daily' => _MENU('Daily'),
'hourly' => _MENU('Hourly'),
'live' => _MENU('Live'),
),
),
'graphs' => array(
'Name' => _MENU('Graphs'),
Expand Down
7 changes: 7 additions & 0 deletions src/View/snortips/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ function PrintBlockedIPsForm()
</td>
<?php
}

function FormatDate($date)
{
global $MonthNames;

return $MonthNames[$date['Month']].' '.sprintf('%02d', $date['Day']);
}
}

$View= new Snortips();
Expand Down

0 comments on commit 43fdd34

Please sign in to comment.