From d07f2a1a67399216d913f748a8590909003b8b68 Mon Sep 17 00:00:00 2001 From: Git Date: Tue, 24 Jan 2012 08:00:19 +0000 Subject: [PATCH] Empty commit --- classes/script_start.php | 8 +++++ gazelle.sql | 14 ++++++++ sections/reportsv2/takeresolve.php | 3 ++ sections/requests/requests.php | 6 ---- sections/torrents/add_alias.php | 1 + sections/torrents/delete_alias.php | 1 + sections/torrents/details.php | 1 + sections/torrents/editgroupid.php | 2 ++ sections/torrents/grouplog.php | 53 ++++++++++++++++++++++++++++++ sections/torrents/merge.php | 10 ++++-- sections/torrents/rename.php | 1 + sections/torrents/takedelete.php | 1 + sections/torrents/takeedit.php | 1 + sections/upload/upload_handle.php | 1 + sections/user/takemoderate.php | 15 +++++++-- sections/user/user.php | 11 ++++--- 16 files changed, 113 insertions(+), 16 deletions(-) create mode 100644 sections/torrents/grouplog.php diff --git a/classes/script_start.php b/classes/script_start.php index 737f1fd3..346ebd89 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -1067,6 +1067,12 @@ function make_class_string($ClassID) { return $Classes[$ClassID]['Name']; } +//Write to the group log +function write_group_log($GroupID, $TorrentID, $UserID, $Message, $Hidden) { + global $DB,$Time; + $DB->query("INSERT INTO group_log (GroupID, TorrentID, UserID, Info, Time, Hidden) VALUES (".$GroupID.", ".$TorrentID.", ".$UserID.", '".db_string($Message)."', '".sqltime()."', ".$Hidden.")"); +} + // Write a message to the system log function write_log($Message) { global $DB,$Time; @@ -1161,6 +1167,7 @@ function delete_group($GroupID) { global $DB, $Cache; write_log("Group ".$GroupID." automatically deleted (No torrents have this group)."); + //$DB->query("DELETE FROM group_log WHERE GroupID = ".$GroupID); //Never call this unless you're certain the group is no longer used by any torrents $DB->query("SELECT CategoryID FROM torrents_group WHERE ID='$GroupID'"); @@ -2167,6 +2174,7 @@ function freeleech_torrents($TorrentIDs, $FreeNeutral = 1, $FreeLeechType = 0) { update_tracker('update_torrent', array('info_hash' => rawurlencode($InfoHash), 'freetorrent' => $FreeNeutral)); $Cache->delete_value('torrent_download_'.$TorrentID); write_log($LoggedUser['Username']." marked torrent ".$TorrentID." freeleech type ".$FreeLeechType."!"); + write_group_log($GroupID, $TorrentID, $LoggedUser['UserID'], "marked as freeleech type ".$FreeLeechType."!", 0); } foreach($GroupIDs as $GroupID) { diff --git a/gazelle.sql b/gazelle.sql index 2dbdebe5..d35228df 100644 --- a/gazelle.sql +++ b/gazelle.sql @@ -323,6 +323,20 @@ CREATE TABLE `geoip_country` ( PRIMARY KEY (`StartIP`,`EndIP`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; +CREATE TABLE `group_log` ( + `ID` int(10) NOT NULL AUTO_INCREMENT, + `GroupID` int(10) NOT NULL, + `TorrentID` int(10) NOT NULL, + `UserID` int(10) NOT NULL DEFAULT '0', + `Info` mediumtext, + `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', + `Hidden` tinyint(4) NOT NULL DEFAULT '0', + PRIMARY KEY (`ID`), + KEY `GroupID` (`GroupID`), + KEY `TorrentID` (`TorrentID`), + KEY `UserID` (`UserID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + CREATE TABLE `invite_tree` ( `UserID` int(10) NOT NULL DEFAULT '0', `InviterID` int(10) NOT NULL DEFAULT '0', diff --git a/sections/reportsv2/takeresolve.php b/sections/reportsv2/takeresolve.php index 86432f22..28fc1f24 100644 --- a/sections/reportsv2/takeresolve.php +++ b/sections/reportsv2/takeresolve.php @@ -178,8 +178,11 @@ if(isset($Escaped['log_message']) && $Escaped['log_message'] != "") { $Log .= " ( ".$Escaped['log_message']." )"; } + $DB->query("SELECT GroupID FROM torrents WHERE ID = ".$TorrentID); + list($GroupID) = $DB->next_record(); delete_torrent($TorrentID); write_log($Log); + write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "deleted torrent", 0); } else { $Log = "No log message (Torrent wasn't deleted)"; } diff --git a/sections/requests/requests.php b/sections/requests/requests.php index 4daccaf2..b6a66aa5 100644 --- a/sections/requests/requests.php +++ b/sections/requests/requests.php @@ -23,9 +23,6 @@ case 'created': $Title = 'My requests'; $SS->set_filter('userid', array($LoggedUser['ID'])); - if(empty($_GET['show_filled'])) { - $SS->set_filter('torrentid', array(0)); - } break; case 'voted': if(!empty($_GET['userid'])) { @@ -40,9 +37,6 @@ $Title = "Requests I've voted on"; $SS->set_filter('voter', array($LoggedUser['ID'])); } - if(empty($_GET['show_filled']) && $Submitted) { - $SS->set_filter('torrentid', array(0)); - } break; case 'filled': if(empty($_GET['userid']) || !is_number($_GET['userid'])) { diff --git a/sections/torrents/add_alias.php b/sections/torrents/add_alias.php index 6afe2896..506ded3c 100644 --- a/sections/torrents/add_alias.php +++ b/sections/torrents/add_alias.php @@ -60,6 +60,7 @@ NumArtists=VALUES(NumArtists);"); write_log("Artist ".$ArtistID." (".$ArtistName.") was added to the group ".$GroupID." (".$GroupName.") by user ".$LoggedUser['ID']." (".$LoggedUser['Username'].")"); + write_group_log($GroupID, 0, $LoggedUser['ID'], "added artist ".$ArtistName, 0); } else { list($OldAliasID) = $DB->next_record(); if($OldAliasID == 0) { diff --git a/sections/torrents/delete_alias.php b/sections/torrents/delete_alias.php index 3e6a503d..0c5eef06 100644 --- a/sections/torrents/delete_alias.php +++ b/sections/torrents/delete_alias.php @@ -49,6 +49,7 @@ $Cache->delete_value('torrents_details_'.$GroupID); // Delete torrent group cache $Cache->delete_value('groups_artists_'.$GroupID); // Delete group artist cache write_log("Artist ".$ArtistID." (".$ArtistName.") was removed from the group ".$GroupID." (".$GroupName.") by user ".$LoggedUser['ID']." (".$LoggedUser['Username'].")"); +write_group_log($GroupID, 0, $LoggedUser['ID'], "removed artist ".$ArtistName, 0); update_hash($GroupID); diff --git a/sections/torrents/details.php b/sections/torrents/details.php index fd0a0f5d..e3b5ebd1 100644 --- a/sections/torrents/details.php +++ b/sections/torrents/details.php @@ -105,6 +105,7 @@ function compare($X, $Y){ if(check_perms('site_submit_requests')) { ?> [Request format] + [View log]