Commit b25bf4f5 authored by Marius Burkard's avatar Marius Burkard

- backported datalog viewer from 3.2, contributed by Timme Hosting

parent 57b164e0
ALTER TABLE `sys_datalog` ADD `session_id` varchar(64) NOT NULL DEFAULT '' AFTER `error`;
......@@ -1631,6 +1631,7 @@ CREATE TABLE `sys_datalog` (
`data` longtext,
`status` set('pending','ok','warning','error') NOT NULL default 'ok',
`error` mediumtext,
`session_id` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`datalog_id`),
KEY `server_id` (`server_id`,`status`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
......
......@@ -719,8 +719,8 @@ class db
if($action == 'INSERT') $action = 'i';
if($action == 'UPDATE') $action = 'u';
if($action == 'DELETE') $action = 'd';
$sql = "INSERT INTO sys_datalog (dbtable,dbidx,server_id,action,tstamp,user,data) VALUES (?, ?, ?, ?, ?, ?, ?)";
$app->db->query($sql, $db_table, $dbidx, $server_id, $action, time(), $username, $diffstr);
$sql = "INSERT INTO sys_datalog (dbtable,dbidx,server_id,action,tstamp,user,data,session_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
$app->db->query($sql, $db_table, $dbidx, $server_id, $action, time(), $username, $diffstr, session_id());
}
return true;
......
......@@ -262,7 +262,7 @@ if(count($_POST) > 0) {
$app->plugin->raiseEvent('login', $username);
//* Save successfull login message to var
$authlog = 'Successful login for user \''. $username .'\' from '. $_SERVER['REMOTE_ADDR'] .' at '. date('Y-m-d H:i:s');
$authlog = 'Successful login for user \''. $username .'\' from '. $_SERVER['REMOTE_ADDR'] .' at '. date('Y-m-d H:i:s') . ' with session ID ' .session_id();
$authlog_handle = fopen($conf['ispconfig_log_dir'].'/auth.log', 'a');
fwrite($authlog_handle, $authlog ."\n");
fclose($authlog_handle);
......
......@@ -40,6 +40,7 @@ $wb['Show Clamav-Log'] = 'ClamAV Protokoll anzeigen';
$wb['Show ISPConfig-Log'] = 'ISPConfig Protokoll anzeigen';
$wb['Show RKHunter-Log'] = 'RKHunter Protokoll anzeigen';
$wb['Show Jobqueue'] = 'Jobwarteschlange anzeigen';
$wb['Show Data Log History'] = 'Datalog-History anzeigen';
$wb['Show ISPC Cron-Log'] = 'Cron Protokoll anzeigen';
$wb['no_data_updates_txt'] = 'Derzeit stehen keine Daten über Updates zur Verfügung. Bitte später erneut überprüfen.';
$wb['no_data_raid_txt'] = 'Derzeit stehen keine Daten über RAID zur Verfügung. Bitte später erneut überprüfen.';
......
......@@ -46,6 +46,7 @@ $wb['Show Clamav-Log'] = 'Show Clamav-Log';
$wb['Show ISPConfig-Log'] = 'Show ISPConfig-Log';
$wb['Show RKHunter-Log'] = 'Show RKHunter-Log';
$wb['Show Jobqueue'] = 'Show Jobqueue';
$wb['Show Data Log History'] = 'Show Data Log History';
$wb['Show fail2ban-Log'] = 'Show fail2ban-Log';
$wb['Show MongoDB-Log'] = 'Show MongoDB-Log';
$wb['Show IPTables'] = 'Show IPTables';
......
......@@ -26,6 +26,11 @@ $items[] = array( 'title' => 'Show Jobqueue',
'link' => 'monitor/datalog_list.php',
'html_id' => 'jobqueue');
$items[] = array( 'title' => 'Show Data Log History',
'target' => 'content',
'link' => 'monitor/dataloghistory_list.php',
'html_id' => 'dataloghistory');
$module["nav"][] = array( 'title' => 'System State (All Servers)',
'open' => 1,
'items' => $items);
......
......@@ -782,3 +782,16 @@ span.notification_text {
font-family: inherit;
color: white;
}
.finediff {
font-family: monospace;
}
.finediff ins {
color: green;
background: #dfd;
text-decoration: none;
}
.finediff del {
color: red;
background: #fdd;
text-decoration: none;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment