Code Duplication    Length = 9-9 lines in 2 locations

manager/includes/src/Core.php 1 location

@@ 3448-3456 (lines=9) @@
3445
        $userId = $this->getLoginUserType() == 'manager' ? $this->getLoginUserID() : -$this->getLoginUserID();
3446
3447
        // Get user IP
3448
        if ($cip = getenv("HTTP_CLIENT_IP")) {
3449
            $ip = $cip;
3450
        } elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
3451
            $ip = $cip;
3452
        } elseif ($cip = getenv("REMOTE_ADDR")) {
3453
            $ip = $cip;
3454
        } else {
3455
            $ip = "UNKNOWN";
3456
        }
3457
        $_SESSION['ip'] = $ip;
3458
3459
        $sql = sprintf('REPLACE INTO %s (internalKey, lasthit, ip, sid)

manager/processors/login.processor.php 1 location

@@ 82-90 (lines=9) @@
79
if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
80
	@session_destroy();
81
	session_unset();
82
	if($cip = getenv("HTTP_CLIENT_IP")) {
83
		$ip = $cip;
84
	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
85
		$ip = $cip;
86
	} elseif($cip = getenv("REMOTE_ADDR")) {
87
		$ip = $cip;
88
	} else {
89
		$ip = "UNKNOWN";
90
	}
91
	$log = new EvolutionCMS\Legacy\LogHandler();
92
	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
93
	jsAlert($_lang['login_processor_many_failed_logins']);