Gazelle/sections/staffpm/ajax_get_response.php

40 lines
745 B
PHP
Raw Normal View History

2012-05-03 08:00:25 +00:00
<?
enforce_login();
// Get user level
$DB->query("
SELECT
i.SupportFor,
p.DisplayStaff
2013-11-17 08:00:47 +00:00
FROM users_info AS i
JOIN users_main AS m ON m.ID = i.UserID
JOIN permissions AS p ON p.ID = m.PermissionID
2012-05-03 08:00:25 +00:00
WHERE i.UserID = ".$LoggedUser['ID']
);
list($SupportFor, $DisplayStaff) = $DB->next_record();
if (!$IsFLS) {
// Logged in user is not FLS or Staff
error(403);
}
if ($ID = (int)$_GET['id']) {
2013-07-02 08:01:37 +00:00
$DB->query("
SELECT Message
FROM staff_pm_responses
WHERE ID = $ID");
2012-05-03 08:00:25 +00:00
list($Message) = $DB->next_record();
if ($_GET['plain'] == 1) {
echo $Message;
} else {
2013-05-27 08:00:58 +00:00
include(SERVER_ROOT.'/classes/text.class.php'); // Text formatting class
2012-05-03 08:00:25 +00:00
$Text = new TEXT;
echo $Text->full_format($Message);
}
2013-02-22 08:00:24 +00:00
2012-05-03 08:00:25 +00:00
} else {
2013-07-02 08:01:37 +00:00
// No ID
2012-05-03 08:00:25 +00:00
echo '-1';
}
?>