diff --git a/sections/staff/index.php b/sections/staff/index.php
index 6b351bb8..782dd04b 100644
--- a/sections/staff/index.php
+++ b/sections/staff/index.php
@@ -3,6 +3,7 @@
show_header('Staff');
include(SERVER_ROOT.'/sections/staff/functions.php');
+include(SERVER_ROOT.'/sections/staffpm/functions.php');
$SupportStaff = get_support();
list($FrontLineSupport, $ForumStaff, $Staff) = $SupportStaff;
@@ -13,32 +14,12 @@
Contact Staff
-
-
-
+ print_compose_staff_pm(true); ?>
+
First-line Support
These users are not official staff members - they're users who have volunteered their time to help people in need. Please treat them with respect and read this before contacting them.
diff --git a/sections/staffpm/assign.php b/sections/staffpm/assign.php
index efa7f662..7ce8ea4f 100644
--- a/sections/staffpm/assign.php
+++ b/sections/staffpm/assign.php
@@ -11,10 +11,25 @@
if ($Level == 0) {
// FLS conversation, assign to staff (moderator)
- $DB->query("UPDATE staff_pm_conversations SET Level=650 WHERE ID=$ConvID");
-
- header('Location: staffpm.php');
-
+ if(!empty($_GET['to'])) {
+ $Level = 0;
+ switch($_GET['to']) {
+ case 'forum' :
+ $Level = 650;
+ break;
+ case 'staff' :
+ $Level = 700;
+ break;
+ default :
+ error(404);
+ break;
+ }
+
+ $DB->query("UPDATE staff_pm_conversations SET Level=".$Level." WHERE ID=$ConvID");
+ header('Location: staffpm.php');
+ } else {
+ error(404);
+ }
} else {
// FLS trying to assign non-FLS conversation
error(403);
diff --git a/sections/staffpm/functions.php b/sections/staffpm/functions.php
new file mode 100644
index 00000000..f233d6c7
--- /dev/null
+++ b/sections/staffpm/functions.php
@@ -0,0 +1,25 @@
+
+function print_compose_staff_pm($Hidden = true) { ?>
+
+
+
+ Subject
+
+
+
+ Message
+
+
+
+ Send to:
+
+ First Line Support
+ Forum Moderators
+ Staff
+
+
+
+
+
+
+ } ?>
diff --git a/sections/staffpm/unresolve.php b/sections/staffpm/unresolve.php
index 070467d5..350a2a70 100644
--- a/sections/staffpm/unresolve.php
+++ b/sections/staffpm/unresolve.php
@@ -1,10 +1,14 @@
if ($ID = (int)($_GET['id'])) {
// Check if conversation belongs to user
- $DB->query("SELECT UserID, AssignedToUser FROM staff_pm_conversations WHERE ID=$ID");
- list($UserID, $AssignedToUser) = $DB->next_record();
+ $DB->query("SELECT UserID, Level, AssignedToUser FROM staff_pm_conversations WHERE ID=$ID");
+ list($UserID, $Level, $AssignedToUser) = $DB->next_record();
- if ($UserID == $LoggedUser['ID'] || $IsStaff || $AssignedToUser == $LoggedUser['ID']) {
+ if ($UserID == $LoggedUser['ID'] || $IsFLS || $AssignedToUser == $LoggedUser['ID']) {
+ if($Level != 0 && $IsStaff == false) {
+ error(403);
+ }
+
// Conversation belongs to user or user is staff, unresolve it
$DB->query("UPDATE staff_pm_conversations SET Status='Unanswered' WHERE ID=$ID");
// Clear cache for user
diff --git a/sections/staffpm/user_inbox.php b/sections/staffpm/user_inbox.php
index 6fcd4c08..56fa4edb 100644
--- a/sections/staffpm/user_inbox.php
+++ b/sections/staffpm/user_inbox.php
@@ -1,4 +1,7 @@
+
+include(SERVER_ROOT.'/sections/staffpm/functions.php');
+
show_header('Staff PMs', 'staffpm');
// Get messages
@@ -26,27 +29,7 @@
-
-
-
-
- Subject
-
-
-
- Message
-
-
-
- Send to:
-
- First Line Support
- Staff
-
-
-
-
-
+ print_compose_staff_pm(true); ?>
diff --git a/sections/staffpm/viewconv.php b/sections/staffpm/viewconv.php
index 82ee8276..b404e8b2 100644
--- a/sections/staffpm/viewconv.php
+++ b/sections/staffpm/viewconv.php
@@ -206,7 +206,8 @@
} elseif ($IsFLS) { // FLS assign button
?>
-
+
+
}