From aca54267f8da1641edc6321ef2b2d7600eec448d Mon Sep 17 00:00:00 2001 From: Git Date: Fri, 18 Nov 2011 08:00:16 +0000 Subject: [PATCH] Empty commit --- gazelle.sql | 4 +- sections/staffpm/viewconv.php | 213 +++++++++++++++------------------- sections/user/user.php | 2 +- 3 files changed, 98 insertions(+), 121 deletions(-) diff --git a/gazelle.sql b/gazelle.sql index 7a602756..97bfd924 100644 --- a/gazelle.sql +++ b/gazelle.sql @@ -525,7 +525,7 @@ CREATE TABLE `requests_artists` ( `RequestID` int(10) unsigned NOT NULL, `ArtistID` int(10) NOT NULL, `AliasID` int(10) NOT NULL, - `Importance` enum('1','2','3') NOT NULL DEFAULT '1', + `Importance` enum('1','2','3','4','5','6') DEFAULT NULL, PRIMARY KEY (`RequestID`,`AliasID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -841,7 +841,7 @@ CREATE TABLE `torrents_artists` ( `ArtistID` int(10) NOT NULL, `AliasID` int(10) NOT NULL, `UserID` int(10) unsigned NOT NULL DEFAULT '0', - `Importance` enum('1','2','3') NOT NULL, + `Importance` enum('1','2','3','4','5','6') DEFAULT NULL, PRIMARY KEY (`GroupID`,`AliasID`), KEY `ArtistID` (`ArtistID`), KEY `AliasID` (`AliasID`), diff --git a/sections/staffpm/viewconv.php b/sections/staffpm/viewconv.php index 291fe0fc..83c6c7a8 100644 --- a/sections/staffpm/viewconv.php +++ b/sections/staffpm/viewconv.php @@ -7,46 +7,49 @@ $DB->query("SELECT Subject, UserID, Level, AssignedToUser, Unread, Status FROM staff_pm_conversations WHERE ID=$ConvID"); list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status) = $DB->next_record(); - if ($UserID == $LoggedUser['ID'] || $IsStaff || ($Level == 0 && $IsFLS) || $LoggedUser['ID'] == $AssignedToUser) { - // User is trying to view their own unread conversation, set it to read - if ($UserID == $LoggedUser['ID'] && $Unread) { - $DB->query("UPDATE staff_pm_conversations SET Unread=false WHERE ID=$ConvID"); - // Clear cache for user - $Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']); - } + if ($UserID != $LoggedUser['ID'] && ($Level > $LoggedUser['Class']) && !($Level == 0 && $IsFLS) && $LoggedUser['ID'] != $AssignedToUser) { + // User is trying to view someone else's conversation + error(403); + } + // User is trying to view their own unread conversation, set it to read + if ($UserID == $LoggedUser['ID'] && $Unread) { + $DB->query("UPDATE staff_pm_conversations SET Unread=false WHERE ID=$ConvID"); + // Clear cache for user + $Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']); + } - show_header('Staff PM', 'staffpm,bbcode'); + show_header('Staff PM', 'staffpm,bbcode'); - $UserInfo = user_info($UserID); - $UserStr = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']); + $UserInfo = user_info($UserID); + $UserStr = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']); - $OwnerID = $UserID; + $OwnerID = $UserID; ?>

Staff PM -

query("SELECT UserID, SentDate, Message FROM staff_pm_messages WHERE ConvID=$ConvID"); + // Get messages + $StaffPMs = $DB->query("SELECT UserID, SentDate, Message FROM staff_pm_messages WHERE ConvID=$ConvID"); - while(list($UserID, $SentDate, $Message) = $DB->next_record()) { - // Set user string - if ($UserID == $OwnerID) { - // User, use prepared string - $UserString = $UserStr; - } else { - // Staff/FLS - $UserInfo = user_info($UserID); - $UserString = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']); + while(list($UserID, $SentDate, $Message) = $DB->next_record()) { + // Set user string + if ($UserID == $OwnerID) { + // User, use prepared string + $UserString = $UserStr; + } else { + // Staff/FLS + $UserInfo = user_info($UserID); + $UserString = format_username($UserID, $UserInfo['Username'], $UserInfo['Donor'], $UserInfo['Warned'], $UserInfo['Enabled'], $UserInfo['PermissionID']); - } + } ?>
@@ -82,11 +85,11 @@
set_query_id($StaffPMs); - } + $DB->set_query_id($StaffPMs); + } - // Common responses - if ($IsFLS && $Status != 'Resolved') { + // Common responses + if ($IsFLS && $Status != 'Resolved') { ?> - + // Ajax assign response div + if ($IsStaff) { ?> -

Reply

@@ -134,99 +132,82 @@
- + - + if ($IsFLS) { ?> - + - + - +
@@ -235,10 +216,6 @@ -
  • Seeding: [View] [Download]
  • +
  • Seeding: [View] [Download]
  • Seeding: