Code Duplication    Length = 9-9 lines in 2 locations

core/src/Core.php 1 location

@@ 3266-3274 (lines=9) @@
3263
        $userId = $this->getLoginUserType() == 'manager' ? $this->getLoginUserID() : -$this->getLoginUserID();
3264
3265
        // Get user IP
3266
        if ($cip = getenv("HTTP_CLIENT_IP")) {
3267
            $ip = $cip;
3268
        } elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
3269
            $ip = $cip;
3270
        } elseif ($cip = getenv("REMOTE_ADDR")) {
3271
            $ip = $cip;
3272
        } else {
3273
            $ip = "UNKNOWN";
3274
        }
3275
        $_SESSION['ip'] = $ip;
3276
3277
        Models\ActiveUserSession::updateOrCreate([

manager/processors/login.processor.php 1 location

@@ 99-107 (lines=9) @@
96
if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
97
	@session_destroy();
98
	session_unset();
99
	if($cip = getenv("HTTP_CLIENT_IP")) {
100
		$ip = $cip;
101
	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
102
		$ip = $cip;
103
	} elseif($cip = getenv("REMOTE_ADDR")) {
104
		$ip = $cip;
105
	} else {
106
		$ip = "UNKNOWN";
107
	}
108
	$log = new EvolutionCMS\Legacy\LogHandler();
109
	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
110
	jsAlert($_lang['login_processor_many_failed_logins']);