Added some protection from bot registrations.
[timetracker.git] / WEB-INF / lib / ttExportHelper.class.php
index ab691c9..375de2f 100644 (file)
@@ -237,7 +237,7 @@ class ttExportHelper {
       foreach ($records as $record) {
         $key++;
         $this->logMap[$record['id']] = $key;
-        fwrite($file, "  <log_item id=\"$key\" timestamp=\"".$record['timestamp']."\" user_id=\"".$this->userMap[$record['user_id']]."\" date=\"".$record['date']."\" start=\"".$record['start']."\" finish=\"".$record['finish']."\" duration=\"".($record['start']?"":$record['duration'])."\" client_id=\"".$this->clientMap[$record['client_id']]."\" project_id=\"".$this->projectMap[$record['project_id']]."\" task_id=\"".$this->taskMap[$record['task_id']]."\" invoice_id=\"".$this->invoiceMap[$record['invoice_id']]."\" billable=\"".$record['billable']."\" paid=\"".$record['paid']."\" status=\"".$record['status']."\">\n");
+        fwrite($file, "  <log_item id=\"$key\" user_id=\"".$this->userMap[$record['user_id']]."\" date=\"".$record['date']."\" start=\"".$record['start']."\" finish=\"".$record['finish']."\" duration=\"".($record['start']?"":$record['duration'])."\" client_id=\"".$this->clientMap[$record['client_id']]."\" project_id=\"".$this->projectMap[$record['project_id']]."\" task_id=\"".$this->taskMap[$record['task_id']]."\" invoice_id=\"".$this->invoiceMap[$record['invoice_id']]."\" billable=\"".$record['billable']."\" paid=\"".$record['paid']."\" status=\"".$record['status']."\">\n");
         fwrite($file, "    <comment><![CDATA[".$record['comment']."]]></comment>\n");
         fwrite($file, "  </log_item>\n");
       }
@@ -360,16 +360,14 @@ class ttExportHelper {
 
   /*
    * Note about the utility functions below.
-   * We have roughly 3 groups of operations:
+   * We have roughly 4 groups of operations:
    *   1) Regular system usage for tracking time, etc.
-   *   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.
+   *   2) Registration process - used infrequently.
+   *   3) Admin usage - used infrequently.
+   *   4) Export - used infrequently.
    *
    * It is tempting to have a generic function to get things done for
-   * all situations. However, as export and admin access are one-off
+   * all situations. However, as registration, export and admin access are one-off
    * operations, while regular system usage is daily and must be efficient,
    * the current approach is to have SEPARATE functions for each mode.
    *