summaryrefslogtreecommitdiff
path: root/htdocs/postings.php
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2011-05-25 11:32:49 -0700
committerJesse Morgan <jesse@jesterpm.net ; true>2011-05-25 11:32:49 -0700
commit0c72d673a9056c753503e6b2a8d4fbf3aba75a95 (patch)
tree94d9ef802da3f4fa0b3a00fd909a576fc63ed844 /htdocs/postings.php
parenta39f9512f0efd3ec3e0a31df656e25dd3f824f6d (diff)
Moderation workflow is.. working
Diffstat (limited to 'htdocs/postings.php')
-rw-r--r--htdocs/postings.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/htdocs/postings.php b/htdocs/postings.php
index e43f24e..5c3dd55 100644
--- a/htdocs/postings.php
+++ b/htdocs/postings.php
@@ -28,10 +28,24 @@ if (!is_numeric($id)) {
// Get the post.
$post = Post::getById($id);
-if (!$post or $post->getStage() != 'approved') {
+if (!$post or (!isset($_GET['moderate']) and $post->getStage() != 'approved')) {
errorNotFound();
}
+if (isset($_GET['moderate'])) {
+ if (!isset($_SESSION['currentUser'])) {
+ header('Location: ' . $CONFIG['urlroot'].'/moderate/login.php');
+ exit();
+ }
+ echo "<div class=\"moderationbox\">You are moderating this post: ";
+ printf("<a href=\"../moderate/moderate.php?id=%s&action=approve\">Approve</a> "
+ . "<a href=\"../moderate/moderate.php?id=%s&action=reject\">Reject</a>",
+ $post->getId(), $post->getId());
+ echo "<p><a href=\"../moderate/index.php\">Return to moderation</a></p>";
+ echo "</div>";
+
+}
+
// Display the post.
echo "<h2>". $post->getName() ."</h2>";