mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
Adding Sources is possible now...
This commit is contained in:
parent
88f6233778
commit
3b4c77a62f
@ -54,25 +54,53 @@ IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' );
|
|||||||
|
|
||||||
// --- BEGIN Custom Code
|
// --- BEGIN Custom Code
|
||||||
|
|
||||||
// Only if the user is an admin!
|
|
||||||
//if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 )
|
|
||||||
// DieWithFriendlyErrorMsg( $content['LN_ADMIN_ERROR_NOTALLOWED'] );
|
|
||||||
|
|
||||||
if ( isset($_GET['op']) )
|
if ( isset($_GET['op']) )
|
||||||
{
|
{
|
||||||
if ($_GET['op'] == "add")
|
if ($_GET['op'] == "add")
|
||||||
{
|
{
|
||||||
// Set Mode to add
|
// Set Mode to add
|
||||||
$content['ISEDITORNEWSEARCH'] = "true";
|
$content['ISEDITORNEWSOURCE'] = "true";
|
||||||
$content['SEARCH_FORMACTION'] = "addnewsearch";
|
$content['SOURCE_FORMACTION'] = "addnewsource";
|
||||||
$content['SEARCH_SENDBUTTON'] = $content['LN_SEARCH_ADD'];
|
$content['SOURCE_SENDBUTTON'] = $content['LN_SOURCES_ADD'];
|
||||||
|
|
||||||
//PreInit these values
|
//PreInit these values
|
||||||
$content['DisplayName'] = "";
|
$content['Name'] = "";
|
||||||
$content['SearchQuery'] = "";
|
$content['SourceType'] = SOURCE_DISK;
|
||||||
|
CreateSourceTypesList($content['SourceType']);
|
||||||
|
|
||||||
|
// Init View List!
|
||||||
|
$content['SourceViewID'] = 'SYSLOG';
|
||||||
|
$content['VIEWS'] = $content['Views'];
|
||||||
|
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
|
||||||
|
$content['SourceLogLineType'] = "";
|
||||||
|
CreateLogLineTypesList($content['SourceLogLineType']);
|
||||||
|
$content['SourceDiskFile'] = "/var/log/syslog";
|
||||||
|
|
||||||
|
// SOURCE_DB specific
|
||||||
|
$content['SourceDBType'] = DB_MYSQL;
|
||||||
|
CreateDBTypesList($content['SourceDBType']);
|
||||||
|
$content['SourceDBName'] = "phplogcon";
|
||||||
|
$content['SourceDBTableType'] = "monitorware";
|
||||||
|
$content['SourceDBServer'] = "localhost";
|
||||||
|
$content['SourceDBTableName'] = "systemevents";
|
||||||
|
$content['SourceDBUser'] = "user";
|
||||||
|
$content['SourceDBPassword'] = "";
|
||||||
|
$content['SourceDBEnableRowCounting'] = "false";
|
||||||
|
$content['SourceDBEnableRowCounting_true'] = "";
|
||||||
|
$content['SourceDBEnableRowCounting_false'] = "checked";
|
||||||
|
|
||||||
|
// General stuff
|
||||||
$content['userid'] = null;
|
$content['userid'] = null;
|
||||||
$content['CHECKED_ISUSERONLY'] = "";
|
$content['CHECKED_ISUSERONLY'] = "";
|
||||||
$content['SEARCHID'] = "";
|
$content['SOURCEID'] = "";
|
||||||
|
|
||||||
// --- Check if groups are available
|
// --- Check if groups are available
|
||||||
$content['SUBGROUPS'] = GetGroupsForSelectfield();
|
$content['SUBGROUPS'] = GetGroupsForSelectfield();
|
||||||
@ -80,28 +108,6 @@ if ( isset($_GET['op']) )
|
|||||||
$content['ISGROUPSAVAILABLE'] = true;
|
$content['ISGROUPSAVAILABLE'] = true;
|
||||||
else
|
else
|
||||||
$content['ISGROUPSAVAILABLE'] = false;
|
$content['ISGROUPSAVAILABLE'] = false;
|
||||||
|
|
||||||
/*
|
|
||||||
$sqlquery = "SELECT " .
|
|
||||||
DB_GROUPS . ".ID as mygroupid, " .
|
|
||||||
DB_GROUPS . ".groupname " .
|
|
||||||
"FROM " . DB_GROUPS .
|
|
||||||
" ORDER BY " . DB_GROUPS . ".groupname";
|
|
||||||
$result = DB_Query($sqlquery);
|
|
||||||
$content['SUBGROUPS'] = DB_GetAllRows($result, true);
|
|
||||||
if ( isset($content['SUBGROUPS']) && count($content['SUBGROUPS']) > 0 )
|
|
||||||
{
|
|
||||||
// Process All Groups
|
|
||||||
for($i = 0; $i < count($content['SUBGROUPS']); $i++)
|
|
||||||
$content['SUBGROUPS'][$i]['group_selected'] = "";
|
|
||||||
|
|
||||||
// Enable Group Selection
|
|
||||||
$content['ISGROUPSAVAILABLE'] = true;
|
|
||||||
array_unshift( $content['SUBGROUPS'], array ("mygroupid" => -1, "groupname" => $content['LN_SEARCH_SELGROUPENABLE'], "group_selected" => "") );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$content['ISGROUPSAVAILABLE'] = false;*/
|
|
||||||
// ---
|
|
||||||
}
|
}
|
||||||
else if ($_GET['op'] == "edit")
|
else if ($_GET['op'] == "edit")
|
||||||
{
|
{
|
||||||
@ -240,9 +246,38 @@ if ( isset($_GET['op']) )
|
|||||||
|
|
||||||
if ( isset($_POST['op']) )
|
if ( isset($_POST['op']) )
|
||||||
{
|
{
|
||||||
if ( isset ($_POST['id']) ) { $content['SEARCHID'] = intval(DB_RemoveBadChars($_POST['id'])); } else {$content['SEARCHID'] = -1; }
|
// Read parameters first!
|
||||||
if ( isset ($_POST['DisplayName']) ) { $content['DisplayName'] = DB_RemoveBadChars($_POST['DisplayName']); } else {$content['DisplayName'] = ""; }
|
if ( isset($_POST['id']) ) { $content['SOURCEID'] = intval(DB_RemoveBadChars($_POST['id'])); } else {$content['SOURCEID'] = -1; }
|
||||||
if ( isset ($_POST['SearchQuery']) ) { $content['SearchQuery'] = DB_RemoveBadChars($_POST['SearchQuery']); } else {$content['SearchQuery'] = ""; }
|
if ( isset($_POST['Name']) ) { $content['Name'] = DB_RemoveBadChars($_POST['Name']); } else {$content['Name'] = ""; }
|
||||||
|
if ( isset($_POST['SourceType']) ) { $content['SourceType'] = DB_RemoveBadChars($_POST['SourceType']); }
|
||||||
|
if ( isset($_POST['SourceViewID']) ) { $content['SourceViewID'] = DB_RemoveBadChars($_POST['SourceViewID']); }
|
||||||
|
|
||||||
|
if ( isset($content['SourceType']) )
|
||||||
|
{
|
||||||
|
// Disk Params
|
||||||
|
if ( $content['SourceType'] == SOURCE_DISK )
|
||||||
|
{
|
||||||
|
if ( isset($_POST['SourceLogLineType']) ) { $content['SourceLogLineType'] = DB_RemoveBadChars($_POST['SourceLogLineType']); }
|
||||||
|
if ( isset($_POST['SourceDiskFile']) ) { $content['SourceDiskFile'] = DB_RemoveBadChars($_POST['SourceDiskFile']); }
|
||||||
|
}
|
||||||
|
// DB Params
|
||||||
|
else if ( $content['SourceType'] == SOURCE_DB || $content['SourceType'] == SOURCE_PDO )
|
||||||
|
{
|
||||||
|
if ( isset($_POST['SourceDBType']) ) { $content['SourceDBType'] = DB_RemoveBadChars($_POST['SourceDBType']); }
|
||||||
|
if ( isset($_POST['SourceDBName']) ) { $content['SourceDBName'] = DB_RemoveBadChars($_POST['SourceDBName']); }
|
||||||
|
if ( isset($_POST['SourceDBTableType']) ) { $content['SourceDBTableType'] = DB_RemoveBadChars($_POST['SourceDBTableType']); }
|
||||||
|
if ( isset($_POST['SourceDBServer']) ) { $content['SourceDBServer'] = DB_RemoveBadChars($_POST['SourceDBServer']); }
|
||||||
|
if ( isset($_POST['SourceDBTableName']) ) { $content['SourceDBTableName'] = DB_RemoveBadChars($_POST['SourceDBTableName']); }
|
||||||
|
if ( isset($_POST['SourceDBUser']) ) { $content['SourceDBUser'] = DB_RemoveBadChars($_POST['SourceDBUser']); }
|
||||||
|
if ( isset($_POST['SourceDBPassword']) ) { $content['SourceDBPassword'] = DB_RemoveBadChars($_POST['SourceDBPassword']); } else {$content['SourceDBPassword'] = ""; }
|
||||||
|
if ( isset($_POST['SourceDBEnableRowCounting']) )
|
||||||
|
{ // Extra Check for this propberty
|
||||||
|
$content['SourceDBEnableRowCounting'] = DB_RemoveBadChars($_POST['SourceViewID']);
|
||||||
|
if ( $_SESSION['SourceDBEnableRowCounting'] != "true" )
|
||||||
|
$_SESSION['SourceDBEnableRowCounting'] = "false";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// User & Group handeled specially
|
// User & Group handeled specially
|
||||||
if ( isset ($_POST['isuseronly']) )
|
if ( isset ($_POST['isuseronly']) )
|
||||||
@ -260,35 +295,127 @@ if ( isset($_POST['op']) )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// --- Check mandotary values
|
// --- Check mandotary values
|
||||||
if ( $content['DisplayName'] == "" )
|
if ( $content['Name'] == "" )
|
||||||
{
|
{
|
||||||
$content['ISERROR'] = true;
|
$content['ISERROR'] = true;
|
||||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_DISPLAYNAMEEMPTY'];
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_NAMEOFTHESOURCE'] );
|
||||||
}
|
}
|
||||||
else if ( $content['SearchQuery'] == "" )
|
else if ( !isset($content['SourceType']) )
|
||||||
{
|
{
|
||||||
$content['ISERROR'] = true;
|
$content['ISERROR'] = true;
|
||||||
$content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_SEARCHQUERYEMPTY'];
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_SOURCETYPE'] );
|
||||||
|
}
|
||||||
|
else if ( !isset($content['SourceViewID']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_VIEW'] );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Disk Params
|
||||||
|
if ( $content['SourceType'] == SOURCE_DISK )
|
||||||
|
{
|
||||||
|
if ( !isset($content['SourceLogLineType']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_LOGLINETYPE'] );
|
||||||
|
}
|
||||||
|
else if ( !isset($content['SourceDiskFile']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_SYSLOGFILE'] );
|
||||||
|
}
|
||||||
|
// Check if file is accessable!
|
||||||
|
else if ( !is_file($content['SourceDiskFile']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_NOTAVALIDFILE'], $content['SourceDiskFile'] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// DB Params
|
||||||
|
else if ( $content['SourceType'] == SOURCE_DB || $content['SourceType'] == SOURCE_PDO )
|
||||||
|
{
|
||||||
|
if ( !isset($content['SourceDBType']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DATABASETYPEOPTIONS'] );
|
||||||
|
}
|
||||||
|
else if ( !isset($content['SourceDBName']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DBNAME'] );
|
||||||
|
}
|
||||||
|
else if ( !isset($content['SourceDBTableType']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DBTABLETYPE'] );
|
||||||
|
}
|
||||||
|
else if ( !isset($content['SourceDBServer']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DBSERVER'] );
|
||||||
|
}
|
||||||
|
else if ( !isset($content['SourceDBTableName']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DBTABLENAME'] );
|
||||||
|
}
|
||||||
|
else if ( !isset($content['SourceDBUser']) )
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_MISSINGPARAM'], $content['LN_CFG_DBUSER'] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$content['ISERROR'] = true;
|
||||||
|
$content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_UNKNOWNSOURCE'], $content['SourceDBType'] );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// ---
|
|
||||||
|
|
||||||
|
// --- Now ADD/EDIT do the processing!
|
||||||
if ( !isset($content['ISERROR']) )
|
if ( !isset($content['ISERROR']) )
|
||||||
{
|
{
|
||||||
// Everything was alright, so we go to the next step!
|
// Everything was alright, so we go to the next step!
|
||||||
if ( $_POST['op'] == "addnewsearch" )
|
if ( $_POST['op'] == "addnewsource" )
|
||||||
{
|
{
|
||||||
// Add custom search now!
|
// Add custom search now!
|
||||||
$sqlquery = "INSERT INTO " . DB_SEARCHES . " (DisplayName, SearchQuery, userid, groupid)
|
if ( $content['SourceType'] == SOURCE_DISK )
|
||||||
VALUES ('" . $content['DisplayName'] . "',
|
{
|
||||||
'" . $content['SearchQuery'] . "',
|
$sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, SourceType, ViewID, LogLineType, DiskFile, userid, groupid)
|
||||||
" . $content['userid'] . ",
|
VALUES ('" . $content['Name'] . "',
|
||||||
" . $content['groupid'] . "
|
" . $content['SourceType'] . ",
|
||||||
)";
|
'" . $content['SourceViewID'] . "',
|
||||||
|
'" . $content['SourceLogLineType'] . "',
|
||||||
|
'" . $content['SourceDiskFile'] . "',
|
||||||
|
" . $content['userid'] . ",
|
||||||
|
" . $content['groupid'] . "
|
||||||
|
)";
|
||||||
|
}
|
||||||
|
else if ( $content['SourceType'] == SOURCE_DB || $content['SourceType'] == SOURCE_PDO )
|
||||||
|
{
|
||||||
|
$sqlquery = "INSERT INTO " . DB_SOURCES . " (Name, SourceType, ViewID, DBTableType, DBType, DBServer, DBName, DBUser, DBPassword, DBTableName, DBEnableRowCounting, userid, groupid)
|
||||||
|
VALUES ('" . $content['Name'] . "',
|
||||||
|
" . $content['SourceType'] . ",
|
||||||
|
'" . $content['SourceViewID'] . "',
|
||||||
|
'" . $content['SourceDBTableType'] . "',
|
||||||
|
" . $content['SourceDBType'] . ",
|
||||||
|
'" . $content['SourceDBServer'] . "',
|
||||||
|
'" . $content['SourceDBName'] . "',
|
||||||
|
'" . $content['SourceDBUser'] . "',
|
||||||
|
'" . $content['SourceDBPassword'] . "',
|
||||||
|
'" . $content['SourceDBTableName'] . "',
|
||||||
|
" . $content['SourceDBEnableRowCounting'] . ",
|
||||||
|
" . $content['userid'] . ",
|
||||||
|
" . $content['groupid'] . "
|
||||||
|
)";
|
||||||
|
}
|
||||||
|
|
||||||
$result = DB_Query($sqlquery);
|
$result = DB_Query($sqlquery);
|
||||||
DB_FreeQuery($result);
|
DB_FreeQuery($result);
|
||||||
|
|
||||||
// Do the final redirect
|
// Do the final redirect
|
||||||
RedirectResult( GetAndReplaceLangStr( $content['LN_SEARCH_HASBEENADDED'], $content['DisplayName'] ) , "searches.php" );
|
RedirectResult( GetAndReplaceLangStr( $content['LN_SOURCE_HASBEENADDED'], $content['Name'] ) , "sources.php" );
|
||||||
}
|
}
|
||||||
else if ( $_POST['op'] == "editsearch" )
|
else if ( $_POST['op'] == "editsearch" )
|
||||||
{
|
{
|
||||||
@ -384,7 +511,6 @@ if ( !isset($_POST['op']) && !isset($_GET['op']) )
|
|||||||
}
|
}
|
||||||
// ---
|
// ---
|
||||||
// print_r ( $content['SOURCES'] );
|
// print_r ( $content['SOURCES'] );
|
||||||
|
|
||||||
}
|
}
|
||||||
// --- END Custom Code
|
// --- END Custom Code
|
||||||
|
|
||||||
|
@ -100,7 +100,6 @@ function InitSourceConfigs()
|
|||||||
{
|
{
|
||||||
// Perform necessary include
|
// Perform necessary include
|
||||||
require_once($gl_root_path . 'classes/logstreamconfigdisk.class.php');
|
require_once($gl_root_path . 'classes/logstreamconfigdisk.class.php');
|
||||||
|
|
||||||
$content['Sources'][$iSourceID]['ObjRef'] = new LogStreamConfigDisk();
|
$content['Sources'][$iSourceID]['ObjRef'] = new LogStreamConfigDisk();
|
||||||
$content['Sources'][$iSourceID]['ObjRef']->FileName = $mysource['DiskFile'];
|
$content['Sources'][$iSourceID]['ObjRef']->FileName = $mysource['DiskFile'];
|
||||||
$content['Sources'][$iSourceID]['ObjRef']->LineParserType = $mysource['LogLineType'];
|
$content['Sources'][$iSourceID]['ObjRef']->LineParserType = $mysource['LogLineType'];
|
||||||
@ -156,8 +155,8 @@ function InitSourceConfigs()
|
|||||||
// UNKNOWN, remove config entry!
|
// UNKNOWN, remove config entry!
|
||||||
unset($content['Sources'][$iSourceID]);
|
unset($content['Sources'][$iSourceID]);
|
||||||
|
|
||||||
// TODO: Output CONFIG WARNING
|
// Output CRITICAL WARNING
|
||||||
die( "Not supported yet!" );
|
DieWithFriendlyErrorMsg( GetAndReplaceLangStr($content['LN_GEN_CRITERROR_UNKNOWNTYPE'], $mysource['SourceType']) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set generic configuration options
|
// Set generic configuration options
|
||||||
@ -446,9 +445,8 @@ function LoadSourcesFromDatabase()
|
|||||||
" WHERE (" . DB_SOURCES . ".userid IS NULL AND " . DB_SOURCES . ".groupid IS NULL) " .
|
" WHERE (" . DB_SOURCES . ".userid IS NULL AND " . DB_SOURCES . ".groupid IS NULL) " .
|
||||||
$szWhereUser .
|
$szWhereUser .
|
||||||
$szGroupWhere .
|
$szGroupWhere .
|
||||||
" ORDER BY " . DB_SOURCES . ".userid, " . DB_SOURCES . ".groupid, " . DB_SOURCES . ".DisplayName";
|
" ORDER BY " . DB_SOURCES . ".userid, " . DB_SOURCES . ".groupid, " . DB_SOURCES . ".Name";
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
// Get Sources from DB now!
|
// Get Sources from DB now!
|
||||||
$result = DB_Query($sqlquery);
|
$result = DB_Query($sqlquery);
|
||||||
$myrows = DB_GetAllRows($result, true);
|
$myrows = DB_GetAllRows($result, true);
|
||||||
@ -456,12 +454,12 @@ function LoadSourcesFromDatabase()
|
|||||||
{
|
{
|
||||||
// Overwrite existing Views array
|
// Overwrite existing Views array
|
||||||
unset($CFG['Sources']);
|
unset($CFG['Sources']);
|
||||||
|
|
||||||
// Unpack the Columns and append to Views Array
|
// Append to Source Array
|
||||||
foreach ($myrows as &$mySource )
|
foreach ($myrows as &$mySource )
|
||||||
{
|
{
|
||||||
// Append to Views Array
|
// Append to Source Array
|
||||||
$CFG['Sources'][ $mySource['ID'] ] = $mySource['ID'];
|
$CFG['Sources'][ $mySource['ID'] ] = $mySource; //['ID'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy to content array!
|
// Copy to content array!
|
||||||
|
@ -190,7 +190,13 @@ $content['LN_SOURCES_DISK'] = "Diskfile";
|
|||||||
$content['LN_SOURCES_DB'] = "MySQL Database";
|
$content['LN_SOURCES_DB'] = "MySQL Database";
|
||||||
$content['LN_SOURCES_PDO'] = "PDO Datasource";
|
$content['LN_SOURCES_PDO'] = "PDO Datasource";
|
||||||
$content['LN_SOURCES_ADD'] = "Add new Source";
|
$content['LN_SOURCES_ADD'] = "Add new Source";
|
||||||
$content['LN_SOURCES_'] = "";
|
$content['LN_SOURCES_ADDEDIT'] = "Add / Edit a Source";
|
||||||
|
$content['LN_SOURCES_TYPE'] = "Source Type";
|
||||||
|
$content['LN_SOURCES_DISKTYPEOPTIONS'] = "Diskfile related Options";
|
||||||
|
$content['LN_SOURCES_ERROR_MISSINGPARAM'] = "The paramater '%1' is missing.";
|
||||||
|
$content['LN_SOURCES_ERROR_NOTAVALIDFILE'] = "Failed to open the syslog file '%1'! Check if the file exists and phplogcon has sufficient rights to it";
|
||||||
|
$content['LN_SOURCES_ERROR_UNKNOWNSOURCE'] = "Unknown Source '%1' detected";
|
||||||
|
$content['LN_SOURCE_HASBEENADDED'] = "The new Source '%1' has been successfully added.";
|
||||||
$content['LN_SOURCES_'] = "";
|
$content['LN_SOURCES_'] = "";
|
||||||
$content['LN_SOURCES_'] = "";
|
$content['LN_SOURCES_'] = "";
|
||||||
$content['LN_SOURCES_'] = "";
|
$content['LN_SOURCES_'] = "";
|
||||||
|
@ -57,6 +57,8 @@ $content['LN_GEN_DB_FIREBIRD'] = "Firebird/Interbase 6";
|
|||||||
$content['LN_GEN_DB_INFORMIX'] = "IBM Informix Dynamic Server";
|
$content['LN_GEN_DB_INFORMIX'] = "IBM Informix Dynamic Server";
|
||||||
$content['LN_GEN_DB_SQLITE'] = "SQLite 2";
|
$content['LN_GEN_DB_SQLITE'] = "SQLite 2";
|
||||||
$content['LN_GEN_SELECTVIEW'] = "Select View";
|
$content['LN_GEN_SELECTVIEW'] = "Select View";
|
||||||
|
$content['LN_GEN_CRITERROR_UNKNOWNTYPE'] = "The source type '%1' is not supported by phpLogCon yet. This is a critical error, please fix your configuration.";
|
||||||
|
|
||||||
|
|
||||||
// Topmenu Entries
|
// Topmenu Entries
|
||||||
$content['LN_MENU_SEARCH'] = "Search";
|
$content['LN_MENU_SEARCH'] = "Search";
|
||||||
|
@ -1,5 +1,34 @@
|
|||||||
<!-- INCLUDE include_header.html -->
|
<!-- INCLUDE include_header.html -->
|
||||||
|
|
||||||
|
<script language="javascript">
|
||||||
|
/*
|
||||||
|
* Helper function to show and hide areas of the filterview
|
||||||
|
*/
|
||||||
|
function toggleSourceTypeVisibility(FormFieldName)
|
||||||
|
{
|
||||||
|
var myfield = document.getElementById(FormFieldName);
|
||||||
|
if (myfield.value == 1)
|
||||||
|
{
|
||||||
|
showvisibility("HiddenDiskTypeOptions");
|
||||||
|
hidevisibility("HiddenDatabaseTypeOptions");
|
||||||
|
}
|
||||||
|
else if (myfield.value == 2)
|
||||||
|
{
|
||||||
|
showvisibility("HiddenDatabaseTypeOptions");
|
||||||
|
hidevisibility("HiddenDiskTypeOptions");
|
||||||
|
|
||||||
|
hidevisibility("HiddenDBTYpesOptions");
|
||||||
|
}
|
||||||
|
else if (myfield.value == 3)
|
||||||
|
{
|
||||||
|
showvisibility("HiddenDatabaseTypeOptions");
|
||||||
|
hidevisibility("HiddenDiskTypeOptions");
|
||||||
|
|
||||||
|
showvisibility("HiddenDBTYpesOptions");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<!-- IF ISERROR="true" -->
|
<!-- IF ISERROR="true" -->
|
||||||
<center>
|
<center>
|
||||||
<h3><font color="red">{ERROR_MSG}</font></h3>
|
<h3><font color="red">{ERROR_MSG}</font></h3>
|
||||||
@ -47,19 +76,36 @@
|
|||||||
</table>
|
</table>
|
||||||
<!-- ENDIF LISTSOURCES="true" -->
|
<!-- ENDIF LISTSOURCES="true" -->
|
||||||
|
|
||||||
<!-- IF ISEDITORNEWSEARCH="true" -->
|
<!-- IF ISEDITORNEWSOURCE="true" -->
|
||||||
<form action="{BASEPATH}admin/searches.php" method="post">
|
<form action="{BASEPATH}admin/sources.php" method="post">
|
||||||
|
|
||||||
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" class="cellmenu1" colspan="2"><b>{LN_SEARCH_ADDEDIT}</b></td>
|
<td align="center" class="cellmenu1" colspan="2"><b>{LN_SOURCES_ADDEDIT}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" class="cellmenu2" width="250"><b>{LN_SEARCH_NAME}</b></td>
|
<td align="left" class="cellmenu2" width="250"><b>{LN_SOURCES_NAME}</b></td>
|
||||||
<td align="right" class="line1" width="350"><input type="text" name="DisplayName" size="55" maxlength="255" value="{DisplayName}"></td>
|
<td align="right" class="line1" width="350"><input type="text" name="Name" size="55" maxlength="255" value="{Name}"></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td>
|
<td align="left" class="cellmenu2" nowrap><b>{LN_SOURCES_TYPE}</b></td>
|
||||||
<td align="right" class="line2"><input type="text" name="SearchQuery" size="55" maxlength="1024" value="{SearchQuery}"></td>
|
<td align="right" class="line1">
|
||||||
|
<select id="SourceType" name="SourceType" size="1" OnChange="toggleSourceTypeVisibility('SourceType');">
|
||||||
|
<!-- BEGIN SOURCETYPES -->
|
||||||
|
<option {selected} value="{type}">{DisplayName}</option>
|
||||||
|
<!-- END SOURCETYPES -->
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_VIEW}</b></td>
|
||||||
|
<td align="right" class="line1">
|
||||||
|
<select id="SourceViewID" name="SourceViewID" size="1">
|
||||||
|
<!-- BEGIN VIEWS -->
|
||||||
|
<option {selected} value="{ID}">{DisplayName}</option>
|
||||||
|
<!-- END VIEWS -->
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td>
|
<td align="left" class="cellmenu2"><b>{LN_GEN_USERONLY}</b></td>
|
||||||
@ -67,7 +113,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<!-- IF ISGROUPSAVAILABLE="true" -->
|
<!-- IF ISGROUPSAVAILABLE="true" -->
|
||||||
<tr>
|
<tr>
|
||||||
<td align="left" class="cellmenu2"><b>{LN_SEARCH_GROUPONLY}</b></td>
|
<td align="left" class="cellmenu2"><b>{LN_GEN_GROUPONLY}</b></td>
|
||||||
<td align="right" class="line2">
|
<td align="right" class="line2">
|
||||||
<select name="groupid" size="1" STYLE="width: 300px">
|
<select name="groupid" size="1" STYLE="width: 300px">
|
||||||
<!-- BEGIN SUBGROUPS -->
|
<!-- BEGIN SUBGROUPS -->
|
||||||
@ -76,17 +122,100 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</table>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<div id="HiddenDiskTypeOptions" class="HiddenContent">
|
||||||
|
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
||||||
|
<tr><td align="center" class="cellmenu1" colspan="2"><b>{LN_SOURCES_DISKTYPEOPTIONS}</b></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" width="250" nowrap><b>{LN_CFG_LOGLINETYPE}</b></td>
|
||||||
|
<td align="right" class="line0" width="350">
|
||||||
|
<select name="SourceLogLineType" size="1">
|
||||||
|
<!-- BEGIN LOGLINETYPES -->
|
||||||
|
<option {selected} value="{type}">{DisplayName}</option>
|
||||||
|
<!-- END LOGLINETYPES -->
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_SYSLOGFILE}</b></td>
|
||||||
|
<td align="right" class="line1"><input type="text" name="SourceDiskFile" size="50" maxlength="255" value="{SourceDiskFile}"></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="HiddenDatabaseTypeOptions" class="HiddenContent">
|
||||||
|
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
|
||||||
|
<tr><td align="center" class="cellmenu1" colspan="2"><b>{LN_CFG_DATABASETYPEOPTIONS}</b></td></tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<div id="HiddenDBTYpesOptions" class="HiddenContent">
|
||||||
|
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" width="250" nowrap><b>{LN_CFG_DBSTORAGEENGINE}</b></td>
|
||||||
|
<td align="right" class="line1" width="350">
|
||||||
|
<select name="SourceDBType" size="1">
|
||||||
|
<!-- BEGIN DBTYPES -->
|
||||||
|
<option {selected} value="{type}">{DisplayName}</option>
|
||||||
|
<!-- END DBTYPES -->
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table border="0" cellpadding="1" cellspacing="1" width="600" align="center" class="with_border">
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" width="250" nowrap><b>{LN_CFG_DBTABLETYPE}</b></td>
|
||||||
|
<td align="right" class="line0" width="350"><input type="text" name="SourceDBTableType" size="40" maxlength="255" value="{SourceDBTableType}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBSERVER}</b></td>
|
||||||
|
<td align="right" class="line0"><input type="text" name="SourceDBServer" size="40" maxlength="255" value="{SourceDBServer}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBNAME}</b></td>
|
||||||
|
<td align="right" class="line1"><input type="text" name="SourceDBName" size="40" maxlength="255" value="{SourceDBName}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBTABLENAME}</b></td>
|
||||||
|
<td align="right" class="line0"><input type="text" name="SourceDBTableName" size="40" maxlength="255" value="{SourceDBTableName}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBUSER}</b></td>
|
||||||
|
<td align="right" class="line1"><input type="text" name="SourceDBUser" size="40" maxlength="255" value="{SourceDBUser}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBPASSWORD}</b></td>
|
||||||
|
<td align="right" class="line0"><input type="password" name="SourceDBPassword" size="40" maxlength="255" value="{SourceDBPassword}"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="left" class="cellmenu2" nowrap><b>{LN_CFG_DBROWCOUNTING}</b></td>
|
||||||
|
<td align="right" class="line1" width="100%">
|
||||||
|
<input type="radio" name="SourceDBEnableRowCounting" value="true" {SourceDBEnableRowCounting_true}> Yes <input type="radio" name="SourceDBEnableRowCounting" value="false" {SourceDBEnableRowCounting_false}> No
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#DDDDDD" width="600" class="with_border_alternate">
|
||||||
<!-- ENDIF ISGROUPSAVAILABLE="true" -->
|
<!-- ENDIF ISGROUPSAVAILABLE="true" -->
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center" colspan="2">
|
<td align="center" colspan="2">
|
||||||
<input type="submit" value="{SEARCH_SENDBUTTON}">
|
<input type="submit" value="{SOURCE_SENDBUTTON}">
|
||||||
<input type="hidden" name="op" value="{SEARCH_FORMACTION}">
|
<input type="hidden" name="op" value="{SOURCE_FORMACTION}">
|
||||||
<input type="hidden" name="id" value="{SEARCHID}">
|
<input type="hidden" name="id" value="{SOURCEID}">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
<!-- ENDIF ISEDITORNEWSEARCH="true" -->
|
|
||||||
|
<script language="javascript">
|
||||||
|
// Manually perform initial Javascript Calls
|
||||||
|
toggleSourceTypeVisibility('SourceType');
|
||||||
|
</script>
|
||||||
|
<!-- ENDIF ISEDITORNEWSOURCE="true" -->
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user