Skip to content

Commit b25bf4f

Browse files
author
Marius Burkard
committed
- backported datalog viewer from 3.2, contributed by Timme Hosting
1 parent 57b164e commit b25bf4f

File tree

8 files changed

+25
-4
lines changed

8 files changed

+25
-4
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
ALTER TABLE `sys_datalog` ADD `session_id` varchar(64) NOT NULL DEFAULT '' AFTER `error`;

install/sql/ispconfig3.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,6 +1631,7 @@ CREATE TABLE `sys_datalog` (
16311631
`data` longtext,
16321632
`status` set('pending','ok','warning','error') NOT NULL default 'ok',
16331633
`error` mediumtext,
1634+
`session_id` varchar(64) NOT NULL DEFAULT '',
16341635
PRIMARY KEY (`datalog_id`),
16351636
KEY `server_id` (`server_id`,`status`)
16361637
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

interface/lib/classes/db_mysql.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,8 @@ public function datalogSave($db_table, $action, $primary_field, $primary_id, $re
719719
if($action == 'INSERT') $action = 'i';
720720
if($action == 'UPDATE') $action = 'u';
721721
if($action == 'DELETE') $action = 'd';
722-
$sql = "INSERT INTO sys_datalog (dbtable,dbidx,server_id,action,tstamp,user,data) VALUES (?, ?, ?, ?, ?, ?, ?)";
723-
$app->db->query($sql, $db_table, $dbidx, $server_id, $action, time(), $username, $diffstr);
722+
$sql = "INSERT INTO sys_datalog (dbtable,dbidx,server_id,action,tstamp,user,data,session_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
723+
$app->db->query($sql, $db_table, $dbidx, $server_id, $action, time(), $username, $diffstr, session_id());
724724
}
725725

726726
return true;

interface/web/login/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
$app->plugin->raiseEvent('login', $username);
263263

264264
//* Save successfull login message to var
265-
$authlog = 'Successful login for user \''. $username .'\' from '. $_SERVER['REMOTE_ADDR'] .' at '. date('Y-m-d H:i:s');
265+
$authlog = 'Successful login for user \''. $username .'\' from '. $_SERVER['REMOTE_ADDR'] .' at '. date('Y-m-d H:i:s') . ' with session ID ' .session_id();
266266
$authlog_handle = fopen($conf['ispconfig_log_dir'].'/auth.log', 'a');
267267
fwrite($authlog_handle, $authlog ."\n");
268268
fclose($authlog_handle);

interface/web/monitor/lib/lang/de.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ $wb['Show Clamav-Log'] = 'ClamAV Protokoll anzeigen';
4040
$wb['Show ISPConfig-Log'] = 'ISPConfig Protokoll anzeigen';
4141
$wb['Show RKHunter-Log'] = 'RKHunter Protokoll anzeigen';
4242
$wb['Show Jobqueue'] = 'Jobwarteschlange anzeigen';
43+
$wb['Show Data Log History'] = 'Datalog-History anzeigen';
4344
$wb['Show ISPC Cron-Log'] = 'Cron Protokoll anzeigen';
4445
$wb['no_data_updates_txt'] = 'Derzeit stehen keine Daten über Updates zur Verfügung. Bitte später erneut überprüfen.';
4546
$wb['no_data_raid_txt'] = 'Derzeit stehen keine Daten über RAID zur Verfügung. Bitte später erneut überprüfen.';

interface/web/monitor/lib/lang/en.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ $wb['Show Clamav-Log'] = 'Show Clamav-Log';
4646
$wb['Show ISPConfig-Log'] = 'Show ISPConfig-Log';
4747
$wb['Show RKHunter-Log'] = 'Show RKHunter-Log';
4848
$wb['Show Jobqueue'] = 'Show Jobqueue';
49+
$wb['Show Data Log History'] = 'Show Data Log History';
4950
$wb['Show fail2ban-Log'] = 'Show fail2ban-Log';
5051
$wb['Show MongoDB-Log'] = 'Show MongoDB-Log';
5152
$wb['Show IPTables'] = 'Show IPTables';

interface/web/monitor/lib/module.conf.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
'link' => 'monitor/datalog_list.php',
2727
'html_id' => 'jobqueue');
2828

29+
$items[] = array( 'title' => 'Show Data Log History',
30+
'target' => 'content',
31+
'link' => 'monitor/dataloghistory_list.php',
32+
'html_id' => 'dataloghistory');
33+
2934
$module["nav"][] = array( 'title' => 'System State (All Servers)',
3035
'open' => 1,
3136
'items' => $items);

interface/web/themes/default/assets/stylesheets/ispconfig.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,3 +782,16 @@ span.notification_text {
782782
font-family: inherit;
783783
color: white;
784784
}
785+
.finediff {
786+
font-family: monospace;
787+
}
788+
.finediff ins {
789+
color: green;
790+
background: #dfd;
791+
text-decoration: none;
792+
}
793+
.finediff del {
794+
color: red;
795+
background: #fdd;
796+
text-decoration: none;
797+
}

0 commit comments

Comments
 (0)