Code Duplication    Length = 2-2 lines in 7 locations

Sources/LogInOut.php 3 locations

@@ 86-87 (lines=2) @@
83
	global $cookiename, $modSettings, $context, $sourcedir, $maintenance;
84
85
	// Check to ensure we're forcing SSL for authentication
86
	if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'))
87
		fatal_lang_error('login_ssl_required');
88
89
	// Load cookie authentication stuff.
90
	require_once($sourcedir . '/Subs-Auth.php');
@@ 450-451 (lines=2) @@
447
	if (!empty($_POST['tfa_code']) && empty($_POST['tfa_backup']))
448
	{
449
		// Check to ensure we're forcing SSL for authentication
450
		if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'))
451
			fatal_lang_error('login_ssl_required');
452
453
		$code = $_POST['tfa_code'];
454
@@ 473-474 (lines=2) @@
470
	elseif (!empty($_POST['tfa_backup']))
471
	{
472
		// Check to ensure we're forcing SSL for authentication
473
		if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'))
474
			fatal_lang_error('login_ssl_required');
475
476
		$backup = $_POST['tfa_backup'];
477

Sources/Profile.php 1 location

@@ 599-600 (lines=2) @@
596
		if ($check_password)
597
		{
598
			// Check to ensure we're forcing SSL for authentication
599
			if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'))
600
				fatal_lang_error('login_ssl_required');
601
602
			// You didn't even enter a password!
603
			if (trim($_POST['oldpasswrd']) == '')

Sources/Register.php 1 location

@@ 219-220 (lines=2) @@
216
	validateToken('register');
217
218
	// Check to ensure we're forcing SSL for authentication
219
	if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'))
220
		fatal_lang_error('register_ssl_required');
221
222
	// Start collecting together any errors.
223
	$reg_errors = array();

Sources/Security.php 1 location

@@ 58-59 (lines=2) @@
55
	if (isset($_POST[$type . '_pass']))
56
	{
57
		// Check to ensure we're forcing SSL for authentication
58
		if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'))
59
			fatal_lang_error('login_ssl_required');
60
61
		checkSession();
62

Sources/Profile-Modify.php 1 location

@@ 4019-4020 (lines=2) @@
4016
	if (empty($user_settings['tfa_secret']) && $context['user']['is_owner'])
4017
	{
4018
		// Check to ensure we're forcing SSL for authentication
4019
		if (!empty($modSettings['force_ssl']) && empty($maintenance) && (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != 'on'))
4020
			fatal_lang_error('login_ssl_required');
4021
4022
		// In some cases (forced 2FA or backup code) they would be forced to be redirected here,
4023
		// we do not want too much AJAX to confuse them.