Added View selector into the installer and the new EnableIPAddressResolve option.

Both lately added features can be configured during the installation as well now.
This commit is contained in:
Andre Lorbach 2008-06-09 17:21:44 +02:00
parent 06e2e4a974
commit 777e694140
6 changed files with 77 additions and 17 deletions

View File

@ -75,7 +75,8 @@ $CFG['EnableIPAddressResolve'] = 1; // If enabled, IP Addresses inline message
// --- Define which fields you want to see
//$CFG['ShowMessage'] = true; // If enabled, the Message column will be appended to the columns list.
//Eventlog based fields: $CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_HOST, SYSLOG_EVENT_LOGTYPE, SYSLOG_EVENT_SOURCE, /*SYSLOG_EVENT_CATEGORY, */SYSLOG_EVENT_ID, SYSLOG_MESSAGE );
$CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_SEVERITY, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_MESSAGETYPE, SYSLOG_MESSAGE );
//$CFG['Columns'] = array ( SYSLOG_DATE, SYSLOG_FACILITY, SYSLOG_SEVERITY, SYSLOG_HOST, SYSLOG_SYSLOGTAG, SYSLOG_MESSAGETYPE, SYSLOG_MESSAGE );
$CFG['DefaultViewsID'] = "";
// ---
// --- Predefined Searches!
@ -91,22 +92,24 @@ $CFG['Search'][] = array ( "DisplayName" => "All messages from last 31 days", "S
// --- Source Options
/* Example for DiskType Source:
$CFG['Sources'][Source1]['ID'] = "Source1";
$CFG['Sources'][Source1]['Name'] = "Syslog Disk File";
$CFG['Sources'][Source1]['SourceType'] = SOURCE_DISK;
$CFG['Sources'][Source1]['LogLineType'] = "syslog";
$CFG['Sources'][Source1]['DiskFile'] = "/var/log/syslog";
$CFG['Sources']['Source1']['ID'] = "Source1";
$CFG['Sources']['Source1']['Name'] = "Syslog Disk File";
$CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK;
$CFG['Sources']['Source1']['LogLineType'] = "syslog";
$CFG['Sources']['Source1']['DiskFile'] = "/var/log/syslog";
$CFG['Sources']['Source1']['ViewID'] = "SYSLOG";
$CFG['Sources'][Source2]['ID'] = "Source5";
$CFG['Sources'][Source2]['Name'] = "WinSyslog DB";
$CFG['Sources'][Source2]['SourceType'] = SOURCE_DB;
$CFG['Sources'][Source2]['DBTableType'] = "winsyslog";
$CFG['Sources'][Source2]['DBType'] = DB_MYSQL;
$CFG['Sources'][Source2]['DBServer'] = "localhost";
$CFG['Sources'][Source2]['DBName'] = "phplogcon";
$CFG['Sources'][Source2]['DBUser'] = "root";
$CFG['Sources'][Source2]['DBPassword'] = "";
$CFG['Sources'][Source2]['DBTableName'] = "systemevents";
$CFG['Sources']['Source2']['ID'] = "Source5";
$CFG['Sources']['Source2']['Name'] = "WinSyslog DB";
$CFG['Sources']['Source2']['SourceType'] = SOURCE_DB;
$CFG['Sources']['Source2']['DBTableType'] = "winsyslog";
$CFG['Sources']['Source2']['DBType'] = DB_MYSQL;
$CFG['Sources']['Source2']['DBServer'] = "localhost";
$CFG['Sources']['Source2']['DBName'] = "phplogcon";
$CFG['Sources']['Source2']['DBUser'] = "root";
$CFG['Sources']['Source2']['DBPassword'] = "";
$CFG['Sources']['Source2']['DBTableName'] = "systemevents";
$CFG['Sources']['Source2']['ViewID'] = "SYSLOG";
*/
// --- %Insert Source Here%

View File

@ -78,6 +78,7 @@
else
// Not configured, maybe old legacy cfg. Set default view.
$content['Sources'][$iSourceID]['ViewID'] = strlen($CFG['DefaultViewsID']) > 0 ? $CFG['DefaultViewsID'] : "SYSLOG";
}
// Only for the display box

