approval none send cancel ban msg too

This commit is contained in:
xiaomlove
2022-06-16 02:29:11 +08:00
parent 8936580476
commit 990b8ab406
5 changed files with 22 additions and 2 deletions
+6 -1
View File
@@ -36,7 +36,12 @@ class TorrentOperationLog extends NexusModel
public static function add(array $params)
{
$log = self::query()->create($params);
if (!in_array($params['action_type'], [self::ACTION_TYPE_APPROVAL_ALLOW, self::ACTION_TYPE_APPROVAL_DENY])) {
$notifyActionTypes = [
self::ACTION_TYPE_APPROVAL_ALLOW,
self::ACTION_TYPE_APPROVAL_DENY,
self::ACTION_TYPE_APPROVAL_NONE,
];
if (!in_array($params['action_type'], $notifyActionTypes)) {
do_log("actionType: {$params['action_type']}, do not notify");
return $log;
}
+1 -1
View File
@@ -259,7 +259,7 @@ if ($row['banned'] == 'yes' && $row['owner'] == $CURUSER['id']) {
'msg' => nexus_trans('torrent.owner_update_torrent_msg', ['detail_url' => $torrentUrl, 'torrent_name' => $_POST['name']]),
'added' => now(),
]);
\Nexus\Database\NexusDB::cache_del("staff_message_count");
\Nexus\Database\NexusDB::cache_del("staff_new_message_count");
}
$returl = "details.php?id=$id&edited=1";
+5
View File
@@ -54,6 +54,11 @@ return [
'type_text' => 'Cancel banned',
'notify_subject' => 'Torrent was unbanned',
'notify_msg' => 'Your torrent: [url=:detail_url]:torrent_name[/url] unbanned by :operator',
],
\App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_NONE => [
'type_text' => 'Cancel banned',
'notify_subject' => 'Torrent was unbanned',
'notify_msg' => 'Your torrent: [url=:detail_url]:torrent_name[/url] unbanned by :operator',
]
],
'owner_update_torrent_subject' => 'Banned torrent have been updated',
+5
View File
@@ -54,6 +54,11 @@ return [
'type_text' => '取消禁止',
'notify_subject' => '种子取消禁止',
'notify_msg' => '你的种子:[url=:detail_url]:torrent_name[/url] 被 :operator 取消禁止',
],
\App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_NONE => [
'type_text' => '取消禁止',
'notify_subject' => '种子取消禁止',
'notify_msg' => '你的种子:[url=:detail_url]:torrent_name[/url] 被 :operator 取消禁止',
]
],
'owner_update_torrent_subject' => '被禁种子已更新',
+5
View File
@@ -54,6 +54,11 @@ return [
'type_text' => '取消禁止',
'notify_subject' => '種子取消禁止',
'notify_msg' => '你的種子:[url=:detail_url]:torrent_name[/url] 被 :operator 取消禁止',
],
\App\Models\TorrentOperationLog::ACTION_TYPE_APPROVAL_NONE => [
'type_text' => '取消禁止',
'notify_subject' => '種子取消禁止',
'notify_msg' => '你的種子:[url=:detail_url]:torrent_name[/url] 被 :operator 取消禁止',
]
],
'owner_update_torrent_subject' => '被禁種子已更新',