From: Henry S. <kel...@ph...> - 2009-07-27 11:39:48
|
Author: Kellanved Date: Mon Jul 27 12:39:28 2009 New Revision: 9869 Log: Minor captcha API change - disable display of plugin by returning false in get_template. Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/captcha_abstract.php branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php branches/phpBB-3_0_0/phpBB/includes/functions.php branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_register.php branches/phpBB-3_0_0/phpBB/styles/prosilver/template/login_body.html branches/phpBB-3_0_0/phpBB/styles/prosilver/template/posting_editor.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/login_body.html branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/posting_body.html Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/captcha_abstract.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/captcha_abstract.php (original) --- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/captcha_abstract.php Mon Jul 27 12:39:28 2009 *************** *** 87,107 **** { global $config, $user, $template, $phpEx, $phpbb_root_path; ! $link = append_sid($phpbb_root_path . 'ucp.' . $phpEx . '?mode=confirm&confirm_id=' . $this->confirm_id . '&type=' . $this->type); ! $explain = ($this->type != CONFIRM_POST) ? sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>') : $user->lang['POST_CONFIRM_EXPLAIN']; ! ! $template->assign_vars(array( ! 'CONFIRM_IMAGE_LINK' => $link, ! 'CONFIRM_IMAGE' => '<img src="'. $link . '" />', ! 'CONFIRM_IMG' => '<img src="'. $link . '" />', ! 'CONFIRM_ID' => $this->confirm_id, ! 'S_CONFIRM_CODE' => true, ! 'S_TYPE' => $this->type, ! 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false, ! 'L_CONFIRM_EXPLAIN' => $explain, ! )); ! return 'captcha_default.html'; } function get_demo_template($id) --- 87,114 ---- { global $config, $user, $template, $phpEx, $phpbb_root_path; ! if ($this->is_solved()) ! { ! return false; ! } ! else ! { ! $link = append_sid($phpbb_root_path . 'ucp.' . $phpEx . '?mode=confirm&confirm_id=' . $this->confirm_id . '&type=' . $this->type); ! $explain = ($this->type != CONFIRM_POST) ? sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>') : $user->lang['POST_CONFIRM_EXPLAIN']; ! ! $template->assign_vars(array( ! 'CONFIRM_IMAGE_LINK' => $link, ! 'CONFIRM_IMAGE' => '<img src="'. $link . '" />', ! 'CONFIRM_IMG' => '<img src="'. $link . '" />', ! 'CONFIRM_ID' => $this->confirm_id, ! 'S_CONFIRM_CODE' => true, ! 'S_TYPE' => $this->type, ! 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh'] && $this->type == CONFIRM_REG) ? true : false, ! 'L_CONFIRM_EXPLAIN' => $explain, ! )); ! return 'captcha_default.html'; ! } } function get_demo_template($id) Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php (original) --- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_captcha_qa_plugin.php Mon Jul 27 12:39:28 2009 *************** *** 171,184 **** { global $template; ! $template->assign_vars(array( ! 'QA_CONFIRM_QUESTION' => $this->question_text, ! 'QA_CONFIRM_ID' => $this->confirm_id, ! 'S_CONFIRM_CODE' => true, ! 'S_TYPE' => $this->type, ! )); ! return 'captcha_qa.html'; } /** --- 171,191 ---- { global $template; ! if ($this->is_solved()) ! { ! return false; ! } ! else ! { ! $template->assign_vars(array( ! 'QA_CONFIRM_QUESTION' => $this->question_text, ! 'QA_CONFIRM_ID' => $this->confirm_id, ! 'S_CONFIRM_CODE' => true, ! 'S_TYPE' => $this->type, ! )); ! return 'captcha_qa.html'; ! } } /** Modified: branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php (original) --- branches/phpBB-3_0_0/phpBB/includes/captcha/plugins/phpbb_recaptcha_plugin.php Mon Jul 27 12:39:28 2009 *************** *** 128,143 **** { global $config, $user, $template; ! $template->assign_vars(array( ! 'RECAPTCHA_SERVER' => $this->recaptcha_server, ! 'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '', ! 'RECAPTCHA_ERRORGET' => '', ! 'S_RECAPTCHA_AVAILABLE' => $this->is_available(), ! 'S_CONFIRM_CODE' => true, ! 'S_TYPE' => $this->type, ! )); ! return 'captcha_recaptcha.html'; } function get_demo_template($id) --- 128,150 ---- { global $config, $user, $template; ! if ($this->is_solved()) ! { ! return false; ! } ! else ! { ! $template->assign_vars(array( ! 'RECAPTCHA_SERVER' => $this->recaptcha_server, ! 'RECAPTCHA_PUBKEY' => isset($config['recaptcha_pubkey']) ? $config['recaptcha_pubkey'] : '', ! 'RECAPTCHA_ERRORGET' => '', ! 'S_RECAPTCHA_AVAILABLE' => $this->is_available(), ! 'S_CONFIRM_CODE' => true, ! 'S_TYPE' => $this->type, ! )); ! return 'captcha_recaptcha.html'; ! } } function get_demo_template($id) Modified: branches/phpBB-3_0_0/phpBB/includes/functions.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/functions.php (original) --- branches/phpBB-3_0_0/phpBB/includes/functions.php Mon Jul 27 12:39:28 2009 *************** *** 2752,2758 **** $captcha->reset(); $template->assign_vars(array( - 'S_CONFIRM_CODE' => true, 'CAPTCHA_TEMPLATE' => $captcha->get_template(), )); --- 2752,2757 ---- Modified: branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_register.php ============================================================================== *** branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_register.php (original) --- branches/phpBB-3_0_0/phpBB/includes/ucp/ucp_register.php Mon Jul 27 12:39:28 2009 *************** *** 446,455 **** $confirm_image = ''; // Visual Confirmation - Show images ! if ($config['enable_confirm'] && !$captcha->is_solved()) { $template->assign_vars(array( - 'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'), 'CAPTCHA_TEMPLATE' => $captcha->get_template(), )); } --- 446,454 ---- $confirm_image = ''; // Visual Confirmation - Show images ! if ($config['enable_confirm']) { $template->assign_vars(array( 'CAPTCHA_TEMPLATE' => $captcha->get_template(), )); } Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/login_body.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/login_body.html (original) --- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/login_body.html Mon Jul 27 12:39:28 2009 *************** *** 21,27 **** <!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF --> <!-- ENDIF --> </dl> ! <!-- IF CAPTCHA_TEMPLATE --> <!-- INCLUDE {CAPTCHA_TEMPLATE} --> <!-- ENDIF --> <!-- IF S_DISPLAY_FULL_LOGIN --> --- 21,27 ---- <!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF --> <!-- ENDIF --> </dl> ! <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE --> <!-- INCLUDE {CAPTCHA_TEMPLATE} --> <!-- ENDIF --> <!-- IF S_DISPLAY_FULL_LOGIN --> Modified: branches/phpBB-3_0_0/phpBB/styles/prosilver/template/posting_editor.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/prosilver/template/posting_editor.html (original) --- branches/phpBB-3_0_0/phpBB/styles/prosilver/template/posting_editor.html Mon Jul 27 12:39:28 2009 *************** *** 99,105 **** <dt><label for="subject">{L_SUBJECT}:</label></dt> <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd> </dl> ! <!-- IF S_CONFIRM_CODE --> <!-- INCLUDE {CAPTCHA_TEMPLATE} --> <!-- ENDIF --> <!-- ENDIF --> --- 99,105 ---- <dt><label for="subject">{L_SUBJECT}:</label></dt> <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd> </dl> ! <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE --> <!-- INCLUDE {CAPTCHA_TEMPLATE} --> <!-- ENDIF --> <!-- ENDIF --> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/login_body.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/login_body.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/login_body.html Mon Jul 27 12:39:28 2009 *************** *** 65,71 **** </td> </tr> ! <!-- IF S_CONFIRM_CODE --> </table> <table class="tablebg" width="100%" cellspacing="1"> --- 65,71 ---- </td> </tr> ! <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE --> </table> <table class="tablebg" width="100%" cellspacing="1"> Modified: branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/posting_body.html ============================================================================== *** branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/posting_body.html (original) --- branches/phpBB-3_0_0/phpBB/styles/subsilver2/template/posting_body.html Mon Jul 27 12:39:28 2009 *************** *** 332,338 **** </tr> <!-- ENDIF --> ! <!-- IF S_CONFIRM_CODE --> <!-- INCLUDE {CAPTCHA_TEMPLATE} --> <!-- ENDIF --> --- 332,338 ---- </tr> <!-- ENDIF --> ! <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE --> <!-- INCLUDE {CAPTCHA_TEMPLATE} --> <!-- ENDIF --> |