Skip to content

Commit fff849a

Browse files
committed
Issue #316: Obfuscate admin login IP address
Signed-off-by: alexmerlin <[email protected]>
1 parent e80a550 commit fff849a

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

src/Admin/src/Service/AdminService.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -200,17 +200,12 @@ public function logAdminVisit(array $serverParams, string $name, string $status)
200200

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

203-
$country = ! empty($this->locationService->getCountry($ipAddress)->getName()) ?
204-
$this->locationService->getCountry($ipAddress)->getName() : '';
205-
206-
$continent = ! empty($this->locationService->getContinent($ipAddress)->getName()) ?
207-
$this->locationService->getContinent($ipAddress)->getName() : '';
208-
209-
$organization = ! empty($this->locationService->getOrganization($ipAddress)->getName()) ?
210-
$this->locationService->getOrganization($ipAddress)->getName() : '';
203+
$country = $this->locationService->getCountry($ipAddress)->getName();
204+
$continent = $this->locationService->getContinent($ipAddress)->getName();
205+
$organization = $this->locationService->getOrganization($ipAddress)->getName();
211206

212207
$adminLogin = (new AdminLogin())
213-
->setAdminIp($ipAddress)
208+
->setAdminIp($this->locationService->obfuscateIpAddress($ipAddress))
214209
->setContinent($continent)
215210
->setCountry($country)
216211
->setOrganization($organization)

0 commit comments

Comments
 (0)