View File

@ -228,6 +228,17 @@ else if ( $content['INSTALL_STEP'] == 3 )
$content['ViewEnableDetailPopups_true'] = "";
$content['ViewEnableDetailPopups_false'] = "checked";
}
if ( isset($_SESSION['EnableIPAddressResolve']) ) { $content['EnableIPAddressResolve'] = $_SESSION['EnableIPAddressResolve']; } else { $content['EnableIPAddressResolve'] = 1; }
if ( $content['EnableIPAddressResolve'] == 1 )
{
$content['EnableIPAddressResolve_true'] = "checked";
$content['EnableIPAddressResolve_false'] = "";
}
else
{
$content['EnableIPAddressResolve_true'] = "";
$content['EnableIPAddressResolve_false'] = "checked";
}
// ---
// Disable the bottom next button, as the Form in this step has its own button!
@ -315,6 +326,12 @@ else if ( $content['INSTALL_STEP'] == 4 )
$_SESSION['ViewEnableDetailPopups'] = intval( DB_RemoveBadChars($_POST['ViewEnableDetailPopups']) );
else
$_SESSION['ViewEnableDetailPopups'] = 1; // Fallback default!
if ( isset($_POST['EnableIPAddressResolve']) )
$_SESSION['EnableIPAddressResolve'] = intval( DB_RemoveBadChars($_POST['EnableIPAddressResolve']) );
else
$_SESSION['EnableIPAddressResolve'] = 1; // Fallback default!
// ---
// If UserDB is disabled, skip next step!
@ -464,6 +481,17 @@ else if ( $content['INSTALL_STEP'] == 7 )
CreateSourceTypesList($content['SourceType']);
if ( isset($_SESSION['SourceName']) ) { $content['SourceName'] = $_SESSION['SourceName']; } else { $content['SourceName'] = "My Syslog Source"; }
// Init default View
if ( isset($_SESSION['SourceViewID']) ) { $content['SourceViewID'] = $_SESSION['SourceViewID']; } else { $content['SourceViewID'] = 'SYSLOG'; }
foreach ( $content['Views'] as $myView )
{
if ( $myView['ID'] == $content['SourceViewID'] )
$content['Views'][ $myView['ID'] ]['selected'] = "selected";
else
$content['Views'][ $myView['ID'] ]['selected'] = "";
}
// SOURCE_DISK specific
if ( isset($_SESSION['SourceLogLineType']) ) { $content['SourceLogLineType'] = $_SESSION['SourceLogLineType']; } else { $content['SourceLogLineType'] = ""; }
CreateLogLineTypesList($content['SourceLogLineType']);
@ -510,6 +538,12 @@ else if ( $content['INSTALL_STEP'] == 8 )
else
RevertOneStep( $content['INSTALL_STEP']-1, $content['LN_CFG_PARAMMISSING'] . $content['LN_CFG_NAMEOFTHESOURCE'] );
if ( isset($_POST['SourceViewID']) )
$_SESSION['SourceViewID'] = DB_RemoveBadChars($_POST['SourceViewID']);
else
RevertOneStep( $content['INSTALL_STEP']-1, $content['LN_CFG_PARAMMISSING'] . $content['LN_CFG_VIEW'] );
// Check DISK Parameters!
if ( $_SESSION['SourceType'] == SOURCE_DISK)
{
@ -581,10 +615,12 @@ else if ( $content['INSTALL_STEP'] == 8 )
$patterns[] = "/\\\$CFG\['ViewMessageCharacterLimit'\] = [0-9]{1,2};/";
$patterns[] = "/\\\$CFG\['ViewEntriesPerPage'\] = [0-9]{1,2};/";
$patterns[] = "/\\\$CFG\['ViewEnableDetailPopups'\] = [0-9]{1,2};/";
$patterns[] = "/\\\$CFG\['EnableIPAddressResolve'\] = [0-9]{1,2};/";
$patterns[] = "/\\\$CFG\['UserDBEnabled'\] = [0-9]{1,2};/";
$replacements[] = "\$CFG['ViewMessageCharacterLimit'] = " . $_SESSION['ViewMessageCharacterLimit'] . ";";
$replacements[] = "\$CFG['ViewEntriesPerPage'] = " . $_SESSION['ViewEntriesPerPage'] . ";";
$replacements[] = "\$CFG['ViewEnableDetailPopups'] = " . $_SESSION['ViewEnableDetailPopups'] . ";";
$replacements[] = "\$CFG['EnableIPAddressResolve'] = " . $_SESSION['EnableIPAddressResolve'] . ";";
$replacements[] = "\$CFG['UserDBEnabled'] = " . $_SESSION['UserDBEnabled'] . ";";
//User Database Options
@ -596,7 +632,9 @@ else if ( $content['INSTALL_STEP'] == 8 )
//Add the first source!
$firstsource = "\$CFG['DefaultSourceID'] = 'Source1';\n\n" .
"\$CFG['Sources']['Source1']['ID'] = 'Source1';\n" .
"\$CFG['Sources']['Source1']['Name'] = '" . $_SESSION['SourceName'] . "';\n";
"\$CFG['Sources']['Source1']['Name'] = '" . $_SESSION['SourceName'] . "';\n" .
"\$CFG['Sources']['Source1']['ViewID'] = '" . $_SESSION['SourceViewID'] . "';\n";
if ( $_SESSION['SourceType'] == SOURCE_DISK )
{
$firstsource .= "\$CFG['Sources']['Source1']['SourceType'] = SOURCE_DISK;\n" .

View File

@ -145,6 +145,7 @@ $content['LN_CFG_DBSTORAGEENGINE'] = "Datenbank Typ";
$content['LN_CFG_DBTABLENAME'] = "Datenbank Tabellenname";
$content['LN_CFG_NAMEOFTHESOURCE'] = "Name der Quelle";
$content['LN_CFG_FIRSTSYSLOGSOURCE'] = "Erste Syslog Quelle";
$content['LN_CFG_VIEW'] = "Select View";
// Details page
$content['LN_DETAILS_FORSYSLOGMSG'] = "Details für syslog-Nachrichten mit der ID";

View File

@ -148,6 +148,7 @@ $content['LN_CFG_DBTABLENAME'] = "Database Tablename";
$content['LN_CFG_NAMEOFTHESOURCE'] = "Name of the Source";
$content['LN_CFG_FIRSTSYSLOGSOURCE'] = "First Syslog Source";
$content['LN_CFG_DBROWCOUNTING'] = "Enable Row Counting";
$content['LN_CFG_VIEW'] = "Select View";
// Details page
$content['LN_DETAILS_FORSYSLOGMSG'] = "Details for the syslog messages with id";

View File

@ -183,6 +183,12 @@
<input type="radio" name="ViewEnableDetailPopups" value="1" {ViewEnableDetailPopups_true}> Yes <input type="radio" name="ViewEnableDetailPopups" value="0" {ViewEnableDetailPopups_false}> No
</td>
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>Automatically resolved IP Addresses (inline)</b></td>
<td align="right" class="line1" width="100%">
<input type="radio" name="EnableIPAddressResolve" value="1" {EnableIPAddressResolve_true}> Yes <input type="radio" name="EnableIPAddressResolve" value="0" {EnableIPAddressResolve_false}> No
</td>
</tr>
</table>
<p>&nbsp;</p>
@ -301,6 +307,16 @@
</select>
</td>
</tr>
<tr>
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_VIEW}</b></td>
<td align="right" class="line1" width="100%">
<select id="SourceViewID" name="SourceViewID" size="1">
<!-- BEGIN Views -->
<option {selected} value="{ID}">{DisplayName}</option>
<!-- END Views -->
</select>
</td>
</tr>
</table>
<div id="HiddenDiskTypeOptions" class="HiddenContent">