pfsense/pfsense-packages — pull request #430 by bmeeks8 (2013-04-23 00:22:11+00:00)
Title: Fix display of Year and prevent Dashboard crash if Snort not installed

Snort Dashboard Widget
====================================================================
Change Log
====================================================================

1. Change parsing of the CSV data from the Alert log to properly pull out the date and time values when the Alert log contains entries with the YEAR in the date. The updated code looks for the dash "-" that separates the DATE from the TIME, and uses that to parse the date and time values. This was necessitated by the recent update to Snort and Barnyard2 that configures them to log the year in timestamps. The new logic correctly handles both types of Alert data (with year and without year in the timestamps).

2. Added a test for the existence of the "snort.inc" file prior to including it in the Dashboard widget's code. This file is only present when Snort is actually installed, and including it when it is not present results in a Dashboard crash as reported on the pfSense Packages Forum. If the "snort.inc" file does not exist, the code now gracefully exits and prints a message in the Snort Widget Dashboard table that "Snort is not installed'. This condition happened when a user removed the Snort package but not the Snort Dashboard Widget package.

3. Bump the version of the Snort Dashboard Widget to 1.0 from 0.5 to reflect the changes noted above.