Code Duplication    Length = 9-9 lines in 2 locations

manager/includes/src/Core.php 1 location

@@ 3703-3711 (lines=9) @@
3700
        $userId = $this->getLoginUserType() == 'manager' ? $this->getLoginUserID() : -$this->getLoginUserID();
3701
3702
        // Get user IP
3703
        if ($cip = getenv("HTTP_CLIENT_IP")) {
3704
            $ip = $cip;
3705
        } elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
3706
            $ip = $cip;
3707
        } elseif ($cip = getenv("REMOTE_ADDR")) {
3708
            $ip = $cip;
3709
        } else {
3710
            $ip = "UNKNOWN";
3711
        }
3712
        $_SESSION['ip'] = $ip;
3713
3714
        $sql = sprintf('REPLACE INTO %s (internalKey, lasthit, ip, sid)

manager/processors/login.processor.php 1 location

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