Gazelle/sections/staffpm/resolve.php

29 lines
792 B
PHP
Raw Normal View History

2012-09-01 08:00:24 +00:00
<?
if ($ID = (int)($_GET['id'])) {
// Check if conversation belongs to user
2013-07-02 08:01:37 +00:00
$DB->query("
SELECT UserID, AssignedToUser
FROM staff_pm_conversations
WHERE ID = $ID");
2012-09-01 08:00:24 +00:00
list($UserID, $AssignedToUser) = $DB->next_record();
2013-02-22 08:00:24 +00:00
2012-09-01 08:00:24 +00:00
if ($UserID == $LoggedUser['ID'] || $IsFLS || $AssignedToUser == $LoggedUser['ID']) {
// Conversation belongs to user or user is staff, resolve it
2013-07-02 08:01:37 +00:00
$DB->query("
UPDATE staff_pm_conversations
SET Status = 'Resolved', ResolverID = ".$LoggedUser['ID']."
WHERE ID = $ID");
2012-09-01 08:00:24 +00:00
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
$Cache->delete_value('num_staff_pms_'.$LoggedUser['ID']);
header('Location: staffpm.php');
} else {
// Conversation does not belong to user
error(403);
}
} else {
2013-07-02 08:01:37 +00:00
// No ID
2012-09-01 08:00:24 +00:00
header('Location: staffpm.php');
}
?>