diff options
| author | the_systech <the_systech@users.sourceforge.net> | 2002-04-01 19:19:49 +0000 |
|---|---|---|
| committer | the_systech <the_systech@users.sourceforge.net> | 2002-04-01 19:19:49 +0000 |
| commit | 1ba7e42beac2bd2a6e47cc34d131825e3fced0fb (patch) | |
| tree | cfe3d44cca7ee7d6e12cdfb6e266b7aa025f88c4 | |
| parent | 985c0f8b6fbe07d2bb0604d6585956e50b72235b (diff) | |
| download | forums-1ba7e42beac2bd2a6e47cc34d131825e3fced0fb.tar forums-1ba7e42beac2bd2a6e47cc34d131825e3fced0fb.tar.gz forums-1ba7e42beac2bd2a6e47cc34d131825e3fced0fb.tar.bz2 forums-1ba7e42beac2bd2a6e47cc34d131825e3fced0fb.tar.xz forums-1ba7e42beac2bd2a6e47cc34d131825e3fced0fb.zip | |
Shorten the activation, key to allow for less than 77 characters..,yet still keep it as long as possible.
git-svn-id: file:///svn/phpbb/trunk@2459 89ea8834-ac86-4346-8a33-228a782c2dd0
| -rw-r--r-- | phpBB/includes/usercp_register.php | 8 | ||||
| -rw-r--r-- | phpBB/includes/usercp_sendpasswd.php | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/phpBB/includes/usercp_register.php b/phpBB/includes/usercp_register.php index 4c92af339b..13766c63ca 100644 --- a/phpBB/includes/usercp_register.php +++ b/phpBB/includes/usercp_register.php @@ -395,6 +395,9 @@ if ( isset($HTTP_POST_VARS['submit']) ) { $user_active = 0; $user_actkey = gen_rand_string(true); + $key_len = 54 - (strlen($server_url)); + $key_len = ($key_len > 6) ? $key_len : 6; + $user_actkey = substr($user_actkey, 0, $key_len); if ( $userdata['session_logged_in'] ) { @@ -489,6 +492,9 @@ if ( isset($HTTP_POST_VARS['submit']) ) if ( $board_config['require_activation'] == USER_ACTIVATION_SELF || $board_config['require_activation'] == USER_ACTIVATION_ADMIN || $coppa ) { $user_actkey = gen_rand_string(true); + $key_len = 54 - (strlen($server_url)); + $key_len = ( $key_len > 6 ) ? $key_len : 6; + $user_actkey = substr($user_actkey, 0, $key_len); $sql .= "0, '" . str_replace("\'", "''", $user_actkey) . "')"; } else @@ -922,4 +928,4 @@ $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?>
\ No newline at end of file +?> diff --git a/phpBB/includes/usercp_sendpasswd.php b/phpBB/includes/usercp_sendpasswd.php index 2ca37ffb6b..b060f75fcf 100644 --- a/phpBB/includes/usercp_sendpasswd.php +++ b/phpBB/includes/usercp_sendpasswd.php @@ -48,6 +48,9 @@ if ( isset($HTTP_POST_VARS['submit']) ) $username = $row['username']; $user_actkey = gen_rand_string(true); + $key_len = 54 - strlen($server_url); + $key_len = ( $str_len > 6 ) ? $key_len : 6; + $user_actkey = substr($user_actkey, 0, $key_len); $user_password = gen_rand_string(false); $sql = "UPDATE " . USERS_TABLE . " @@ -128,4 +131,4 @@ $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); -?>
\ No newline at end of file +?> |
