diff options
author | Jesse Morgan <jesse@jesterpm.net> | 2011-05-25 11:32:49 -0700 |
---|---|---|
committer | Jesse Morgan <jesse@jesterpm.net ; true> | 2011-05-25 11:32:49 -0700 |
commit | 0c72d673a9056c753503e6b2a8d4fbf3aba75a95 (patch) | |
tree | 94d9ef802da3f4fa0b3a00fd909a576fc63ed844 /htdocs/moderate/moderate.php | |
parent | a39f9512f0efd3ec3e0a31df656e25dd3f824f6d (diff) |
Moderation workflow is.. working
Diffstat (limited to 'htdocs/moderate/moderate.php')
-rw-r--r-- | htdocs/moderate/moderate.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/htdocs/moderate/moderate.php b/htdocs/moderate/moderate.php new file mode 100644 index 0000000..0d3a67d --- /dev/null +++ b/htdocs/moderate/moderate.php @@ -0,0 +1,45 @@ +<?php + +/* Foursquare Community Site + * + * Copyright (C) 2011 Foursquare Church. + * + * Developers: Jesse Morgan <jmorgan@foursquarestaff.com> + * + */ + +require_once('../src/base.inc.php'); + +if (!isset($_SESSION['currentUser'])) { + header('Location: ' . $CONFIG['urlroot'].'/moderate/login.php'); + exit(); +} + +// If we have a valid id. +if (isset($_GET['id']) and is_numeric($_GET['id'])) { + + // Get the post. + $post = Post::getById($_GET['id']); + + if ($post) { + // Accept or Reject. + if (isset($_GET['action'])) { + switch ($_GET['action']) { + case 'approve': + $post->approve(); + break; + + case 'reject': + $post->reject(); + break; + } + + $post->save(); + } + } +} + +// Redirect back to the moderation index. +header('Location: ' . $CONFIG['urlroot'] . '/moderate'); + +?> |