mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-10 13:28:55 +00:00
- Fix XHTML for r9666
- Utilize $captcha->solved property - Only validate captcha once to retain captcha mode over switching from/to agreement page git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9668 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
e8638ff0ef
commit
f9bbf10a80
4 changed files with 23 additions and 18 deletions
|
@ -2265,7 +2265,7 @@ function reapply_sid($url)
|
|||
{
|
||||
// All kind of links
|
||||
$url = preg_replace('/(\?)?(&|&)?sid=[a-z0-9]+/', '', $url);
|
||||
// if the sid was the first param, make the old second as first ones
|
||||
// if the sid was the first param, make the old second as first ones
|
||||
$url = preg_replace("/$phpEx(&|&)+?/", "$phpEx?", $url);
|
||||
}
|
||||
|
||||
|
@ -3844,6 +3844,8 @@ function page_header($page_title = '', $display_online_list = true)
|
|||
'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
|
||||
'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
|
||||
'U_TEAM' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'),
|
||||
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
|
||||
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
|
||||
'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '',
|
||||
'U_FEED' => generate_board_url() . "/feed.$phpEx",
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class ucp_register
|
|||
{
|
||||
add_form_key('ucp_register_terms');
|
||||
}
|
||||
|
||||
|
||||
if ($change_lang || $user_lang != $config['default_lang'])
|
||||
{
|
||||
$use_lang = ($change_lang) ? basename($change_lang) : basename($user_lang);
|
||||
|
@ -77,12 +77,18 @@ class ucp_register
|
|||
}
|
||||
}
|
||||
|
||||
$captcha_solved = false;
|
||||
$vc_response = false;
|
||||
if ($config['enable_confirm'])
|
||||
{
|
||||
include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
|
||||
$captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
|
||||
$captcha->init(CONFIRM_REG);
|
||||
|
||||
// If confirm id is submitted we check the status of the captcha here
|
||||
if (request_var('confirm_code', ''))
|
||||
{
|
||||
$vc_response = $captcha->validate();
|
||||
}
|
||||
}
|
||||
|
||||
$cp = new custom_profile();
|
||||
|
@ -117,10 +123,11 @@ class ucp_register
|
|||
}
|
||||
|
||||
// Checking amount of available languages
|
||||
$lang_row = array();
|
||||
$sql = 'SELECT lang_id
|
||||
$sql = 'SELECT lang_id
|
||||
FROM ' . LANG_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$lang_row = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$lang_row[] = $row;
|
||||
|
@ -223,16 +230,10 @@ class ucp_register
|
|||
|
||||
if ($config['enable_confirm'])
|
||||
{
|
||||
$vc_response = $captcha->validate();
|
||||
if ($vc_response)
|
||||
if (!$captcha->solved)
|
||||
{
|
||||
$error[] = $vc_response;
|
||||
}
|
||||
else
|
||||
{
|
||||
$captcha_solved = true;
|
||||
// $captcha->reset();
|
||||
}
|
||||
|
||||
if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts'])
|
||||
{
|
||||
|
@ -443,7 +444,7 @@ class ucp_register
|
|||
{
|
||||
$s_hidden_fields['coppa'] = $coppa;
|
||||
}
|
||||
|
||||
|
||||
if ($config['enable_confirm'])
|
||||
{
|
||||
$s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields());
|
||||
|
@ -452,7 +453,7 @@ class ucp_register
|
|||
$confirm_image = '';
|
||||
|
||||
// Visual Confirmation - Show images
|
||||
if ($config['enable_confirm'] && !$captcha_solved)
|
||||
if ($config['enable_confirm'] && !$captcha->solved)
|
||||
{
|
||||
$template->assign_vars(array(
|
||||
'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
<form method="post" action="{S_UCP_ACTION}" id="register">
|
||||
<p class="rightside">
|
||||
<label for="lang">{L_LANGUAGE}:</label><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select>
|
||||
{S_HIDDEN_FIELDS}
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
{S_HIDDEN_FIELDS}
|
||||
</form>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<!-- ENDIF -->
|
||||
|
||||
<form method="post" action="{S_UCP_ACTION}" id="agreement">
|
||||
|
|
|
@ -127,8 +127,8 @@ switch ($mode)
|
|||
'AGREEMENT_TITLE' => $user->lang[$title],
|
||||
'AGREEMENT_TEXT' => sprintf($user->lang[$message], $config['sitename'], generate_board_url()),
|
||||
'U_BACK' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
|
||||
'L_BACK' => $user->lang['BACK_TO_LOGIN'])
|
||||
);
|
||||
'L_BACK' => $user->lang['BACK_TO_LOGIN'],
|
||||
));
|
||||
|
||||
page_footer();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue