diff --git a/admin/admin_log.php b/admin/admin_log.php
index 517a4b9bb..af1aa0731 100644
--- a/admin/admin_log.php
+++ b/admin/admin_log.php
@@ -228,6 +228,7 @@ if ($log_rowset) {
case $log_type['mod_topic_change_tor_status']:
case $log_type['mod_topic_change_tor_type']:
case $log_type['mod_topic_tor_unregister']:
+ case $log_type['mod_topic_tor_register']:
case $log_type['mod_topic_renamed']:
case $log_type['mod_post_delete']:
case $log_type['mod_post_pin']:
diff --git a/library/ajax/change_torrent.php b/library/ajax/change_torrent.php
index ca26b7c24..f4452239c 100644
--- a/library/ajax/change_torrent.php
+++ b/library/ajax/change_torrent.php
@@ -68,11 +68,21 @@ switch ($type) {
case 'reg':
\TorrentPier\Legacy\Torrent::tracker_register($attach_id);
+ $log_action->mod('mod_topic_tor_register', [
+ 'forum_id' => $torrent['forum_id'],
+ 'topic_id' => $torrent['topic_id'],
+ 'topic_title' => $torrent['topic_title'],
+ ]);
$url = (TOPIC_URL . $torrent['topic_id']);
break;
case 'unreg':
\TorrentPier\Legacy\Torrent::tracker_unregister($attach_id);
+ $log_action->mod('mod_topic_tor_unregister', [
+ 'forum_id' => $torrent['forum_id'],
+ 'topic_id' => $torrent['topic_id'],
+ 'topic_title' => $torrent['topic_title'],
+ ]);
$url = (TOPIC_URL . $torrent['topic_id']);
break;
diff --git a/library/language/source/main.php b/library/language/source/main.php
index 80059d74b..9d60fa04b 100644
--- a/library/language/source/main.php
+++ b/library/language/source/main.php
@@ -2823,6 +2823,7 @@ $lang['LOG_ACTION']['LOG_TYPE'] = [
'mod_topic_change_tor_status' => 'Topic:
changed torrent status',
'mod_topic_change_tor_type' => 'Topic:
changed torrent type',
'mod_topic_tor_unregister' => 'Topic:
torrent unregistered',
+ 'mod_topic_tor_register' => 'Topic:
torrent registered',
'mod_topic_renamed' => 'Topic:
renamed',
'mod_post_delete' => 'Post:
deleted',
'mod_post_pin' => 'Post:
pinned',
diff --git a/src/Legacy/Attach.php b/src/Legacy/Attach.php
index 3123a2aa5..cd9ca32d2 100644
--- a/src/Legacy/Attach.php
+++ b/src/Legacy/Attach.php
@@ -479,6 +479,8 @@ class Attach
unlink_attach($row['physical_filename'], MODE_THUMBNAIL);
}
+ // todo: log action - torrent updated
+
//bt
if ($this->attachment_extension_list[$actual_element] === TORRENT_EXT && $attachments[$actual_element]['tracker_status']) {
Torrent::tracker_unregister($attachment_id);
diff --git a/src/Legacy/LogAction.php b/src/Legacy/LogAction.php
index b1d7b2dfb..2846d771c 100644
--- a/src/Legacy/LogAction.php
+++ b/src/Legacy/LogAction.php
@@ -33,6 +33,7 @@ class LogAction
'mod_topic_change_tor_status' => 15,
'mod_topic_change_tor_type' => 16,
'mod_topic_tor_unregister' => 17,
+ 'mod_topic_tor_register' => 18,
];
public $log_type_select = [];
public $log_disabled = false;
diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php
index 791ff30bd..ccac74eb0 100644
--- a/src/Legacy/Torrent.php
+++ b/src/Legacy/Torrent.php
@@ -97,7 +97,7 @@ class Torrent
*/
public static function tracker_unregister($attach_id, $mode = '')
{
- global $lang, $bb_cfg, $log_action;
+ global $lang, $bb_cfg;
$attach_id = (int)$attach_id;
$post_id = $topic_id = $topic_title = $forum_id = null;
@@ -153,13 +153,6 @@ class Torrent
$torrServer->removeM3U($attach_id);
}
- // Log action
- $log_action->mod('mod_topic_tor_unregister', [
- 'forum_id' => $forum_id,
- 'topic_id' => $topic_id,
- 'topic_title' => $topic_title,
- ]);
-
// Delete torrent
$sql = "DELETE FROM " . BB_BT_TORRENTS . " WHERE attach_id = $attach_id";