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

index 8dceed8..f8680d9 100644 (file)
@@ -109,6 +109,7 @@ class ttUserHelper {
 
   // insert - inserts a user into database.
   static function insert($fields, $hash = true) {
+    global $user;
     $mdb2 = getConnection();
 
     $password = $mdb2->quote($fields['password']);
@@ -123,10 +124,12 @@ class ttUserHelper {
       $status_f = ', status';
       $status_v = ', '.$mdb2->quote($fields['status']);
     }
+    $created_ip_v = ', '.$mdb2->quote($_SERVER['REMOTE_ADDR']);
+    $created_by_v = ', '.$mdb2->quote($user->id);
 
-    $sql = "insert into tt_users (name, login, password, team_id, role_id, client_id, rate, email $status_f) values (".
+    $sql = "insert into tt_users (name, login, password, team_id, role_id, client_id, rate, email, created, created_ip, created_by $status_f) values (".
       $mdb2->quote($fields['name']).", ".$mdb2->quote($fields['login']).
-      ", $password, $team_id, ".$mdb2->quote($fields['role_id']).", ".$mdb2->quote($fields['client_id']).", $rate, ".$mdb2->quote($email)." $status_v)";
+      ", $password, $team_id, ".$mdb2->quote($fields['role_id']).", ".$mdb2->quote($fields['client_id']).", $rate, ".$mdb2->quote($email).", now() $created_ip_v $created_by_v $status_v)";
     $affected = $mdb2->exec($sql);
 
     // Now deal with project assignment.
index 776d899..4758cc7 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.53.4100 | 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.4101 | 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>