mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 03:48:53 +00:00
Fix blank error when not submitting any passwords during registration and alter error when no username is input
git-svn-id: file:///svn/phpbb/trunk@2387 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
78a87c5720
commit
c89f896c27
1 changed files with 17 additions and 59 deletions
|
@ -53,27 +53,11 @@ function show_coppa(&$coppa)
|
|||
|
||||
$template->pparse('body');
|
||||
|
||||
}
|
||||
|
||||
function parse_variables()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function process_data()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function show_profile_page()
|
||||
{
|
||||
|
||||
}
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
$page_title = ( $mode == 'editprofile' ) ? $lang['Edit_profile'] : $lang['Register'];
|
||||
|
||||
if ( $mode == 'register' && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )
|
||||
|
@ -89,7 +73,6 @@ if ( $mode == 'register' && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GE
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$coppa = ( ( !$HTTP_POST_VARS['coppa'] && !$HTTP_GET_VARS['coppa'] ) || $mode == 'register' ) ? 0 : TRUE;
|
||||
|
||||
if ( isset($HTTP_POST_VARS['submit']) || isset($HTTP_POST_VARS['avatargallery']) || isset($HTTP_POST_VARS['submitavatar']) || isset($HTTP_POST_VARS['cancelavatar']) || $mode == 'register' )
|
||||
|
@ -126,7 +109,7 @@ if ( isset($HTTP_POST_VARS['submit']) || isset($HTTP_POST_VARS['avatargallery'])
|
|||
|
||||
$username = str_replace(' ', '', $username);
|
||||
$email = htmlspecialchars($email);
|
||||
$signature = str_replace('<br />', '\n', $signature);
|
||||
$signature = str_replace('<br />', "\n", $signature);
|
||||
|
||||
// Run some validation on the optional fields. These are pass-by-ref, so they'll be changed to
|
||||
// empty strings if they fail.
|
||||
|
@ -202,17 +185,6 @@ if ( isset($HTTP_POST_VARS['submit']) || isset($HTTP_POST_VARS['avatargallery'])
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ( isset($HTTP_POST_VARS['submit']) )
|
||||
{
|
||||
include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);
|
||||
|
@ -281,7 +253,12 @@ if ( isset($HTTP_POST_VARS['submit']) )
|
|||
}
|
||||
}
|
||||
}
|
||||
else if ( ( $password && !$password_confirm ) || ( !$password && $password_confirm ) )
|
||||
else if ( empty($password) && empty($password_confirm) )
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch'];
|
||||
|
@ -326,7 +303,12 @@ if ( isset($HTTP_POST_VARS['submit']) )
|
|||
$username_sql = '';
|
||||
if ( $board_config['allow_namechange'] || $mode == 'register' )
|
||||
{
|
||||
if ( $username != $userdata['username'] || $mode == 'register' )
|
||||
if ( empty($username) )
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Username_disallowed'];
|
||||
}
|
||||
else if ( $username != $userdata['username'] || $mode == 'register' )
|
||||
{
|
||||
$result = validate_username($username);
|
||||
if ( $result['error'] )
|
||||
|
@ -409,9 +391,6 @@ if ( isset($HTTP_POST_VARS['submit']) )
|
|||
$user_active = 0;
|
||||
$user_actkey = gen_rand_string(true);
|
||||
|
||||
//
|
||||
// The user is inactive, remove their session forcing them to login again before they can post.
|
||||
//
|
||||
if ( $userdata['session_logged_in'] )
|
||||
{
|
||||
session_end($userdata['session_id'], $userdata['user_id']);
|
||||
|
@ -626,15 +605,6 @@ if ( isset($HTTP_POST_VARS['submit']) )
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ( $error )
|
||||
{
|
||||
//
|
||||
|
@ -699,21 +669,9 @@ else if ( $mode == 'editprofile' && !isset($HTTP_POST_VARS['avatargallery']) &&
|
|||
$user_dateformat = $userdata['user_dateformat'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Default pages
|
||||
//
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
|
@ -971,4 +929,4 @@ $template->pparse('body');
|
|||
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
||||
?>
|
Loading…
Add table
Reference in a new issue