Skip to content

Commit

Permalink
Merge pull request #318 from dotkernel/issue-316
Browse files Browse the repository at this point in the history
Issue #316: Obfuscate admin login IP address
  • Loading branch information
arhimede authored Dec 11, 2024
2 parents 3d258f9 + e436348 commit 3fb353d
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/Admin/src/Service/AdminService.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,17 +200,12 @@ public function logAdminVisit(array $serverParams, string $name, string $status)

$ipAddress = IpService::getUserIp($serverParams);

$country = ! empty($this->locationService->getCountry($ipAddress)->getName()) ?
$this->locationService->getCountry($ipAddress)->getName() : '';

$continent = ! empty($this->locationService->getContinent($ipAddress)->getName()) ?
$this->locationService->getContinent($ipAddress)->getName() : '';

$organization = ! empty($this->locationService->getOrganization($ipAddress)->getName()) ?
$this->locationService->getOrganization($ipAddress)->getName() : '';
$country = $this->locationService->getCountry($ipAddress)->getName();
$continent = $this->locationService->getContinent($ipAddress)->getName();
$organization = $this->locationService->getOrganization($ipAddress)->getName();

$adminLogin = (new AdminLogin())
->setAdminIp($ipAddress)
->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress))
->setContinent($continent)
->setCountry($country)
->setOrganization($organization)
Expand Down

0 comments on commit 3fb353d

Please sign in to comment.