From 065374201199c6e7c4436892753e98341adbf838 Mon Sep 17 00:00:00 2001 From: Git Date: Wed, 25 Jul 2012 08:00:15 +0000 Subject: [PATCH] Empty commit --- classes/script_start.php | 2 +- gazelle.sql | 1 - sections/artist/change_artistid.php | 2 +- sections/collages/new_handle.php | 2 +- sections/collages/take_delete.php | 2 +- sections/torrents/add_alias.php | 4 ++-- sections/torrents/delete_alias.php | 4 ++-- sections/torrents/manage_artists.php | 2 +- sections/torrents/rename.php | 6 +++--- sections/torrents/takedelete.php | 2 +- sections/torrents/takeedit.php | 2 +- sections/userhistory/ip_history.php | 6 +++++- sections/wiki/delete.php | 2 +- sections/wiki/takecreate.php | 2 +- 14 files changed, 21 insertions(+), 18 deletions(-) diff --git a/classes/script_start.php b/classes/script_start.php index fc8bae72..05c1b8db 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -1436,7 +1436,7 @@ function delete_artist($ArtistID) { global $DB, $LoggedUser, $Cache; $DB->query("SELECT Name FROM artists_group WHERE ArtistID = ".$ArtistID); - list($Name) = $DB->next_record(); + list($Name) = $DB->next_record(MYSQLI_NUM, false); // Delete requests $DB->query("SELECT RequestID FROM requests_artists WHERE ArtistID=".$ArtistID." AND ArtistID != 0"); diff --git a/gazelle.sql b/gazelle.sql index 6f8b7023..36116399 100644 --- a/gazelle.sql +++ b/gazelle.sql @@ -400,7 +400,6 @@ CREATE TABLE `log` ( `Message` varchar(400) COLLATE utf8_swedish_ci NOT NULL, `Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`ID`), - KEY `Message` (`Message`(255)), KEY `Time` (`Time`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci; diff --git a/sections/artist/change_artistid.php b/sections/artist/change_artistid.php index d7c7efed..17f3c2c3 100644 --- a/sections/artist/change_artistid.php +++ b/sections/artist/change_artistid.php @@ -18,7 +18,7 @@ } $DB->query("SELECT Name FROM artists_group WHERE ArtistID = $ArtistID LIMIT 1"); -if(!(list($ArtistName) = $DB->next_record())) { +if(!(list($ArtistName) = $DB->next_record(MYSQLI_NUM, false))) { error('An error has occured.'); } diff --git a/sections/collages/new_handle.php b/sections/collages/new_handle.php index 30cafad9..a4e80a1e 100644 --- a/sections/collages/new_handle.php +++ b/sections/collages/new_handle.php @@ -77,7 +77,7 @@ $CollageID = $DB->inserted_id(); $Cache->delete_value('collage_'.$CollageID); -write_log("Collage ".$CollageID." (".$P[name].") was created by ".$LoggedUser['Username']); +write_log("Collage ".$CollageID." (".$_POST['name'].") was created by ".$LoggedUser['Username']); header('Location: collages.php?id='.$CollageID); ?> diff --git a/sections/collages/take_delete.php b/sections/collages/take_delete.php index 8eceaf13..057b3501 100644 --- a/sections/collages/take_delete.php +++ b/sections/collages/take_delete.php @@ -8,7 +8,7 @@ } $DB->query("SELECT Name, CategoryID, UserID FROM collages WHERE ID='$CollageID'"); -list($Name, $CategoryID, $UserID) = $DB->next_record(); +list($Name, $CategoryID, $UserID) = $DB->next_record(MYSQLI_NUM, false); if(!check_perms('site_collages_delete') && $UserID != $LoggedUser['ID']) { error(403); diff --git a/sections/torrents/add_alias.php b/sections/torrents/add_alias.php index 476eae42..05cb795c 100644 --- a/sections/torrents/add_alias.php +++ b/sections/torrents/add_alias.php @@ -39,10 +39,10 @@ } $DB->query("SELECT Name FROM torrents_group WHERE ID=".$GroupID); - list($GroupName) = $DB->next_record(); + list($GroupName) = $DB->next_record(MYSQLI_NUM, false); $DB->query("SELECT Name FROM artists_group WHERE ArtistID=".$ArtistID); - list($ArtistName) = $DB->next_record(); + list($ArtistName) = $DB->next_record(MYSQLI_NUM, false); $DB->query("INSERT IGNORE INTO torrents_artists diff --git a/sections/torrents/delete_alias.php b/sections/torrents/delete_alias.php index 461954f2..55a2af3b 100644 --- a/sections/torrents/delete_alias.php +++ b/sections/torrents/delete_alias.php @@ -12,10 +12,10 @@ $DB->query("DELETE FROM torrents_artists WHERE GroupID='$GroupID' AND ArtistID='$ArtistID' AND Importance='$Importance'"); $DB->query("SELECT Name FROM artists_group WHERE ArtistID=".$ArtistID); -list($ArtistName) = $DB->next_record(); +list($ArtistName) = $DB->next_record(MYSQLI_NUM, false); $DB->query("SELECT Name FROM torrents_group WHERE ID=".$GroupID); -list($GroupName) = $DB->next_record(); +list($GroupName) = $DB->next_record(MYSQLI_NUM, false); //Get a count of how many groups or requests use this artist ID $DB->query("SELECT ag.ArtistID diff --git a/sections/torrents/manage_artists.php b/sections/torrents/manage_artists.php index 916822f4..98e4f86c 100644 --- a/sections/torrents/manage_artists.php +++ b/sections/torrents/manage_artists.php @@ -28,7 +28,7 @@ $DB->query("SELECT Name FROM torrents_group WHERE ID = '".$_POST['groupid']."'"); list($GroupName) = $DB->next_record(); $DB->query("SELECT ArtistID, Name FROM artists_group WHERE ArtistID IN (".$ArtistsString.")"); - $ArtistNames = $DB->to_array('ArtistID'); + $ArtistNames = $DB->to_array('ArtistID', MYSQLI_ASSOC, false); print_r($ArtistNames); foreach ($CleanArtists AS $Artist) { list($Importance,$ArtistID) = $Artist; diff --git a/sections/torrents/rename.php b/sections/torrents/rename.php index dac544dc..c8a02024 100644 --- a/sections/torrents/rename.php +++ b/sections/torrents/rename.php @@ -3,7 +3,7 @@ $GroupID = $_POST['groupid']; $OldGroupID = $GroupID; -$NewName = db_string($_POST['name']); +$NewName = $_POST['name']; if(!$GroupID || !is_number($GroupID)) { error(404); } @@ -14,9 +14,9 @@ if(!check_perms('torrents_edit')) { error(403); } $DB->query("SELECT Name FROM torrents_group WHERE ID = ".$GroupID); -list($OldName) = $DB->next_record(); +list($OldName) = $DB->next_record(MYSQLI_NUM, false); -$DB->query("UPDATE torrents_group SET Name='$NewName' WHERE ID='$GroupID'"); +$DB->query("UPDATE torrents_group SET Name='".db_string($NewName)."' WHERE ID='$GroupID'"); $Cache->delete_value('torrents_details_'.$GroupID); $DB->query("SELECT ArtistID FROM torrents_artists WHERE GroupID='$GroupID'"); diff --git a/sections/torrents/takedelete.php b/sections/torrents/takedelete.php index 59eb1bc8..75c48f7c 100644 --- a/sections/torrents/takedelete.php +++ b/sections/torrents/takedelete.php @@ -18,7 +18,7 @@ LEFT JOIN artists_group AS ag ON ag.ArtistID=tg.ArtistID LEFT JOIN xbt_snatched AS x ON x.fid=t.ID WHERE t.ID='$TorrentID'"); -list($UserID, $GroupID, $Size, $InfoHash, $Name, $ArtistName, $Time, $Snatches) = $DB->next_record(MYSQLI_NUM, array(3)); +list($UserID, $GroupID, $Size, $InfoHash, $Name, $ArtistName, $Time, $Snatches) = $DB->next_record(MYSQLI_NUM, false); if(($LoggedUser['ID']!=$UserID || time_ago($Time) > 3600*24*7 || $Snatches > 4) && !check_perms('torrents_delete')) { error(403); diff --git a/sections/torrents/takeedit.php b/sections/torrents/takeedit.php index 03ffcac5..0ea42a7a 100644 --- a/sections/torrents/takeedit.php +++ b/sections/torrents/takeedit.php @@ -421,7 +421,7 @@ } $DB->query("SELECT Name FROM torrents_group WHERE ID=$GroupID"); -list($Name) = $DB->next_record(); +list($Name) = $DB->next_record(MYSQLI_NUM, false); write_log("Torrent $TorrentID ($Name) in group $GroupID was edited by ".$LoggedUser['Username']." (".$LogDetails.")"); // TODO: this is probably broken write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], $LogDetails, 0); diff --git a/sections/userhistory/ip_history.php b/sections/userhistory/ip_history.php index 449e2260..99c28d8a 100644 --- a/sections/userhistory/ip_history.php +++ b/sections/userhistory/ip_history.php @@ -133,6 +133,8 @@ function UnBan(ip, id, elemID) { $counter = 0; $IPs = array(); $Results = $DB->to_array(); +$CanManageIPBans = check_perms('admin_manage_ipbans'); + foreach($Results as $Index => $Result) { list($IP, $StartTime, $EndTime, $UserIDs, $UserStartTimes, $UserEndTimes, $Usernames, $UsersEnabled, $UsersDonor, $UsersWarned) = $Result; @@ -153,6 +155,7 @@ function UnBan(ip, id, elemID) { () query($sql); @@ -167,7 +170,8 @@ function UnBan(ip, id, elemID) { [Ban] diff --git a/sections/wiki/delete.php b/sections/wiki/delete.php index ee48222f..656ea2fd 100644 --- a/sections/wiki/delete.php +++ b/sections/wiki/delete.php @@ -10,7 +10,7 @@ error(404); } -list($Title) = $DB->next_record(); +list($Title) = $DB->next_record(MYSQLI_NUM, false); //Log write_log("Wiki article ".$ID." (".$Title.") was deleted by ".$LoggedUser['Username']); //Delete diff --git a/sections/wiki/takecreate.php b/sections/wiki/takecreate.php index 72871e73..8fb68608 100644 --- a/sections/wiki/takecreate.php +++ b/sections/wiki/takecreate.php @@ -53,7 +53,7 @@ $Alias->flush(); -write_log("Wiki article ".$ArticleID." (".$P[title].") was created by ".$LoggedUser['Username']); +write_log("Wiki article ".$ArticleID." (".$_POST['title'].") was created by ".$LoggedUser['Username']); header('Location: wiki.php?action=article&id='.$ArticleID);