phpBB

Code Changes

File: includes/ucp/ucp_resend.php

  Unmodified   Added   Modified   Removed
Line 45Line 45
				trigger_error('FORM_INVALID');
}


				trigger_error('FORM_INVALID');
}


			$sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason

			$sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_actkey_expiration, user_inactive_reason

				FROM ' . USERS_TABLE . "
WHERE user_email = '" . $db->sql_escape($email) . "'
AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";

				FROM ' . USERS_TABLE . "
WHERE user_email = '" . $db->sql_escape($email) . "'
AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";

Line 71Line 71
			if (!$user_row['user_actkey'] || ($user_row['user_type'] == USER_INACTIVE && $user_row['user_inactive_reason'] == INACTIVE_MANUAL))
{
trigger_error('ACCOUNT_DEACTIVATED');

			if (!$user_row['user_actkey'] || ($user_row['user_type'] == USER_INACTIVE && $user_row['user_inactive_reason'] == INACTIVE_MANUAL))
{
trigger_error('ACCOUNT_DEACTIVATED');

 
			}

// Do not resend activation email if valid one still exists
if (!empty($user_row['user_actkey']) && (int) $user_row['user_actkey_expiration'] >= time())
{
trigger_error('ACTIVATION_ALREADY_SENT');

			}

// Determine coppa status on group (REGISTERED(_COPPA))

			}

// Determine coppa status on group (REGISTERED(_COPPA))

Line 99Line 105
				$messenger->anti_abuse_headers($config, $user);

$messenger->assign_vars(array(

				$messenger->anti_abuse_headers($config, $user);

$messenger->assign_vars(array(

					'WELCOME_MSG'	=> htmlspecialchars_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => htmlspecialchars_decode($user_row['username'], ENT_COMPAT),

					'WELCOME_MSG'	=> html_entity_decode(sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']), ENT_COMPAT),
'USERNAME' => html_entity_decode($user_row['username'], ENT_COMPAT),

					'U_ACTIVATE'	=> generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);


					'U_ACTIVATE'	=> generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);


Line 134Line 140
					$messenger->anti_abuse_headers($config, $user);

$messenger->assign_vars(array(

					$messenger->anti_abuse_headers($config, $user);

$messenger->assign_vars(array(

						'USERNAME'			=> htmlspecialchars_decode($user_row['username'], ENT_COMPAT),

						'USERNAME'			=> html_entity_decode($user_row['username'], ENT_COMPAT),

						'U_USER_DETAILS'	=> generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$user_row['user_id']}",
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);

						'U_USER_DETAILS'	=> generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$user_row['user_id']}",
'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}")
);

Line 143Line 149
				}
$db->sql_freeresult($result);
}

				}
$db->sql_freeresult($result);
}

 

$this->update_activation_expiration();


meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));



meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));


Line 159Line 167

$this->tpl_name = 'ucp_resend';
$this->page_title = 'UCP_RESEND';


$this->tpl_name = 'ucp_resend';
$this->page_title = 'UCP_RESEND';

 
	}

/**
* Update activation expiration to 1 day from now
*
* @return void
*/
protected function update_activation_expiration(): void
{
global $db, $user;

$sql_ary = [
'user_actkey_expiration' => $user::get_token_expiration(),
];

$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user->id();
$db->sql_query($sql);

	}
}


	}
}