Added audit info to user update operation.
authorNik Okuntseff <support@anuko.com>
Sun, 18 Mar 2018 17:53:43 +0000 (17:53 +0000)
committerNik Okuntseff <support@anuko.com>
Sun, 18 Mar 2018 17:53:43 +0000 (17:53 +0000)
WEB-INF/lib/ttExportHelper.class.php
WEB-INF/lib/ttUserHelper.class.php
WEB-INF/templates/footer.tpl

index fa35842..c71b856 100644 (file)
@@ -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,
index f8680d9..bd4570a 100644 (file)
@@ -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;
index 4758cc7..7bfc132 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.17.54.4101 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.17.54.4102 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>