Commit a6ce7641 authored by Till Brehm's avatar Till Brehm

Merge branch 'master' into 'master'

improve datalog-viewer

See merge request !894
parents 72b955c8 46b74480
Pipeline #1080 passed with stage
in 2 minutes and 27 seconds
<?php
/*
Copyright (c) 2007-2008, Till Brehm, projektfarm Gmbh and Oliver Vogel www.muv.com
All rights reserved.
......@@ -48,7 +47,6 @@ $app->tpl->setvar($wb);
$id = intval($_GET['id']);
$record = $app->db->queryOneRecord('SELECT * FROM sys_datalog WHERE datalog_id = ?', $id);
$out['id'] = $id;
$out['timestamp'] = date($app->lng('conf_format_datetime'), $record['tstamp']);
......@@ -63,6 +61,8 @@ if(!$data = unserialize(stripslashes($record['data']))) {
$data = unserialize($record['data']);
}
$out = describe($record['dbtable'], $data, $out);
switch ($record['action']) {
case 'i':
$inserts = array();
......@@ -128,4 +128,72 @@ function show_diff_if_needed($old, $new) {
}
}
function describe($dbtable, $data, $out) {
global $app;
$out['describe'] = $app->lng('describe_'.$dbtable);
switch ($dbtable) {
case 'client':
$check = 'username';
break;
case 'cron':
$temp = $app->db->queryOneRecord("SELECT domain FROM web_domain WHERE domain_id = ?", $data['new']['parent_domain_id']);
$out['describe_data'] = $temp['domain'];
break;
case 'directive_snippets':
$check = 'name';
break;
case 'domain':
$check = 'domain';
break;
case 'ftp_user':
$check = 'username';
break;
case 'mail_domain':
$check = 'domain';
break;
case 'mail_forwarding':
$check = 'source';
break;
case 'mail_user':
$check = 'email';
break;
case 'mail_user_filter':
$check = 'rulename';
break;
case 'remote_user':
$check = 'remote_username';
break;
case 'server_php':
$check = 'name';
break;
case 'shell_user':
$check = 'username';
break;
case 'spamfilter_policy':
$check = 'policy_name';
break;
case 'spamfilter_users':
$check = 'email';
break;
case 'web_domain':
$check = 'domain';
break;
case 'web_database_user':
$check = 'database_user';
break;
case 'web_database':
$check = 'database_name';
break;
case 'web_folder_user':
$check = 'username';
break;
}
if(!isset($out['describe_data'])) {
$out['describe_data'] = @(isset($data['old'][$check]) && $data['old'][$check] != $data['new'][$check])?$data['old'][$check].'/'.$data['new'][$check]:$data['new'][$check];
}
return $out;
}
?>
......@@ -23,4 +23,22 @@ $wb['new_txt'] = 'Neu';
$wb['btn_cancel_txt'] = 'Zurück';
$wb['undo_txt'] = 'Rückgängig machen';
$wb['undo_confirmation_txt'] = 'Soll diese Änderung wirklich rückgängig gemacht werden?';
$wb['describe_client'] = 'Username';
$wb['describe_cron'] = 'Webseite';
$wb['describe_directive_snippets'] = 'Direktiven Schnippsel';
$wb['describe_domain'] = 'Domain';
$wb['describe_ftp_user'] = 'FTP-User';
$wb['describe_mail_domain'] = 'Email-Domain';
$wb['describe_mail_forwarding'] = 'Quelle';
$wb['describe_mail_user'] = 'Email';
$wb['describe_mail_user_filter'] = 'Mailuser-Filter';
$wb['describe_remote_user'] = 'Remote-User';
$wb['describe_server_php'] = 'PHP Version';
$wb['describe_shell_user'] = 'Shell-User';
$wb['describe_spamfilter_policy'] = 'Spam-Richtlinie';
$wb['describe_spamfilter_users'] = 'Spam-User';
$wb['describe_web_database'] = 'Datenbank';
$wb['describe_web_database_user'] = 'Datenbank-User';
$wb['describe_web_domain'] = 'Webseite';
$wb['describe_web_folder_user'] = 'Web-Ordner User';
?>
......@@ -23,4 +23,22 @@ $wb['new_txt'] = 'New';
$wb['btn_cancel_txt'] = 'Back';
$wb['undo_txt'] = 'Undo action';
$wb['undo_confirmation_txt'] = 'Do you really want to undo this action?';
$wb['describe_client'] = 'Username';
$wb['describe_cron'] = 'Website';
$wb['describe_directive_snippets'] = 'Direktive Snippet';
$wb['describe_domain'] = 'Domain';
$wb['describe_ftp_user'] = 'FTP-User';
$wb['describe_mail_domain'] = 'Email-Domain';
$wb['describe_mail_forwarding'] = 'Source';
$wb['describe_mail_user'] = 'Email';
$wb['describe_mail_user_filter'] = 'Mailuser-Filter';
$wb['describe_remote_user'] = 'Remote-User';
$wb['describe_shell_user'] = 'Shell-User';
$wb['describe_server_php'] = 'PHP Version';
$wb['describe_spamfilter_policy'] = 'Spam-Policy';
$wb['describe_spamfilter_users'] = 'Spam-User';
$wb['describe_web_database'] = 'Database';
$wb['describe_web_database_user'] = 'Database-User';
$wb['describe_web_domain'] = 'Website';
$wb['describe_web_folder_user'] = 'Web-Folder User';
?>
......@@ -20,6 +20,12 @@
<td><tmpl_var name="table_txt"></td>
<td><tmpl_var name="table"></td>
</tr>
<tmpl_if name="describe_data" op="!=" value="">
<tr>
<td><tmpl_var name="describe"></td>
<td><tmpl_var name="describe_data"></td>
</tr>
</tmpl_if>
<tr>
<td><tmpl_var name="action_txt"></td>
<td><tmpl_var name="action_name"></td>
......
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