diff --git a/src/admin/reports.php b/src/admin/reports.php
index a102ddd..53a6d0d 100644
--- a/src/admin/reports.php
+++ b/src/admin/reports.php
@@ -39,6 +39,7 @@ $gl_root_path = './../';
include($gl_root_path . 'include/functions_common.php');
include($gl_root_path . 'include/functions_frontendhelpers.php');
include($gl_root_path . 'include/functions_filters.php');
+include($gl_root_path . 'include/functions_reports.php');
// Set PAGE to be ADMINPAGE!
define('IS_ADMINPAGE', true);
@@ -59,10 +60,11 @@ if ( !isset($_SESSION['SESSION_ISREADONLY']) || $_SESSION['SESSION_ISREADONLY']
(
isset($_GET['op']) &&
(
- $_GET['op'] == "initreport" ||
- $_GET['op'] == "removereport" ||
- $_GET['op'] == "addsavedreport" ||
- $_GET['op'] == "removesavedreport"
+ strpos($_GET['op'], "initreport") !== false ||
+ strpos($_GET['op'], "removereport") !== false ||
+ strpos($_GET['op'], "editsavedreport") !== false ||
+ strpos($_GET['op'], "addsavedreport") !== false ||
+ strpos($_GET['op'], "removesavedreport") !== false
)
)
)
@@ -71,8 +73,6 @@ if ( !isset($_SESSION['SESSION_ISREADONLY']) || $_SESSION['SESSION_ISREADONLY']
// ---
// --- BEGIN Custom Code
-// Hardcoded settings
-define('URL_ONLINEREPORTS', 'http://tools.adiscon.net/listreports.php');
$content['OPTIONAL_TITLE'] = "";
// Firts of all init List of Reports!
@@ -307,7 +307,7 @@ if ( isset($_GET['op']) )
$content['ERROR_MSG'] = $content['LN_REPORTS_ERROR_INVALIDID'];
}
}
- else if ($_GET['op'] == "addsavedreport")
+ else if (strpos($_GET['op'], "addsavedreport") !== false )
{
if ( isset($_GET['id']) )
{
@@ -317,7 +317,9 @@ if ( isset($_GET['op']) )
// Init Form variables
$content['ISADDSAVEDREPORT'] = "true";
$content['REPORT_FORMACTION'] = "addsavedreport";
+ $content['REPORT_FORMACTIONRETURN'] = "addsavedreport_return";
$content['REPORT_SENDBUTTON'] = $content['LN_REPORTS_ADDSAVEDREPORT'];
+ $content['REPORT_SENDANDRETURN'] = $content['LN_REPORTS_ADDSAVEDREPORTANDRETURN'];
$content['FormUrlAddOP'] = "?op=addsavedreport&id=" . $content['ReportID'];
// Check if report exists
@@ -359,6 +361,9 @@ if ( isset($_GET['op']) )
$mySource['sourceselected'] = "";
}
+ // Check if logstream is optimized!
+ CheckConfiguredLogStreamSource($myReport, $content['SourceID']);
+
// Create Outputlist
$content['outputFormat'] = REPORT_OUTPUT_HTML;
CreateOutputformatList( $content['outputFormat'] );
@@ -390,12 +395,15 @@ if ( isset($_GET['op']) )
$content['ERROR_MSG'] = $content['LN_REPORTS_ERROR_INVALIDID'];
}
}
- else if ($_GET['op'] == "editsavedreport")
+ else if (strpos($_GET['op'], "editsavedreport") !== false )
{
// Set Mode to add
$content['ISADDSAVEDREPORT'] = "true";
$content['REPORT_FORMACTION'] = "editsavedreport";
+ $content['REPORT_FORMACTIONRETURN'] = "editsavedreport_return";
$content['REPORT_SENDBUTTON'] = $content['LN_REPORTS_EDITSAVEDREPORT'];
+ $content['REPORT_SENDANDRETURN'] = $content['LN_REPORTS_EDITSAVEDREPORTANDRETURN'];
+
if ( isset($_GET['id']) )
{
@@ -448,6 +456,9 @@ if ( isset($_GET['op']) )
$mySource['sourceselected'] = "";
}
+ // Check if logstream is optimized!
+ CheckConfiguredLogStreamSource($myReport, $content['SourceID']);
+
// Create Outputlist
$content['outputFormat'] = $mySavedReport['outputFormat'];
CreateOutputformatList( $content['outputFormat'] );
@@ -590,9 +601,9 @@ if ( isset($content['ISADDSAVEDREPORT']) && $content['ISADDSAVEDREPORT'] )
$szFilterString = "";
if (
- ( strlen($content['filterString']) <= 0 &&
- isset($_POST['report_filterString']) )
- ||
+// ( strlen($content['filterString']) <= 0 &&
+// isset($_POST['report_filterString']) )
+// ||
( strlen($content['filterString']) > 0 &&
!isset($_POST['subop']) &&
!isset($_POST['subop_edit']) &&
@@ -740,10 +751,20 @@ if ( isset($content['ISADDSAVEDREPORT']) && $content['ISADDSAVEDREPORT'] )
$i++;
}
-// DEBUG stuff
-// echo $content['filterString'] . "
\r\n";
-// echo $szFilterString . "
\r\n";
-// print_r ( $AllFilters );
+ // Reset Allfilters Array to NULL in this case!
+ if ( strlen($szFilterString) <= 0 )
+ {
+ $content['filterString'] = "";
+ $content['filterString_htmlform'] = "";
+ }
+
+ /*
+ // DEBUG stuff
+ echo $content['filterString'] . "
\r\n";
+ echo $szFilterString . "
\r\n";
+ print_r ( $AllFilters );
+ // */
+
}
}
@@ -797,7 +818,10 @@ if ( isset($content['ISADDSAVEDREPORT']) && $content['ISADDSAVEDREPORT'] )
}
// Copy Final Filterstring if necessary
if ( strlen($szFilterString) > 0 )
+ {
$content['filterString'] = $szFilterString;
+ $content['filterString_htmlform'] = htmlspecialchars($szFilterString);
+ }
// echo $content['SourceID'];
if ( isset($content['Sources'][$content['SourceID']]['ObjRef']) )
@@ -959,7 +983,6 @@ if ( isset($_POST['op']) )
// Get ReportID!
if ( isset($_POST['id']) ) { $content['ReportID'] = DB_RemoveBadChars($_POST['id']); } else {$content['ReportID'] = ""; }
-
// Only Continue if reportid is valud!
if ( isset($content['REPORTS'][ $content['ReportID'] ]) )
{
@@ -1074,7 +1097,7 @@ if ( isset($_POST['op']) )
if ( !isset($content['ISERROR']) )
{
// Everything was alright, so we go to the next step!
- if ( $_POST['op'] == "addsavedreport" )
+ if ( strpos($_POST['op'], "addsavedreport") !== false )
{
// Add custom search now!
$sqlquery = "INSERT INTO " . DB_SAVEDREPORTS . " (reportid, sourceid, customTitle, customComment, filterString, customFilters, outputFormat, outputTarget, outputTargetDetails, scheduleSettings)
@@ -1089,14 +1112,29 @@ if ( isset($_POST['op']) )
'" . $content['outputTargetDetails'] . "',
'" . $content['scheduleSettings'] . "'
)";
-
+ // Perform INSERT
$result = DB_Query($sqlquery);
+
+ // Get INSERTID from query!
+ $lastInsertID = mysql_insert_id();
+
+ // free ressources
DB_FreeQuery($result);
// Do the final redirect
- RedirectResult( GetAndReplaceLangStr( $content['LN_REPORTS_HASBEENADDED'], DB_StripSlahes($content['customTitle']) ) , "reports.php" );
+ if ( strpos($_POST['op'], "_return") !== false )
+ RedirectResult( GetAndReplaceLangStr( $content['LN_REPORTS_HASBEENADDED'], DB_StripSlahes($content['customTitle']) ) , "reports.php" );
+ else
+ {
+ // Correct FormUrlAddUrl!
+ $szRediUrl = str_replace( "op=addsavedreport", "op=editsavedreport", $content['FormUrlAddOP']);
+ $szRediUrl .= "&savedreportid=" . $lastInsertID;
+
+ // Redirect to editpage!
+ RedirectResult( GetAndReplaceLangStr( $content['LN_REPORTS_HASBEENADDED'], DB_StripSlahes($content['customTitle']) ) , "reports.php" . $szRediUrl );
+ }
}
- else if ( $_POST['op'] == "editsavedreport" )
+ else if ( strpos($_POST['op'], "editsavedreport") !== false )
{
$result = DB_Query("SELECT ID FROM " . DB_SAVEDREPORTS . " WHERE ID = " . $content['SavedReportID']);
$myrow = DB_GetSingleRow($result, true);
@@ -1123,7 +1161,10 @@ if ( isset($_POST['op']) )
DB_FreeQuery($result);
// Done redirect!
- RedirectResult( GetAndReplaceLangStr( $content['LN_REPORTS_HASBEENEDIT'], DB_StripSlahes($content['customTitle']) ) , "reports.php" );
+ if ( strpos($_POST['op'], "_return") !== false )
+ RedirectResult( GetAndReplaceLangStr( $content['LN_REPORTS_HASBEENEDIT'], DB_StripSlahes($content['customTitle']) ) , "reports.php" );
+ else
+ RedirectResult( GetAndReplaceLangStr( $content['LN_REPORTS_HASBEENEDIT'], DB_StripSlahes($content['customTitle']) ) , "reports.php" . $content['FormUrlAddOP'] );
}
}
@@ -1224,6 +1265,198 @@ $page -> output();
// ---
// --- BEGIN Helper functions
// ---
+
+/*
+* Helper function to init custom filters from report
+*/
+function CheckConfiguredLogStreamSource($myReport, $mySourceID)
+{
+ global $content, $extraErrorDescription;
+
+ // Get Objectreference to report
+ $myReportObj = $myReport["ObjRef"];
+
+ // Handle GET and POST input!
+ $content['MSG_WARNING_FORMURL'] = $_SERVER['SCRIPT_NAME'] . "?";
+ $content['MSG_CHECK_URL'] = $_SERVER['SCRIPT_NAME'] . "?";
+ foreach ($_GET as $varname => $varvalue)
+ {
+ // All variables!
+ $content['MSG_WARNING_FORMURL'] .= $varname . "=" . $varvalue . "&";
+
+ // Skip the Optimize variable!
+ if (strpos( $varname, "optimize" ) === false )
+ $content['MSG_CHECK_URL'] .= $varname . "=" . $varvalue . "&";
+ }
+ foreach ($_POST as $varname => $varvalue)
+ $content['POST_VARIABLES'][] = array( "varname" => $varname, "varvalue" => $varvalue );
+
+ // Append Force Optimice Paramater
+ $content['MSG_CHECK_URL'] .= "forcecheckoptimize=true";
+
+ // Check if optimize variable is set!
+ if ( isset($_GET['optimize']) )
+ {
+
+ // Check what we have to do
+ if ( $_GET['optimize'] == "addfields" )
+ {
+ // This will create all INDEXES we need for this logstream!
+ $res = $myReportObj->CreateMissingLogStreamFields( $mySourceID );
+ if ( $res != SUCCESS )
+ {
+ $content['ISERROR'] = true;
+ $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_FAILED_ADDING_FIELDS'], $content['SOURCES'][$mySourceID]['Name'], $res );
+ if ( isset($extraErrorDescription) )
+ $content['ERROR_MSG'] .= "
" . GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_EXTRAMSG'], $extraErrorDescription);
+ }
+
+ // Show information in performance warning area
+ $content['ISSOURCENOTOPTIMIZED'] = true;
+ $content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_FIELDS_CREATED'];
+ $content['MSG_WARNING_CLASS'] = 'PriorityNotice';
+ $content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_FIELDS_CREATED_SUCCESS'], $content['SOURCES'][$mySourceID]['Name'] );
+ $content['MSG_WARNING_SUBMITFORM'] = "false";
+
+ // return result
+ return $res;
+ }
+ else if ( $_GET['optimize'] == "indexes" )
+ {
+ // This will create all INDEXES we need for this logstream!
+ $res = $myReportObj->CreateLogStreamIndexes( $mySourceID );
+ if ( $res != SUCCESS )
+ {
+ $content['ISERROR'] = true;
+ $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_FAILED_CREATE_INDEXES'], $content['SOURCES'][$mySourceID]['Name'], $res );
+ if ( isset($extraErrorDescription) )
+ $content['ERROR_MSG'] .= "
" . GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_EXTRAMSG'], $extraErrorDescription);
+ }
+
+ // Show information in performance warning area
+ $content['ISSOURCENOTOPTIMIZED'] = true;
+ $content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_INDEX_CREATED'];
+ $content['MSG_WARNING_CLASS'] = 'PriorityNotice';
+ $content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_INDEX_CREATED_SUCCESS'], $content['SOURCES'][$mySourceID]['Name'] );
+ $content['MSG_WARNING_SUBMITFORM'] = "false";
+
+ // return result
+ return $res;
+ }
+ else if ( $_GET['optimize'] == "trigger" )
+ {
+ // This will create all INDEXES we need for this logstream!
+ $res = $myReportObj->CreateLogStreamTrigger( $mySourceID );
+ if ( $res != SUCCESS )
+ {
+ $content['ISERROR'] = true;
+ $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_FAILED_CREATE_TRIGGER'], $content['SOURCES'][$mySourceID]['Name'], $res );
+ if ( isset($extraErrorDescription) )
+ $content['ERROR_MSG'] .= "
" . GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_EXTRAMSG'], $extraErrorDescription);
+ }
+ else
+ {
+ // Show information in performance warning area
+ $content['ISSOURCENOTOPTIMIZED'] = true;
+ $content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_TRIGGER_CREATED'];
+ $content['MSG_WARNING_CLASS'] = 'PriorityNotice';
+ $content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_TRIGGER_CREATED_SUCCESS'], $content['SOURCES'][$mySourceID]['Name'] );
+ $content['MSG_WARNING_SUBMITFORM'] = "false";
+ }
+
+ // return result
+ return $res;
+ }
+ else if ( $_GET['optimize'] == "checksum" )
+ {
+ // This will create all INDEXES we need for this logstream!
+ $res = $myReportObj->ChangeChecksumFieldUnsigned( $mySourceID );
+ if ( $res != SUCCESS )
+ {
+ $content['ISERROR'] = true;
+ $content['ERROR_MSG'] = GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_FAILED_CHANGE_CHECKSUM'], $content['SOURCES'][$mySourceID]['Name'], $res );
+ if ( isset($extraErrorDescription) )
+ $content['ERROR_MSG'] .= "
" . GetAndReplaceLangStr( $content['LN_SOURCES_ERROR_EXTRAMSG'], $extraErrorDescription);
+ }
+ else
+ {
+ // Show information in performance warning area
+ $content['ISSOURCENOTOPTIMIZED'] = true;
+ $content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_CHECKSUM_CHANGED'];
+ $content['MSG_WARNING_CLASS'] = 'PriorityNotice';
+ $content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_CHECKSUM_CHANGED_SUCCESS'], $content['SOURCES'][$mySourceID]['Name'] );
+ $content['MSG_WARNING_SUBMITFORM'] = "false";
+ }
+
+ // return result
+ return $res;
+ }
+ }
+
+ // Use SESSION to check if Source needs to be checked for optimization
+ $bForceCheck = false;
+ if ( !isset($_SESSION['Sources'][$mySourceID]['optimized']) ||
+ $_SESSION['Sources'][$mySourceID]['optimized'] == false ||
+ ( isset($_GET['forcecheckoptimize']) && $_GET['forcecheckoptimize'] == "true" )
+ )
+ // Set Checking to true!
+ $bForceCheck = true;
+
+ // Lets see if we need to check
+ if ( $bForceCheck )
+ {
+ // Run checks
+ $res = $myReportObj->CheckLogStreamSource( $mySourceID );
+ if ( $res != SUCCESS )
+ {
+ // Current Logstream Source is not optimized! Show to user!
+ $content['ISSOURCENOTOPTIMIZED'] = true;
+ if ( $res == ERROR_DB_DBFIELDNOTFOUND )
+ {
+ $content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_PERFORMANCE_WARNING'];
+ $content['MSG_WARNING_CLASS'] = 'PriorityWarning';
+ $content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_ADD_MISSINGFIELDS'], $content['SOURCES'][$mySourceID]['Name'] ); // GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_IDNOTFOUND'], $content['ReportID'] );
+ $content['MSG_WARNING_SUBMITFORM'] = "true";
+ $content['MSG_WARNING_FORMURL'] .= "optimize=addfields"; // Addmissing fields
+ }
+ else if ( $res == ERROR_DB_INDEXESMISSING )
+ {
+ $content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_PERFORMANCE_WARNING'];
+ $content['MSG_WARNING_CLASS'] = 'PriorityWarning';
+ $content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_OPTIMIZE_INDEXES'], $content['SOURCES'][$mySourceID]['Name'] ); // GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_IDNOTFOUND'], $content['ReportID'] );
+ $content['MSG_WARNING_SUBMITFORM'] = "true";
+ $content['MSG_WARNING_FORMURL'] .= "optimize=indexes"; // Add missing INDEXES
+ }
+ else if ( $res == ERROR_DB_TRIGGERMISSING )
+ {
+ $content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_PERFORMANCE_WARNING'];
+ $content['MSG_WARNING_CLASS'] = 'PriorityWarning';
+ $content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_OPTIMIZE_TRIGGER'], $content['SOURCES'][$mySourceID]['Name'] ); // GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_IDNOTFOUND'], $content['ReportID'] );
+ $content['MSG_WARNING_SUBMITFORM'] = "true";
+ $content['MSG_WARNING_FORMURL'] .= "optimize=trigger"; // Add missing TRIGGERS
+ }
+ else if ( $res == ERROR_DB_CHECKSUMERROR )
+ {
+ $content['MSG_WARNING_TITLE'] = $content['LN_REPORTS_PERFORMANCE_WARNING'];
+ $content['MSG_WARNING_CLASS'] = 'PriorityWarning';
+ $content['MSG_WARNING_DETAILS'] = GetAndReplaceLangStr( $content['LN_REPORTS_CHANGE_CHECKSUM'], $content['SOURCES'][$mySourceID]['Name'] ); // GetAndReplaceLangStr( $content['LN_REPORTS_ERROR_IDNOTFOUND'], $content['ReportID'] );
+ $content['MSG_WARNING_SUBMITFORM'] = "true";
+ $content['MSG_WARNING_FORMURL'] .= "optimize=checksum"; // Change Checksum field!
+ }
+ }
+ else
+ {
+ // Check was successfull! Set Checked Property in LogStream Source
+ $_SESSION['Sources'][$mySourceID]['optimized'] = true;
+ }
+ }
+
+}
+
+
+/*
+* Helper function to init custom filters from report
+*/
function InitCustomFilterDefinitions($myReport, $CustomFilterValues)
{
global $content;
@@ -1312,224 +1545,6 @@ function InitOutputtargetDefinitions($myReport, $outputTargetDetails)
}
}
-function CreateCronCommand( $myReportID, $mySavedReportID = null )
-{
- global $content, $gl_root_path, $myReport;
-
- if ( isset($mySavedReportID) )
- {
- // Get Reference to report!
- $myReport = $content['REPORTS'][ $myReportID ];
-
- // Get reference to savedreport
- $mySavedReport = $myReport['SAVEDREPORTS'][ $mySavedReportID ];
-
- // Get configured Source for savedreport
- $myReportSource = null;
- if ( isset($content['Sources'][ $mySavedReport['sourceid'] ]) )
- $myReportSource = $content['Sources'][ $mySavedReport['sourceid'] ];
-
- $pos = strpos( strtoupper(PHP_OS), "WIN");
- if ($pos !== false)
- {
- // Running on Windows
- $phpCmd = PHP_BINDIR . "\\php.exe";
- $phpScript = realpath($gl_root_path) . "cron\\cmdreportgen.php";
- }
- else
- {
- // Running on LINUX
- $phpCmd = PHP_BINDIR . "/php";
- $phpScript = realpath($gl_root_path) . "/cron/cmdreportgen.php";
- }
-
- // Enable display of report command
- $content['enableCronCommand'] = true;
- $szCommand = $phpCmd . " " . $phpScript . " runreport " . $myReportID . " " . $mySavedReportID;
-
- // --- Check for user or group sources
- if ( $myReportSource['userid'] != null )
- {
- $szCommand .= " " . "userid=" . $myReportSource['userid'];
- }
- else if ( $myReportSource['groupid'] != null )
- {
- $szCommand .= " " . "groupid=" . $myReportSource['groupid'];
- }
- // ---
- }
- else
- {
- // Disable display of report command
- $content['enableCronCommand'] = false;
- $szCommand = "";
- }
-
- // return result
- return $szCommand;
-}
-
-function InitOnlineReports()
-{
- global $content;
-
- $xmlArray = xml2array( URL_ONLINEREPORTS );
- if ( is_array($xmlArray) && isset($xmlArray['reports']['report']) && count($xmlArray['reports']['report']) > 0 )
- {
- foreach( $xmlArray['reports']['report'] as $myOnlineReport )
- {
- // Copy to OnlineReports Array
- $content['ONLINEREPORTS'][] = $myOnlineReport;
- }
-
- // Success!
- return true;
- }
- else
- // Failure
- return false;
-}
-
-// Helper function from php doc
-function xml2array($url, $get_attributes = 1, $priority = 'tag')
-{
- $contents = "";
- if (!function_exists('xml_parser_create'))
- {
- return false;
- }
- $parser = xml_parser_create('');
- if (!($fp = @ fopen($url, 'rb')))
- {
- return false;
- }
- while (!feof($fp))
- {
- $contents .= fread($fp, 8192);
- }
- fclose($fp);
- xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, "UTF-8");
- xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
- xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
- xml_parse_into_struct($parser, trim($contents), $xml_values);
- xml_parser_free($parser);
- if (!$xml_values)
- return; //Hmm...
- $xml_array = array ();
- $parents = array ();
- $opened_tags = array ();
- $arr = array ();
- $current = & $xml_array;
- $repeated_tag_index = array ();
- foreach ($xml_values as $data)
- {
- unset ($attributes, $value);
- extract($data);
- $result = array ();
- $attributes_data = array ();
- if (isset ($value))
- {
- if ($priority == 'tag')
- $result = $value;
- else
- $result['value'] = $value;
- }
- if (isset ($attributes) and $get_attributes)
- {
- foreach ($attributes as $attr => $val)
- {
- if ($priority == 'tag')
- $attributes_data[$attr] = $val;
- else
- $result['attr'][$attr] = $val; //Set all the attributes in a array called 'attr'
- }
- }
- if ($type == "open")
- {
- $parent[$level -1] = & $current;
- if (!is_array($current) or (!in_array($tag, array_keys($current))))
- {
- $current[$tag] = $result;
- if ($attributes_data)
- $current[$tag . '_attr'] = $attributes_data;
- $repeated_tag_index[$tag . '_' . $level] = 1;
- $current = & $current[$tag];
- }
- else
- {
- if (isset ($current[$tag][0]))
- {
- $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
- $repeated_tag_index[$tag . '_' . $level]++;
- }
- else
- {
- $current[$tag] = array (
- $current[$tag],
- $result
- );
- $repeated_tag_index[$tag . '_' . $level] = 2;
- if (isset ($current[$tag . '_attr']))
- {
- $current[$tag]['0_attr'] = $current[$tag . '_attr'];
- unset ($current[$tag . '_attr']);
- }
- }
- $last_item_index = $repeated_tag_index[$tag . '_' . $level] - 1;
- $current = & $current[$tag][$last_item_index];
- }
- }
- elseif ($type == "complete")
- {
- if (!isset ($current[$tag]))
- {
- $current[$tag] = $result;
- $repeated_tag_index[$tag . '_' . $level] = 1;
- if ($priority == 'tag' and $attributes_data)
- $current[$tag . '_attr'] = $attributes_data;
- }
- else
- {
- if (isset ($current[$tag][0]) and is_array($current[$tag]))
- {
- $current[$tag][$repeated_tag_index[$tag . '_' . $level]] = $result;
- if ($priority == 'tag' and $get_attributes and $attributes_data)
- {
- $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
- }
- $repeated_tag_index[$tag . '_' . $level]++;
- }
- else
- {
- $current[$tag] = array (
- $current[$tag],
- $result
- );
- $repeated_tag_index[$tag . '_' . $level] = 1;
- if ($priority == 'tag' and $get_attributes)
- {
- if (isset ($current[$tag . '_attr']))
- {
- $current[$tag]['0_attr'] = $current[$tag . '_attr'];
- unset ($current[$tag . '_attr']);
- }
- if ($attributes_data)
- {
- $current[$tag][$repeated_tag_index[$tag . '_' . $level] . '_attr'] = $attributes_data;
- }
- }
- $repeated_tag_index[$tag . '_' . $level]++; //0 and 1 index is already taken
- }
- }
- }
- elseif ($type == 'close')
- {
- $current = & $parent[$level -1];
- }
- }
- return ($xml_array);
-}
-
/*
* Helper functions to init a Datefield
*/
diff --git a/src/asktheoracle.php b/src/asktheoracle.php
index ab21a14..b1bb3b0 100644
--- a/src/asktheoracle.php
+++ b/src/asktheoracle.php
@@ -29,7 +29,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -154,4 +154,4 @@ $page -> parser($content, "asktheoracle.html");
$page -> output();
// ---
-?>
+?>
\ No newline at end of file
diff --git a/src/chartgenerator.php b/src/chartgenerator.php
index bb2dab8..f3ff7aa 100644
--- a/src/chartgenerator.php
+++ b/src/chartgenerator.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -528,4 +528,4 @@ if ( $content['error_occured'] )
$graph->StrokeCSIM( basename(__FILE__), '', 0);
// ---
-?>
+?>
\ No newline at end of file
diff --git a/src/classes/class_template.php b/src/classes/class_template.php
index e4e9dec..d5305ab 100644
--- a/src/classes/class_template.php
+++ b/src/classes/class_template.php
@@ -37,6 +37,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/enums.class.php b/src/classes/enums.class.php
index ed019c9..a2b8b3d 100644
--- a/src/classes/enums.class.php
+++ b/src/classes/enums.class.php
@@ -27,6 +27,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstream.class.php b/src/classes/logstream.class.php
index 3dae34c..344b9b8 100644
--- a/src/classes/logstream.class.php
+++ b/src/classes/logstream.class.php
@@ -27,6 +27,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamconfig.class.php b/src/classes/logstreamconfig.class.php
index bf66574..bfc0429 100644
--- a/src/classes/logstreamconfig.class.php
+++ b/src/classes/logstreamconfig.class.php
@@ -27,6 +27,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamconfigdb.class.php b/src/classes/logstreamconfigdb.class.php
index 003f174..1dd8104 100644
--- a/src/classes/logstreamconfigdb.class.php
+++ b/src/classes/logstreamconfigdb.class.php
@@ -27,6 +27,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamconfigdisk.class.php b/src/classes/logstreamconfigdisk.class.php
index a4b5ad6..b0af9d3 100644
--- a/src/classes/logstreamconfigdisk.class.php
+++ b/src/classes/logstreamconfigdisk.class.php
@@ -27,6 +27,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamconfigpdo.class.php b/src/classes/logstreamconfigpdo.class.php
index 4c3a0a8..23e898a 100644
--- a/src/classes/logstreamconfigpdo.class.php
+++ b/src/classes/logstreamconfigpdo.class.php
@@ -27,6 +27,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamdb.class.php b/src/classes/logstreamdb.class.php
index f11e2b7..513628d 100644
--- a/src/classes/logstreamdb.class.php
+++ b/src/classes/logstreamdb.class.php
@@ -32,6 +32,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamdisk.class.php b/src/classes/logstreamdisk.class.php
index f78f7bf..4784c5b 100644
--- a/src/classes/logstreamdisk.class.php
+++ b/src/classes/logstreamdisk.class.php
@@ -33,6 +33,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamlineparser.class.php b/src/classes/logstreamlineparser.class.php
index 5256e3f..44a62df 100644
--- a/src/classes/logstreamlineparser.class.php
+++ b/src/classes/logstreamlineparser.class.php
@@ -26,6 +26,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamlineparsermisc.class.php b/src/classes/logstreamlineparsermisc.class.php
index 4a6600e..5ab29e6 100644
--- a/src/classes/logstreamlineparsermisc.class.php
+++ b/src/classes/logstreamlineparsermisc.class.php
@@ -27,6 +27,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamlineparsersyslog.class.php b/src/classes/logstreamlineparsersyslog.class.php
index 3f432cc..3038239 100644
--- a/src/classes/logstreamlineparsersyslog.class.php
+++ b/src/classes/logstreamlineparsersyslog.class.php
@@ -26,6 +26,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamlineparsersyslog23.class.php b/src/classes/logstreamlineparsersyslog23.class.php
index a2b7c9c..11f3dcd 100644
--- a/src/classes/logstreamlineparsersyslog23.class.php
+++ b/src/classes/logstreamlineparsersyslog23.class.php
@@ -26,6 +26,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreamlineparserwinsyslog.class.php b/src/classes/logstreamlineparserwinsyslog.class.php
index 3c2516b..63b90cd 100644
--- a/src/classes/logstreamlineparserwinsyslog.class.php
+++ b/src/classes/logstreamlineparserwinsyslog.class.php
@@ -26,6 +26,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/logstreampdo.class.php b/src/classes/logstreampdo.class.php
index 6e51bfd..729acfc 100644
--- a/src/classes/logstreampdo.class.php
+++ b/src/classes/logstreampdo.class.php
@@ -28,6 +28,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/classes/msgparser.class.php b/src/classes/msgparser.class.php
index f1fcd18..e7e9430 100644
--- a/src/classes/msgparser.class.php
+++ b/src/classes/msgparser.class.php
@@ -26,6 +26,10 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
+ *
+ * Adiscon LogAnalyzer is also available under a commercial license.
+ * For details, contact info@adiscon.com or visit
+ * http://loganalyzer.adiscon.com/commercial
*********************************************************************
*/
diff --git a/src/convert.php b/src/convert.php
index 6e561ee..fec99cb 100644
--- a/src/convert.php
+++ b/src/convert.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -279,4 +279,4 @@ $page -> output();
// --- Helper functions
// ---
-?>
+?>
\ No newline at end of file
diff --git a/src/details.php b/src/details.php
index 0534f33..d88e482 100644
--- a/src/details.php
+++ b/src/details.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -459,4 +459,4 @@ $page -> output();
// ---
-?>
+?>
\ No newline at end of file
diff --git a/src/export.php b/src/export.php
index 9f74795..6963319 100644
--- a/src/export.php
+++ b/src/export.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -422,4 +422,4 @@ else
}
// ---
-?>
+?>
\ No newline at end of file
diff --git a/src/include/config.sample.php b/src/include/config.sample.php
index 5e37f30..721fe3f 100644
--- a/src/include/config.sample.php
+++ b/src/include/config.sample.php
@@ -26,7 +26,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -155,4 +155,4 @@ $CFG['Charts'][] = array ( "DisplayName" => "Usage by Day", "chart_type" => CHAR
// --- %Insert Source Here%
// ---
-?>
+?>
\ No newline at end of file
diff --git a/src/include/constants_errors.php b/src/include/constants_errors.php
index d126073..2f6e7dc 100644
--- a/src/include/constants_errors.php
+++ b/src/include/constants_errors.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -71,5 +71,12 @@ define('ERROR_CHARTS_NOTCONFIGURED', 20);
define('ERROR_MSG_SKIPMESSAGE', 21);
define('ERROR_MSG_SCANABORTED', 23);
define('ERROR_REPORT_NODATA', 25);
+define('ERROR_DB_INDEXESMISSING', 26);
+define('ERROR_DB_TRIGGERMISSING', 27);
+define('ERROR_DB_INDEXFAILED', 28);
+define('ERROR_DB_TRIGGERFAILED', 29);
+define('ERROR_DB_CHECKSUMERROR', 30);
+define('ERROR_DB_CHECKSUMCHANGEFAILED', 31);
+define('ERROR_DB_ADDDBFIELDFAILED', 32);
-?>
+?>
\ No newline at end of file
diff --git a/src/include/constants_filters.php b/src/include/constants_filters.php
index faabf58..ab6544d 100644
--- a/src/include/constants_filters.php
+++ b/src/include/constants_filters.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -118,4 +118,4 @@ $content['filter_messagetype_list'][] = array( "ID" => IUT_NT_EventReport, "Disp
$content['filter_messagetype_list'][] = array( "ID" => IUT_File_Monitor, "DisplayName" => "File Monitor", "selected" => "" );
$content['filter_messagetype_list'][] = array( "ID" => IUT_WEBSERVERLOG, "DisplayName" => "Webserver Logfile", "selected" => "" );
-?>
+?>
\ No newline at end of file
diff --git a/src/include/constants_general.php b/src/include/constants_general.php
index ab8b3c5..4b69cda 100644
--- a/src/include/constants_general.php
+++ b/src/include/constants_general.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -226,4 +226,4 @@ define('ENC_UTF8', "utf-8");
$encodings[ENC_ISO_8859_1] = array("ID" => ENC_ISO_8859_1);
$encodings[ENC_UTF8] = array("ID" => ENC_UTF8);
-?>
+?>
\ No newline at end of file
diff --git a/src/include/constants_logstream.php b/src/include/constants_logstream.php
index 164ad96..08a44ed 100644
--- a/src/include/constants_logstream.php
+++ b/src/include/constants_logstream.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -389,4 +389,4 @@ define('EVTIME_TIMESTAMP', '0');
define('EVTIME_TIMEZONE', '1');
define('EVTIME_MICROSECONDS', '2');
-?>
+?>
\ No newline at end of file
diff --git a/src/include/functions_common.php b/src/include/functions_common.php
index 21ba253..96a8f56 100644
--- a/src/include/functions_common.php
+++ b/src/include/functions_common.php
@@ -28,7 +28,7 @@
*
* A copy of the GPL can be found in the file "COPYING" in this
* distribution.
- *
+ *
* Adiscon LogAnalyzer is also available under a commercial license.
* For details, contact info@adiscon.com or visit
* http://loganalyzer.adiscon.com/commercial
@@ -70,12 +70,15 @@ $LANG_EN = "en"; // Used for fallback
$LANG = "en"; // Default language
// Default Template vars
-$content['BUILDNUMBER'] = "3.2.3";
+$content['BUILDNUMBER'] = "3.4.0";
$content['UPDATEURL'] = "http://loganalyzer.adiscon.com/files/version.txt";
$content['TITLE'] = "Adiscon LogAnalyzer :: Release " . $content['BUILDNUMBER']; // Default page title
$content['BASEPATH'] = $gl_root_path;
$content['SHOW_DONATEBUTTON'] = true; // Default = true!
+// Hardcoded DEFINES
+define('URL_ONLINEREPORTS', 'http://tools.adiscon.net/listreports.php');
+
// PreInit overall user variables
$content['EXTRA_PHPLOGCON_LOGO'] = $content['BASEPATH'] . "images/main/Header-Logo.png";
$content['EXTRA_METATAGS'] = "";
@@ -567,11 +570,10 @@ function CheckAndSetRunMode()
// Define and Inits Syslog variables now!
// DEPRECIATED! define_syslog_variables();
// Syslog Constants are defined by default anyway!
- openlog("LogAnalyzer", LOG_PID, LOG_USER);
-
+ $syslogOpened = openlog("LogAnalyzer", LOG_PID, LOG_USER);
+
// --- Check necessary PHP Extensions!
$loadedExtensions = get_loaded_extensions();
-
// Check for GD libary
if ( in_array("gd", $loadedExtensions) )
$content['GD_IS_ENABLED'] = true;
@@ -582,6 +584,8 @@ function CheckAndSetRunMode()
if ( in_array("mysql", $loadedExtensions) ) { $content['MYSQL_IS_ENABLED'] = true; } else { $content['MYSQL_IS_ENABLED'] = false; }
// Check PDO Extension
if ( in_array("PDO", $loadedExtensions) ) { $content['PDO_IS_ENABLED'] = true; } else { $content['PDO_IS_ENABLED'] = false; }
+ // Check sockets Extension
+ if ( in_array("sockets", $loadedExtensions) ) { $content['SOCKETS_IS_ENABLED'] = true; } else { $content['SOCKETS_IS_ENABLED'] = false; }
// ---
}
@@ -737,6 +741,7 @@ function InitFrontEndVariables()
$content['MENU_WINDOWLIST'] = $content['BASEPATH'] . "images/icons/windows.png";
$content['MENU_CHECKED'] = $content['BASEPATH'] . "images/icons/check.png";
$content['MENU_PLAY_GREEN'] = $content['BASEPATH'] . "images/icons/bullet_triangle_green.png";
+ $content['MENU_PLAY_GREEN_WINDOW'] = $content['BASEPATH'] . "images/icons/table_sql_run.png";
$content['MENU_PAGER_BEGIN'] = $content['BASEPATH'] . "images/icons/media_beginning.png";
$content['MENU_PAGER_PREVIOUS'] = $content['BASEPATH'] . "images/icons/media_rewind.png";
@@ -1038,7 +1043,8 @@ function DieWithErrorMsg( $szerrmsg )
}
else if ( $RUNMODE == RUNMODE_WEBSERVER )
{
- print(
+ // Print main error!
+ print (
"
Errordetails: | " . "" . $szerrmsg . - " |
Additional Errordetails: | " . + "" . + $content['detailederror'] . + " |
{ERROR_MSG}
+{ERROR_MSG}
+ {MSG_WARNING_TITLE}
+ {MSG_WARNING_DETAILS} + {LN_REPORTS_RECHECKLOGSTREAMSOURCE} ++ + |
+
+ + + + |
+