+ return false;
+ }
+
+ // File put was successful. Store file attributes locally.
+ $entity_type = $mdb2->quote($fields['entity_type']);
+ $entity_id = (int) $fields['entity_id'];
+ $file_name = $mdb2->quote($fields['file_name']);
+ $description = $mdb2->quote($fields['description']);
+ $created = 'now()';
+ $created_ip = $mdb2->quote($_SERVER['REMOTE_ADDR']);
+ $created_by = $user->id;
+
+ $columns = '(group_id, org_id, remote_id, entity_type, entity_id, file_name, description, created, created_ip, created_by)';
+ $values = "values($group_id, $org_id, $file_id, $entity_type, $entity_id, $file_name, $description, $created, $created_ip, $created_by)";
+ $sql = "insert into tt_files $columns $values";
+ $affected = $mdb2->exec($sql);
+ return (!is_a($affected, 'PEAR_Error'));