session_write_close();
require_once("common.php");
require_once("loggedinuser.php");
require_once("contenthandler.php");
require_once("languages.php");
require_once("acls.php");
session_start();
$loggedInUser = $_SESSION['LoggedInUser'];
if (!isset($loggedInUser) || ($loggedInUser == null)) {
die("Not logged in!");
}
//$accessLevel = $loggedInUser->getAccessLevel($lid);
//create table PendingQueue(PID int, UID int, LID int, timestamp timestamp, ipaddress char(20), path char(255), type int, data mediumblob);
if (!isset($_POST['viewPID']) && !isset($_POST['acceptPID']) &&
!isset($_POST['rejectPID'])) {
?>
Queue
} else if (isset($_POST['viewPID'])) {
$pid = $_POST['viewPID'];
if (!isVarGood($pid, false))
die("Form variables are invalid and/or incomplete!");
settype($pid, "integer");
$db = getDBConnection();
$result = mysql_query("SELECT username,realname,timestamp,data,ipaddress,path,type FROM PendingQueue,VerifiedUsers WHERE PID=" . $pid . " AND PendingQueue.UID=VerifiedUsers.UID", $db);
if (!$result)
die("Error while retrieving pending queue entry!");
$row = mysql_fetch_assoc($result);
$username = $row['username'];
$realname = $row['realname'];
$path = $row['path'];
$ipaddress = $row['ipaddress'];
$data = $row['data'];
$type = $row['type'];
$timestamp = $row['timestamp'];
mysql_close($db);
?>
View submission
} else if (isset($_POST['acceptPID']) && isset($_POST['rejectPID'])) {
$acceptPID = $_POST['acceptPID'];
$rejectPID = $_POST['rejectPID'];
if (!isVarGood($acceptPID, false) || !isVarGood($rejectPID, false))
die("Form variables invalid and/or incomplete!");
settype($acceptPID, "integer");
settype($rejectPID, "integer");
if ($acceptPID != -1) {
/*$title = $_POST['title'];
$data = $_POST['data'];
if (!isVarGood($title, false) || !isVarGood($data, false))
die("Form variables invalid and/or incomplete!");
$db = getDBConnection();
$result = mysql_query("SELECT LID,type FROM PendingQueue WHERE PID=" . $acceptPID, $db);
if (!$result) {
die();
}
$row = mysql_fetch_assoc($result);
$lid = $row['LID'];
$type = $row['type'];
mysql_close($db);
if ($type == ContentHandler::$QUEUE_ENTRY_NEW) {
$accessLevel = $loggedInUser->getAccessLevel($lid);
if ($accessLevel != ACLs::$ACL_ACCESS_ADMIN_HIGH)
die("Error: You have insufficient privileges to approve new submissions!");
}*/
if (ContentHandler::approveQueueEntry($acceptPID, $loggedInUser) ==
ContentHandler::$CONTENT_POSTED)
popup_and_redirect("Queue entry accepted.", "showqueue.php");
else
die("Error while processing entry!");
} else if ($rejectPID != -1) {
if (ContentHandler::rejectQueueEntry($rejectPID) ==
ContentHandler::$CONTENT_SUCCESS)
popup_and_redirect("Queue entry rejected.", "showqueue.php");
else
die("Error while processing entry!");
} else
die("Internal error!");
}
?>