diff options
author | Git <git@what.cd> | 2016-02-07 08:00:29 +0000 |
---|---|---|
committer | Git <git@what.cd> | 2016-02-07 08:00:29 +0000 |
commit | 58b07964b67323922f9ba96224abdc096faa703d (patch) | |
tree | bfe95eb5ca80a3bcb185b10a9e0136b7bb09a9e8 | |
parent | cbd522aa87ee3c4f82e078e55b0bffd4b9d8ce5d (diff) | |
download | Gazelle-58b07964b67323922f9ba96224abdc096faa703d.zip Gazelle-58b07964b67323922f9ba96224abdc096faa703d.tar.gz Gazelle-58b07964b67323922f9ba96224abdc096faa703d.tar.bz2 |
Empty commit
-rw-r--r-- | docs/CHANGES.txt | 3 | ||||
-rw-r--r-- | sections/staffpm/assign.php | 9 | ||||
-rw-r--r-- | sections/staffpm/takepost.php | 9 | ||||
-rw-r--r-- | sections/staffpm/viewconv.php | 5 |
4 files changed, 18 insertions, 8 deletions
diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 24579ec..7eb3403 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,5 +1,8 @@ CHANGE LOG +2016-02-06 by newman +Fix some Staff PM bugs + 2016-02-05 by newman Add tool to mark multiple torrent groups/collages as FL/NL/Regular, optionally NLing torrents above a certain size. Add level cap to Staff PMs diff --git a/sections/staffpm/assign.php b/sections/staffpm/assign.php index ae24eff..2917845 100644 --- a/sections/staffpm/assign.php +++ b/sections/staffpm/assign.php @@ -10,7 +10,7 @@ if ($ConvID = (int)$_GET['convid']) { SELECT Level FROM staff_pm_conversations WHERE ID = $ConvID"); - list($Level) = $DB->next_record; + list($Level) = $DB->next_record(); if ($Level == 0) { // FLS conversation, assign to staff (moderator) @@ -49,9 +49,12 @@ if ($ConvID = (int)$_GET['convid']) { SELECT Level, AssignedToUser FROM staff_pm_conversations WHERE ID = $ConvID"); - list($Level, $AssignedToUser) = $DB->next_record; + list($Level, $AssignedToUser) = $DB->next_record(); + + $LevelCap = 1000; + - if ($LoggedUser['EffectiveClass'] >= $Level || $AssignedToUser == $LoggedUser['ID']) { + if ($LoggedUser['EffectiveClass'] >= min($Level, $LevelCap) || $AssignedToUser == $LoggedUser['ID']) { // Staff member is allowed to assign conversation, assign list($LevelType, $NewLevel) = explode('_', db_string($_POST['assign'])); diff --git a/sections/staffpm/takepost.php b/sections/staffpm/takepost.php index 1c5f70e..c580dc9 100644 --- a/sections/staffpm/takepost.php +++ b/sections/staffpm/takepost.php @@ -24,12 +24,15 @@ if ($Message = db_string($_POST['message'])) { } elseif ($ConvID = (int)$_POST['convid']) { // Check if conversation belongs to user $DB->query(" - SELECT UserID, AssignedToUser + SELECT UserID, AssignedToUser, Level FROM staff_pm_conversations WHERE ID = $ConvID"); - list($UserID, $AssignedToUser) = $DB->next_record(); + list($UserID, $AssignedToUser, $Level) = $DB->next_record(); - if ($UserID == $LoggedUser['ID'] || $IsFLS || $UserID == $AssignedToUser) { + $LevelCap = 1000; + + $Level = min($Level, $LevelCap); + if ($UserID == $LoggedUser['ID'] || ($IsFLS && $LoggedUser['EffectiveClass'] >= $Level) || $UserID == $AssignedToUser) { // Response to existing conversation $DB->query(" INSERT INTO staff_pm_messages diff --git a/sections/staffpm/viewconv.php b/sections/staffpm/viewconv.php index c7a7824..4b7b7d8 100644 --- a/sections/staffpm/viewconv.php +++ b/sections/staffpm/viewconv.php @@ -11,6 +11,7 @@ if ($ConvID = (int)$_GET['id']) { $LevelCap = 1000; + $PMLevel = $Level; $Level = min($Level, $LevelCap); if (!(($UserID == $LoggedUser['ID']) @@ -170,14 +171,14 @@ if ($ConvID = (int)$_GET['id']) { <select id="assign_to" name="assign"> <optgroup label="User classes"> <? // FLS "class" - $Selected = ((!$AssignedToUser && $Level == 0) ? ' selected="selected"' : ''); + $Selected = ((!$AssignedToUser && $PMLevel == 0) ? ' selected="selected"' : ''); ?> <option value="class_0"<?=$Selected?>>First Line Support</option> <? // Staff classes foreach ($ClassLevels as $Class) { // Create one <option> for each staff user class if ($Class['Level'] >= 650) { - $Selected = ((!$AssignedToUser && ($Level == $Class['Level'])) ? ' selected="selected"' : ''); + $Selected = ((!$AssignedToUser && ($PMLevel == $Class['Level'])) ? ' selected="selected"' : ''); ?> <option value="class_<?=$Class['Level']?>"<?=$Selected?>><?=$Class['Name']?></option> <? |