$PAGE->stripe_start(); $menu = $PAGE->admin_menu(); ////////////////////////////////////////////////////////////////////////////////// // Set up the variables and objects we'll need on this page. $report_id = get_http_var('rid'); $comment_id = get_http_var('cid'); if (!is_numeric($report_id) || !is_numeric($comment_id)) { // Exit. trigger_error("We need valid comment and report IDs.", E_USER_ERROR); } $COMMENT = new COMMENT($comment_id); if ($COMMENT->exists() == false) { // Exit. trigger_error("This is an invalid comment ID", E_USER_ERROR); } $REPORT = new COMMENTREPORT($report_id); $FORMURL = new URL($this_page); ////////////////////////////////////////////////////////////////////////////////// // Check that the user is allowed to take action, and this report isn't locked. if ($REPORT->locked() && $REPORT->lockedby() != $THEUSER->user_id()) { print "<p><strong>Someone else was examining this report at " . $REPORT->locked() . " so you can only look at it, not take any action. You could try again in a few minutes.</strong></p>\n"; $COMMENT->display(); $REPORT->display(); $PAGE->stripe_end(array(array('type' => 'html', 'content' => $menu))); $PAGE->page_end(); exit; } elseif ($THEUSER->is_able_to('deletecomment')) { // Prevent anyone else from editing this report. $REPORT->lock(); } //////////////////////////////////////////////////////////////////////////////////
if (preg_match('#http://|\\[url#', get_http_var('body'))) { $errors['body'] = 'Please do not give any web links in the report body.'; } if (!$THEUSER->isloggedin()) { if (get_http_var('firstname') == '' || get_http_var('lastname') == '') { $errors['name'] = "Please let us know who you are!"; } if (get_http_var('em') == '') { $errors['email'] = "Please enter your email address so we can contact you about this report."; } } if (count($errors) > 0) { display_form($COMMENT, $errors); } else { // Report this comment. $REPORT = new COMMENTREPORT(); $reportdata = array('body' => get_http_var('body'), 'firstname' => get_http_var('firstname'), 'lastname' => get_http_var('lastname'), 'email' => get_http_var('em')); $success = $REPORT->create($COMMENT, $reportdata); if ($success) { ?> <p><strong>The comment has been reported</strong> and a moderator will look into it as soon as possible. You should receive an email shortly confirming your report. Thanks for taking the time let us know about this.</p> <?php if (!$THEUSER->isloggedin()) { $LOGINURL = new URL('userlogin'); $JOINURL = new URL('userjoin'); ?> <p>By the way, if you <a href="<?php echo $LOGINURL->generate(); ?> ">log in</a> before you make a report in future, you won't have to enter your name and email address each time! (You'll need to <a href="<?php $JOINURL->generate();