From 69f5523111de7e885e4f7bdcc1de746bff5b1223 Mon Sep 17 00:00:00 2001 From: Git Date: Thu, 18 Feb 2016 08:00:30 +0000 Subject: [PATCH] Empty commit --- docs/CHANGES.txt | 3 +++ sections/staffpm/staff_inbox.php | 8 +++++++ sections/user/linkedfunctions.php | 39 +++++++++++++++++++------------ sections/user/manage_linked.php | 4 ++-- 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 41704f10..c3acf7dd 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -1,5 +1,8 @@ CHANGE LOG +2016-02-18 by newman +Fix staff seeing FLS-assigned staff PMs. Add checkbox to allow adding a linked account or editing a linked account without updating staff notes + 2016-02-13 by lawnmower minor usability improvement to artist alias editing diff --git a/sections/staffpm/staff_inbox.php b/sections/staffpm/staff_inbox.php index 479086f6..f33fe5d1 100644 --- a/sections/staffpm/staff_inbox.php +++ b/sections/staffpm/staff_inbox.php @@ -45,6 +45,14 @@ WHERE (LEAST($LevelCap, spc.Level) <= $UserLevel OR spc.AssignedToUser = '".$LoggedUser['ID']."') AND spc.Status IN ('$Status')"; +if ($ViewString == 'Your Unanswered') { + if ($UserLevel >= $Classes[MOD]['Level']) { + $WhereCondition .= " AND spc.Level >= " . $Classes[MOD]['Level']; + } else if ($UserLevel == $Classes[FORUM_MOD]['Level']) { + $WhereCondition .= " AND spc.Level >= " . $Classes[FORUM_MOD]['Level']; + } +} + list($Page, $Limit) = Format::page_limit(MESSAGES_PER_PAGE); // Get messages $StaffPMs = $DB->query(" diff --git a/sections/user/linkedfunctions.php b/sections/user/linkedfunctions.php index 976a89c1..22fa9cc2 100644 --- a/sections/user/linkedfunctions.php +++ b/sections/user/linkedfunctions.php @@ -1,5 +1,6 @@ query("INSERT INTO users_dupes (UserID, GroupID) VALUES ($UserID, $GroupID)"); } - $AdminComment = sqltime()." - Linked accounts updated: [user]".$UserInfo['Username']."[/user] and [user]".$TargetInfo['Username']."[/user] linked by ".$LoggedUser['Username']; - $DB->query(" - UPDATE users_info AS i - JOIN users_dupes AS d ON d.UserID = i.UserID - SET i.AdminComment = CONCAT('".db_string($AdminComment)."\n\n', i.AdminComment) - WHERE d.GroupID = $GroupID"); + if (!$IgnoreComments) { + $AdminComment = sqltime()." - Linked accounts updated: [user]".$UserInfo['Username']."[/user] and [user]".$TargetInfo['Username']."[/user] linked by ".$LoggedUser['Username']; + $DB->query(" + UPDATE users_info AS i + JOIN users_dupes AS d ON d.UserID = i.UserID + SET i.AdminComment = CONCAT('".db_string($AdminComment)."\n\n', i.AdminComment) + WHERE d.GroupID = $GroupID"); + } } function unlink_user($UserID) { @@ -122,7 +125,7 @@ function delete_dupegroup($GroupID) { $DB->query("DELETE FROM dupe_groups WHERE ID = '$GroupID'"); } -function dupe_comments($GroupID, $Comments) { +function dupe_comments($GroupID, $Comments, $IgnoreComments) { global $DB, $LoggedUser; authorize(); @@ -140,7 +143,9 @@ function dupe_comments($GroupID, $Comments) { WHERE ID = $GroupID"); list($OldCommentHash) = $DB->next_record(); if ($OldCommentHash != sha1($Comments)) { - $AdminComment = sqltime()." - Linked accounts updated: Comments updated by ".$LoggedUser['Username']; + if (!$IgnoreComments) { + $AdminComment = sqltime()." - Linked accounts updated: Comments updated by ".$LoggedUser['Username']; + } if ($_POST['form_comment_hash'] == $OldCommentHash) { $DB->query(" UPDATE dupe_groups @@ -153,11 +158,13 @@ function dupe_comments($GroupID, $Comments) { WHERE ID = '$GroupID'"); } - $DB->query(" - UPDATE users_info AS i - JOIN users_dupes AS d ON d.UserID = i.UserID - SET i.AdminComment = CONCAT('".db_string($AdminComment)."\n\n', i.AdminComment) - WHERE d.GroupID = $GroupID"); + if (!$IgnoreComments) { + $DB->query(" + UPDATE users_info AS i + JOIN users_dupes AS d ON d.UserID = i.UserID + SET i.AdminComment = CONCAT('".db_string($AdminComment)."\n\n', i.AdminComment) + WHERE d.GroupID = $GroupID"); + } } } @@ -241,7 +248,9 @@ function user_dupes_table($UserID) { diff --git a/sections/user/manage_linked.php b/sections/user/manage_linked.php index 47b30e3a..dddd13a6 100644 --- a/sections/user/manage_linked.php +++ b/sections/user/manage_linked.php @@ -21,7 +21,7 @@ FROM users_main WHERE Username LIKE '".db_string($Target)."'"); if (list($TargetID) = $DB->next_record()) { - link_users($UserID, $TargetID); + link_users($UserID, $TargetID, (isset($_REQUEST['ignore_comments'])) ? true : false); } else { error("User '$Target' not found."); } @@ -34,7 +34,7 @@ list($GroupID) = $DB->next_record(); if ($_REQUEST['dupecomments'] && $GroupID) { - dupe_comments($GroupID, $_REQUEST['dupecomments']); + dupe_comments($GroupID, $_REQUEST['dupecomments'], (isset($_REQUEST['ignore_comments'])) ? true : false); } break;