From: Nik Okuntseff Date: Sun, 18 Mar 2018 17:53:43 +0000 (+0000) Subject: Added audit info to user update operation. X-Git-Tag: timetracker_1.19-1~1010 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9494c6e4f474c5687d388b32c167f31cbe0aeb62;p=timetracker.git Added audit info to user update operation. --- diff --git a/WEB-INF/lib/ttExportHelper.class.php b/WEB-INF/lib/ttExportHelper.class.php index fa358420..c71b856d 100644 --- a/WEB-INF/lib/ttExportHelper.class.php +++ b/WEB-INF/lib/ttExportHelper.class.php @@ -363,6 +363,9 @@ class ttExportHelper { * 2) Admin usage - used infrequently. * 3) Export - used infrequently. * + * TODO: we also have user registration process without initialized user. + * Perhaps we need a separate helper class for this. Think about it. + * * It is tempting to have a generic function to get things done for * all situations. However, as export and admin access are one-off * operations, while regular system usage is daily and must be efficient, diff --git a/WEB-INF/lib/ttUserHelper.class.php b/WEB-INF/lib/ttUserHelper.class.php index f8680d9f..bd4570a5 100644 --- a/WEB-INF/lib/ttUserHelper.class.php +++ b/WEB-INF/lib/ttUserHelper.class.php @@ -189,9 +189,11 @@ class ttUserHelper { $status_part = ", status = $status"; } + $modified_part = ', modified = now(), modified_ip = '.$mdb2->quote($_SERVER['REMOTE_ADDR']).', modified_by = '.$mdb2->quote($user->id); + $sql = "update tt_users set login = ".$mdb2->quote($fields['login']). "$pass_part, name = ".$mdb2->quote($fields['name']). - "$role_id_part $client_part $rate_part $status_part, email = ".$mdb2->quote($fields['email']). + "$role_id_part $client_part $rate_part $modified_part $status_part, email = ".$mdb2->quote($fields['email']). " where id = $user_id"; $affected = $mdb2->exec($sql); if (is_a($affected, 'PEAR_Error')) return false; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 4758cc71..7bfc132b 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.17.54.4101 | Copyright © Anuko | +  Anuko Time Tracker 1.17.54.4102 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}