Skip to content

Commit

Permalink
Revert logUpload and logDownload to include filenames, because they c…
Browse files Browse the repository at this point in the history
…ome from storageFileItems and not from storageFiles where we want to eliminate them
  • Loading branch information
mrtcode committed May 30, 2018
1 parent 0d6b96b commit 6619177
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions model/Storage.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,20 @@ public static function logDownload($item, $downloadUserID, $ipAddress) {

$info = self::getLocalFileItemInfo($item);
$storageFileID = $info['storageFileID'];
$filename = $info['filename'];
$size = $info['size'];

$sql = "INSERT INTO storageDownloadLog
(ownerUserID, downloadUserID, ipAddress, storageFileID, size)
VALUES (?, ?, INET_ATON(?), ?, ?)";
(ownerUserID, downloadUserID, ipAddress, storageFileID, filename, size)
VALUES (?, ?, INET_ATON(?), ?, ?, ?)";
Zotero_DB::query(
$sql,
[
$ownerUserID,
$downloadUserID,
$ipAddress,
$storageFileID,
$filename,
$size
],
0,
Expand Down Expand Up @@ -284,15 +286,16 @@ public static function logUpload($uploadUserID, $item, $key, $ipAddress) {

$info = self::getLocalFileItemInfo($item);
$storageFileID = $info['storageFileID'];
$filename = $info['filename'];
$size = $info['size'];

$sql = "DELETE FROM storageUploadQueue WHERE uploadKey=?";
Zotero_DB::query($sql, $key);

$sql = "INSERT INTO storageUploadLog
(ownerUserID, uploadUserID, ipAddress, storageFileID, size)
VALUES (?, ?, INET_ATON(?), ?, ?)";
Zotero_DB::query($sql, array($ownerUserID, $uploadUserID, $ipAddress, $storageFileID, $size));
(ownerUserID, uploadUserID, ipAddress, storageFileID, filename, size)
VALUES (?, ?, INET_ATON(?), ?, ?, ?)";
Zotero_DB::query($sql, array($ownerUserID, $uploadUserID, $ipAddress, $storageFileID, $filename, $size));
}


Expand Down

0 comments on commit 6619177

Please sign in to comment.