Minor captcha API change - disable display of plugin by returning false in get_template.

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9869 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof 2009-07-27 11:39:28 +00:00
parent 4066849b72
commit a0acfb6a3f
9 changed files with 56 additions and 37 deletions

View file

@ -87,6 +87,12 @@ class phpbb_default_captcha
{
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'];
@ -103,6 +109,7 @@ class phpbb_default_captcha
return 'captcha_default.html';
}
}
function get_demo_template($id)
{

View file

@ -171,6 +171,12 @@ class phpbb_captcha_qa
{
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,
@ -180,6 +186,7 @@ class phpbb_captcha_qa
return 'captcha_qa.html';
}
}
/**
* API function - we just display a mockup so that the captcha doesn't need to be installed

View file

@ -128,6 +128,12 @@ class phpbb_recaptcha extends phpbb_default_captcha
{
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'] : '',
@ -139,6 +145,7 @@ class phpbb_recaptcha extends phpbb_default_captcha
return 'captcha_recaptcha.html';
}
}
function get_demo_template($id)
{

View file

@ -2752,7 +2752,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$captcha->reset();
$template->assign_vars(array(
'S_CONFIRM_CODE' => true,
'CAPTCHA_TEMPLATE' => $captcha->get_template(),
));

View file

@ -446,10 +446,9 @@ class ucp_register
$confirm_image = '';
// Visual Confirmation - Show images
if ($config['enable_confirm'] && !$captcha->is_solved())
if ($config['enable_confirm'])
{
$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(),
));
}

View file

@ -21,7 +21,7 @@
<!-- IF U_RESEND_ACTIVATION --><dd><a href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a></dd><!-- ENDIF -->
<!-- ENDIF -->
</dl>
<!-- IF CAPTCHA_TEMPLATE -->
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_FULL_LOGIN -->

View file

@ -99,7 +99,7 @@
<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 -->
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->
<!-- ENDIF -->

View file

@ -65,7 +65,7 @@
</td>
</tr>
<!-- IF S_CONFIRM_CODE -->
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
</table>
<table class="tablebg" width="100%" cellspacing="1">

View file

@ -332,7 +332,7 @@
</tr>
<!-- ENDIF -->
<!-- IF S_CONFIRM_CODE -->
<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
<!-- INCLUDE {CAPTCHA_TEMPLATE} -->
<!-- ENDIF -->