mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-26 03:09:21 +02:00
Added new configuration variable to set the default SourceID
If the default source id differs from the current used one, the sourceid variable will be appened into the search form, as well as into all needed links within phplogcon. This makes it easier to copy and send links around.
This commit is contained in:
parent
4b9e8c2994
commit
761ee2f92c
@ -132,8 +132,12 @@
|
||||
$currentSourceID = $_SESSION['currentSourceID'];
|
||||
else
|
||||
{
|
||||
// No Source stored in session, then to so now!
|
||||
$_SESSION['currentSourceID'] = $currentSourceID;
|
||||
if ( isset($CFG['DefaultSourceID']) && isset($content['Sources'][ $CFG['DefaultSourceID'] ]) )
|
||||
// Set Source to preconfigured sourceID!
|
||||
$_SESSION['currentSourceID'] = $CFG['DefaultSourceID'];
|
||||
else
|
||||
// No Source stored in session, then to so now!
|
||||
$_SESSION['currentSourceID'] = $currentSourceID;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,13 +67,36 @@ function InstallFileReminder()
|
||||
|
||||
function CreateCurrentUrl()
|
||||
{
|
||||
global $content;
|
||||
global $content, $CFG;
|
||||
$content['CURRENTURL'] = $_SERVER['PHP_SELF']; // . "?" . $_SERVER['QUERY_STRING']
|
||||
|
||||
// Init additional_url helper variable
|
||||
$content['additional_url'] = "";
|
||||
$content['additional_url_uidonly'] = "";
|
||||
$content['additional_url_sortingonly'] = "";
|
||||
$content['additional_url_sourceonly'] = "";
|
||||
|
||||
// Hidden Vars Counter
|
||||
$hvCounter = 0;
|
||||
|
||||
// Append SourceID into everything!
|
||||
if ( (isset($CFG['DefaultSourceID']) && isset($content['Sources'][ $CFG['DefaultSourceID'] ])) && isset($_SESSION['currentSourceID']) )
|
||||
{
|
||||
|
||||
// If the DefaultSourceID differes from the SourceID in our Session, we will append the sourceid within all URL's!
|
||||
if ( $CFG['DefaultSourceID'] != $_SESSION['currentSourceID'] )
|
||||
{
|
||||
$content['additional_url'] .= "&sourceid=" . $_SESSION['currentSourceID'];
|
||||
$content['additional_url_uidonly'] = "&sourceid=" . $_SESSION['currentSourceID'];
|
||||
$content['additional_url_sortingonly'] = "&sourceid=" . $_SESSION['currentSourceID'];
|
||||
$content['additional_url_sourceonly'] = "&sourceid=" . $_SESSION['currentSourceID'];
|
||||
|
||||
// For forms!
|
||||
$content['HIDDENVARS_SOURCE'][$hvCounter]['varname'] = "sourceid";
|
||||
$content['HIDDENVARS_SOURCE'][$hvCounter]['varvalue'] = $_SESSION['currentSourceID'];
|
||||
$hvCounter++;
|
||||
}
|
||||
}
|
||||
|
||||
// Now the query string:
|
||||
if ( isset($_SERVER['QUERY_STRING']) && strlen($_SERVER['QUERY_STRING']) > 0 )
|
||||
@ -82,7 +105,6 @@ function CreateCurrentUrl()
|
||||
$content['CURRENTURL'] .= "?";
|
||||
|
||||
$queries = explode ("&", $_SERVER['QUERY_STRING']);
|
||||
$counter = 0;
|
||||
for ( $i = 0; $i < count($queries); $i++ )
|
||||
{
|
||||
// Some properties need to be filtered out.
|
||||
@ -92,8 +114,8 @@ function CreateCurrentUrl()
|
||||
if ( isset($tmpvars[1]) ) // Only if value param is set!
|
||||
{
|
||||
// For forms!
|
||||
$content['HIDDENVARS'][$counter]['varname'] = $tmpvars[0];
|
||||
$content['HIDDENVARS'][$counter]['varvalue'] = $tmpvars[1];
|
||||
$content['HIDDENVARS'][$hvCounter]['varname'] = $tmpvars[0];
|
||||
$content['HIDDENVARS'][$hvCounter]['varvalue'] = $tmpvars[1];
|
||||
|
||||
if ( strlen($tmpvars[1]) > 0 )
|
||||
{
|
||||
@ -114,7 +136,7 @@ function CreateCurrentUrl()
|
||||
$content['additional_url'] .= "&" . $tmpvars[0] . "=" . $tmpvars[1];
|
||||
}
|
||||
|
||||
$counter++;
|
||||
$hvCounter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -592,7 +592,8 @@ else if ( $content['INSTALL_STEP'] == 8 )
|
||||
}
|
||||
|
||||
//Add the first source!
|
||||
$firstsource = "\$CFG['Sources']['Source1']['ID'] = 'Source1';\r\n" .
|
||||
$firstsource = "\$CFG['DefaultSourceID'] = 'Source1';\r\n\r\n" .
|
||||
"\$CFG['Sources']['Source1']['ID'] = 'Source1';\r\n" .
|
||||
"\$CFG['Sources']['Source1']['Name'] = '" . $_SESSION['SourceName'] . "';\r\n" .
|
||||
"\$CFG['Sources']['Source1']['SourceType'] = " . $_SESSION['SourceType'] . ";\r\n";
|
||||
if ( $_SESSION['SourceType'] == SOURCE_DISK )
|
||||
|
@ -169,9 +169,15 @@ if ( (isset($_POST['search']) || isset($_GET['search'])) )
|
||||
if ( isset($_GET['filter_message']) && strlen($_GET['filter_message']) > 0 )
|
||||
$content['searchstr'] .= $_GET['filter_message'];
|
||||
}
|
||||
|
||||
// Append sourceid if needed
|
||||
if ( isset($_GET['sourceid']) && isset($content['Sources'][ $_GET['sourceid'] ]) )
|
||||
$sourceidstr = "&sourceid=" . $_GET['sourceid'];
|
||||
else
|
||||
$sourceidstr = "";
|
||||
|
||||
// Redirect to the index page now!
|
||||
RedirectPage( "index.php?filter=" . urlencode( trim($content['searchstr']) ) . "&search=Search");
|
||||
RedirectPage( "index.php?filter=" . urlencode( trim($content['searchstr']) ) . "&search=Search" . $sourceidstr);
|
||||
}
|
||||
// ---
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
<table width="100%" align="center" border="0" cellpadding="1" cellspacing="1" class="with_border">
|
||||
<tr>
|
||||
<td nowrap width="100%"class="line2" align="left" valign="top">
|
||||
<a href="index.php?uid={uid_current}" target="_top"><img src="{MENU_HOMEPAGE}" width="16" align="left" title="{LN_DETAIL_BACKTOLIST}">{LN_DETAIL_BACKTOLIST}</a>
|
||||
<a href="index.php?uid={uid_current}{additional_url_sourceonly}" target="_top"><img src="{MENU_HOMEPAGE}" width="16" align="left" title="{LN_DETAIL_BACKTOLIST}">{LN_DETAIL_BACKTOLIST}</a>
|
||||
<!-- IF main_currentpagenumber_found="true" -->
|
||||
{LN_GEN_PAGE} {main_currentpagenumber}
|
||||
<!-- ENDIF main_currentpagenumber_found="true" -->
|
||||
|
@ -2,6 +2,9 @@
|
||||
|
||||
<table border="0" cellspacing="0" cellpadding="2" align="center">
|
||||
<form action="" method="get" id="searchform" name="searchform">
|
||||
<!-- BEGIN HIDDENVARS_SOURCE -->
|
||||
<input type="hidden" name="{varname}" value="{varvalue}">
|
||||
<!-- END HIDDENVARS_SOURCE -->
|
||||
<tr>
|
||||
<td nowrap align="center" nowrap valign="middle">
|
||||
<B> {LN_SEARCH_FILTER}</B>
|
||||
@ -15,7 +18,7 @@
|
||||
<li><h2 class="cellmenu1">{LN_GEN_PREDEFINEDSEARCHES}</h2>
|
||||
<!-- BEGIN Search -->
|
||||
<li class="{cssclass}" OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_presearches');">
|
||||
<a href="?{SearchQuery}" target="_top">{DisplayName}</a>
|
||||
<a href="?{SearchQuery}{additional_url_sourceonly}" target="_top">{DisplayName}</a>
|
||||
</li>
|
||||
<!-- END Search -->
|
||||
</ul>
|
||||
@ -28,7 +31,7 @@
|
||||
<input maxlength="2048" name="filter" size="80" title="Search" value="{searchstr}" class="SearchFormTextbox">
|
||||
<br>
|
||||
<input name="search" type="submit" value="{LN_SEARCH}" class="SearchFormControl">
|
||||
<a href="?search={LN_SEARCH}&filter={SearchCustomButtonSearch}" target="_top"><input name="lucky" type="button" value="{SearchCustomButtonCaption}" class="SearchFormControl"></a>
|
||||
<a href="?search={LN_SEARCH}&filter={SearchCustomButtonSearch}{additional_url_sourceonly}" target="_top"><input name="lucky" type="button" value="{SearchCustomButtonCaption}" class="SearchFormControl"></a>
|
||||
<input type="button" value="{LN_SEARCH_RESET}" class="SearchFormControl" OnClick="ResetFormValues('searchform');">
|
||||
<input type="button" value="{LN_HIGHLIGHT}" class="SearchFormControl" OnClick="togglevisibility('HightLightArea');">
|
||||
<br>
|
||||
@ -232,7 +235,7 @@
|
||||
</h2>
|
||||
<!-- BEGIN buttons -->
|
||||
<li class="{cssclass}" OnMouseMove="ToggleDisplayEnhanceTimeOut('menu_{FieldColumn}_{uid}');">
|
||||
<img align="left" src="{IconSource}" width="16" height="16"><a href="{ButtonUrl}" target="_top">{DisplayName}</a>
|
||||
<img align="left" src="{IconSource}" width="16" height="16"><a href="{ButtonUrl}{additional_url_sourceonly}" target="_top">{DisplayName}</a>
|
||||
</li>
|
||||
<!-- END buttons -->
|
||||
</ul>
|
||||
@ -258,7 +261,7 @@
|
||||
<!-- ENDIF ismessagefield!="true" -->
|
||||
|
||||
<!-- IF ismessagefield="true" -->
|
||||
<a href="{detaillink}" class="syslogdetails" target="_top">
|
||||
<a href="{detaillink}{additional_url_sourceonly}" class="syslogdetails" target="_top">
|
||||
{fieldvalue}
|
||||
</a>
|
||||
<!-- ENDIF ismessagefield="true" -->
|
||||
@ -266,7 +269,7 @@
|
||||
<!-- ENDIF hasdetails="false" -->
|
||||
<!-- IF hasdetails="true" -->
|
||||
|
||||
<a href="{detaillink}" class="syslogdetails">{fieldvalue}
|
||||
<a href="{detaillink}{additional_url_sourceonly}" class="syslogdetails">{fieldvalue}
|
||||
<span>
|
||||
<table cellpadding="0" cellspacing="1" border="0" width="500" align="left" class="with_border_alternate">
|
||||
<tr><td colspan="2" class="cellmenu1" align="center"><B>{popupcaption}</B></td></tr>
|
||||
|
@ -11,6 +11,9 @@
|
||||
<br>
|
||||
|
||||
<form action="" method="get" id="filterdateform" OnChange="CalculateSearchPreview('filterdateform', 'SearchCode');" onkeyup="CalculateSearchPreview('filterdateform', 'SearchCode');" >
|
||||
<!-- BEGIN HIDDENVARS_SOURCE -->
|
||||
<input type="hidden" name="{varname}" value="{varvalue}">
|
||||
<!-- END HIDDENVARS_SOURCE -->
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
|
||||
<tr>
|
||||
<td width="50%" valign="top" class="table_with_border">
|
||||
|
Loading…
x
Reference in New Issue
Block a user