1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 23:55:26 +02:00

Merge branch 'ticket/bantu/9611' into develop-olympus

* ticket/bantu/9611:
  [ticket/9611] Make length of activation keys variable between 6 and 10.
This commit is contained in:
Josh Woody 2010-08-19 09:03:45 -05:00
commit 46d2d97a37
4 changed files with 4 additions and 14 deletions

View File

@ -319,10 +319,7 @@ class acp_users
$server_url = generate_board_url(); $server_url = generate_board_url();
$user_actkey = gen_rand_string(10); $user_actkey = gen_rand_string(mt_rand(6, 10));
$key_len = 54 - (strlen($server_url));
$key_len = ($key_len > 6) ? $key_len : 6;
$user_actkey = substr($user_actkey, 0, $key_len);
$email_template = ($user_row['user_type'] == USER_NORMAL) ? 'user_reactivate_account' : 'user_resend_inactive'; $email_template = ($user_row['user_type'] == USER_NORMAL) ? 'user_reactivate_account' : 'user_resend_inactive';
if ($user_row['user_type'] == USER_NORMAL) if ($user_row['user_type'] == USER_NORMAL)

View File

@ -141,10 +141,7 @@ class ucp_profile
$server_url = generate_board_url(); $server_url = generate_board_url();
$user_actkey = gen_rand_string(10); $user_actkey = gen_rand_string(mt_rand(6, 10));
$key_len = 54 - (strlen($server_url));
$key_len = ($key_len > 6) ? $key_len : 6;
$user_actkey = substr($user_actkey, 0, $key_len);
$messenger = new messenger(false); $messenger = new messenger(false);

View File

@ -286,11 +286,7 @@ class ucp_register
$config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_SELF ||
$config['require_activation'] == USER_ACTIVATION_ADMIN) && $config['email_enable']) $config['require_activation'] == USER_ACTIVATION_ADMIN) && $config['email_enable'])
{ {
$user_actkey = gen_rand_string(10); $user_actkey = gen_rand_string(mt_rand(6, 10));
$key_len = 54 - (strlen($server_url));
$key_len = ($key_len < 6) ? 6 : $key_len;
$user_actkey = substr($user_actkey, 0, $key_len);
$user_type = USER_INACTIVE; $user_type = USER_INACTIVE;
$user_inactive_reason = INACTIVE_REGISTER; $user_inactive_reason = INACTIVE_REGISTER;
$user_inactive_time = time(); $user_inactive_time = time();

View File

@ -82,7 +82,7 @@ class ucp_remind
$user_password = gen_rand_string(max(8, rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars']))); $user_password = gen_rand_string(max(8, rand((int) $config['min_pass_chars'], (int) $config['max_pass_chars'])));
// For the activation key a random length between 6 and 10 will do. // For the activation key a random length between 6 and 10 will do.
$user_actkey = gen_rand_string(rand(6, 10)); $user_actkey = gen_rand_string(mt_rand(6, 10));
$sql = 'UPDATE ' . USERS_TABLE . " $sql = 'UPDATE ' . USERS_TABLE . "
SET user_newpasswd = '" . $db->sql_escape(phpbb_hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "' SET user_newpasswd = '" . $db->sql_escape(phpbb_hash($user_password)) . "', user_actkey = '" . $db->sql_escape($user_actkey) . "'