diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-18 16:27:35 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-18 16:27:35 +0000 |
commit | e264a62b731d29389ba0a4a3548070e259e373c0 (patch) | |
tree | 8b4c935deb992a577cedd8123a46b2fcaf128d6d /phpBB/posting.php | |
parent | 5f788b4d08838dec5e8168f2efd515859224a3a4 (diff) | |
download | forums-e264a62b731d29389ba0a4a3548070e259e373c0.tar forums-e264a62b731d29389ba0a4a3548070e259e373c0.tar.gz forums-e264a62b731d29389ba0a4a3548070e259e373c0.tar.bz2 forums-e264a62b731d29389ba0a4a3548070e259e373c0.tar.xz forums-e264a62b731d29389ba0a4a3548070e259e373c0.zip |
- a handful of mcp fixed, the most important one is the change for check_ids() - it is now supporting ids from more than one forum too, making it possible to use some mcp features as designed initially. We really need to get our moderator team testing the mcp extensively.
- fixed some other tiny glitches
- if a forum category with subforums get changed to a link type forum give options of what to do with the subforums (#5334)
- other bugfixes
git-svn-id: file:///svn/phpbb/trunk@6601 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r-- | phpBB/posting.php | 48 |
1 files changed, 27 insertions, 21 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php index 64f99c6a7c..72151470d4 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1117,7 +1117,7 @@ generate_forum_nav($post_data); // Build Forum Rules generate_forum_rules($post_data); -if ($config['enable_post_confirm'] && !$user->data['is_registered'] && ($mode == 'post' || $mode == 'reply' || $mode == 'quote')) +if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_captcha === false && ($mode == 'post' || $mode == 'reply' || $mode == 'quote')) { // Show confirm image $sql = 'DELETE FROM ' . CONFIRM_TABLE . " @@ -1126,32 +1126,38 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && ($mode == $db->sql_query($sql); // Generate code - if ($solved_captcha === false) - { - $code = gen_rand_string(mt_rand(5, 8)); - $confirm_id = md5(unique_id($user->ip)); - - $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( - 'confirm_id' => (string) $confirm_id, - 'session_id' => (string) $user->session_id, - 'confirm_type' => (int) CONFIRM_POST, - 'code' => (string) $code) - ); - $db->sql_query($sql); + $code = gen_rand_string(mt_rand(5, 8)); + $confirm_id = md5(unique_id($user->ip)); + + $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'confirm_id' => (string) $confirm_id, + 'session_id' => (string) $user->session_id, + 'confirm_type' => (int) CONFIRM_POST, + 'code' => (string) $code) + ); + $db->sql_query($sql); - $template->assign_vars(array( - 'S_CONFIRM_CODE' => true, - 'CONFIRM_ID' => $confirm_id, - 'CONFIRM_IMAGE' => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_POST) . '" alt="" title="" />', - 'L_POST_CONFIRM_EXPLAIN' => sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'), - )); - } + $template->assign_vars(array( + 'S_CONFIRM_CODE' => true, + 'CONFIRM_ID' => $confirm_id, + 'CONFIRM_IMAGE' => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_POST) . '" alt="" title="" />', + 'L_POST_CONFIRM_EXPLAIN' => sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'), + )); } $s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $post_data['topic_last_post_id'] . '" />' : ''; $s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . $current_time . '" />'; $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : ''; +// Add the confirm id/code pair to the hidden fields, else an error is displayed on next submit/preview +if ($solved_captcha !== false) +{ + $s_hidden_fields .= build_hidden_fields(array( + 'confirm_id' => request_var('confirm_id', ''), + 'confirm_code' => request_var('confirm_code', '')) + ); +} + $form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || @ini_get('file_uploads') == '0' || !$config['allow_attachments'] || !$auth->acl_get('u_attach') || !$auth->acl_get('f_attach', $forum_id)) ? '' : ' enctype="multipart/form-data"'; // Start assigning vars for main posting page ... @@ -1178,7 +1184,7 @@ $template->assign_vars(array( 'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'], 'EDIT_REASON' => $post_data['post_edit_reason'], 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"), - 'U_VIEWTOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id") : '', + 'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id") : '', 'U_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup"), 'UA_PROGRESS_BAR' => append_sid("{$phpbb_root_path}posting.$phpEx", "f=$forum_id&mode=popup", false), |