diff options
author | Henry Sudhof <kellanved@phpbb.com> | 2009-03-17 16:04:58 +0000 |
---|---|---|
committer | Henry Sudhof <kellanved@phpbb.com> | 2009-03-17 16:04:58 +0000 |
commit | 01078bb2fa8795e495e356a66676cb36dd3b0cd1 (patch) | |
tree | a43b1e6cedf96adb399982aa1e1cf76757cd680c /phpBB/includes/ucp/ucp_register.php | |
parent | 1e36ed1f741631be7c3c097b1a1cdd0db72baccb (diff) | |
download | forums-01078bb2fa8795e495e356a66676cb36dd3b0cd1.tar forums-01078bb2fa8795e495e356a66676cb36dd3b0cd1.tar.gz forums-01078bb2fa8795e495e356a66676cb36dd3b0cd1.tar.bz2 forums-01078bb2fa8795e495e356a66676cb36dd3b0cd1.tar.xz forums-01078bb2fa8795e495e356a66676cb36dd3b0cd1.zip |
captcha changes
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9390 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_register.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 315d24d47f..4ac5ae151b 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -37,12 +37,13 @@ class ucp_register include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); - $confirm_id = request_var('confirm_id', ''); - $coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false; - $agreed = (!empty($_POST['agreed'])) ? 1 : 0; - $submit = (isset($_POST['submit'])) ? true : false; - $change_lang = request_var('change_lang', ''); - $user_lang = request_var('lang', $user->lang_name); + $confirm_id = request_var('confirm_id', ''); + $confirm_refresh = (isset($_POST['confirm_refresh']) && $config['confirm_refresh']) ? ((!empty($_POST['confirm_refresh'])) ? 1 : 0) : false; + $coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false; + $agreed = (!empty($_POST['agreed'])) ? 1 : 0; + $submit = (isset($_POST['submit'])) ? true : false; + $change_lang = request_var('change_lang', ''); + $user_lang = request_var('lang', $user->lang_name); if ($agreed) { @@ -448,7 +449,7 @@ class ucp_register if ($config['enable_confirm']) { - if ($change_lang) + if ($change_lang || $confirm_refresh) { $str = '&change_lang=' . $change_lang; $sql = 'SELECT code @@ -467,7 +468,7 @@ class ucp_register { $str = ''; } - if (!$change_lang || !$confirm_id) + if (!$change_lang || !$confirm_id || !$confirm_refresh) { $user->confirm_gc(CONFIRM_REG); @@ -500,6 +501,24 @@ class ucp_register ); $db->sql_query($sql); } + else if ($confirm_refresh) + { + $code = gen_rand_string(mt_rand(5, 8)); + $confirm_id = md5(unique_id($user->ip)); + $seed = hexdec(substr(unique_id(), 4, 10)); + // compute $seed % 0x7fffffff + $seed -= 0x7fffffff * floor($seed / 0x7fffffff); + $sql = 'UPDATE ' . CONFIRM_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( + 'confirm_type' => (int) CONFIRM_REG, + 'code' => (string) $code, + 'seed' => (int) $seed) . " + WHERE + confirm_id = '" . $db->sql_escape($confirm_id) . "' AND + session_id = '" . $db->sql_escape($session_id) . "' AND + confirm_type = " . (int) CONFIRM_REG + ); + $db->sql_query($sql); + } $confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_REG . $str) . '" alt="" title="" />'; $s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />'; } @@ -534,6 +553,7 @@ class ucp_register 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_TZ_OPTIONS' => tz_select($data['tz']), 'S_CONFIRM_CODE' => ($config['enable_confirm']) ? true : false, + 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false, 'S_COPPA' => $coppa, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), |