diff options
author | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-04-09 22:00:23 +0000 |
---|---|---|
committer | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2003-04-09 22:00:23 +0000 |
commit | 98d7c471337c3d54f5b8e09618afba5705846b64 (patch) | |
tree | eb3ea5960e0dbfb8e067bc4ee4a6cd7ff7ea768b /phpBB/report.php | |
parent | ddee09332d788bcffc9b4e31b23d1a31726a5e24 (diff) | |
download | forums-98d7c471337c3d54f5b8e09618afba5705846b64.tar forums-98d7c471337c3d54f5b8e09618afba5705846b64.tar.gz forums-98d7c471337c3d54f5b8e09618afba5705846b64.tar.bz2 forums-98d7c471337c3d54f5b8e09618afba5705846b64.tar.xz forums-98d7c471337c3d54f5b8e09618afba5705846b64.zip |
"Report" button only shows up if the user is authorised. Default forum_id for globals temporary (and arbitrary) set to 2.
git-svn-id: file:///svn/phpbb/trunk@3798 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/report.php')
-rw-r--r-- | phpBB/report.php | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/report.php b/phpBB/report.php index 937dfa78ff..e4c0feadf4 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -33,6 +33,7 @@ $auth->acl($user->data); // var definitions $post_id = (!empty($_REQUEST['p'])) ? intval($_REQUEST['p']) : 0; $reason_id = (!empty($_REQUEST['reason_id'])) ? intval($_REQUEST['reason_id']) : 0; +$notify = (!empty($_REQUEST['notify']) && $user->data['user_id'] != ANONYMOUS) ? TRUE : FALSE; $description = (!empty($_REQUEST['description'])) ? stripslashes($_REQUEST['description']) : ''; // Start output of page @@ -77,11 +78,18 @@ if (isset($_POST['cancel'])) // Has the report been confirmed? if (!empty($_POST['reason_id'])) { + $result = $db->sql_query('SELECT reason_name FROM ' . REASONS_TABLE . " WHERE reason_id = $reason_id"); + $row = $db->sql_fetchrow($result); + if (!$row || (!$description && $row['reason_name'] == 'other')) + { + trigger_error('EMPTY_REPORT'); + } + $sql_ary = array( 'reason_id' => (int) $reason_id, 'post_id' => (int) $post_id, 'user_id' => (int) $user->user_id, - 'user_notify' => (!empty($_POST['notify'])) ? 1 : 0, + 'user_notify' => (int) $notify, 'report_time' => (int) time(), 'report_text' => (string) $description ); @@ -98,9 +106,9 @@ if (!empty($_POST['reason_id'])) $db->sql_query('UPDATE ' . TOPICS_TABLE . ' SET topic_reported = 1 WHERE topic_id = ' . $topic_id); } - // TODO: warn moderators or something ;) + trigger_error($user->lang['POST_REPORTED_SUCCESS'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&p=$post_id#$post_id\">", '</a>')); - trigger_error($user->lang['POST_REPORTED'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], "<a href=\"viewtopic.$phpEx$SID&p=$post_id#$post_id\">", '</a>')); + // TODO: warn moderators or something ;) } // Generate the form @@ -135,6 +143,7 @@ while ($row = $db->sql_fetchrow($result)) )); } +$template->assign_var('S_CAN_NOTIFY', ($user->data['user_id'] == ANONYMOUS) ? FALSE : TRUE); $template->set_filenames(array( 'body' => 'report.html' )); |