mirror of
https://github.com/OPSnet/Gazelle.git
synced 2026-10-17 04:03:13 -04:00
19 lines
452 B
PHP
19 lines
452 B
PHP
<?php
|
|
|
|
if (!$Viewer->permitted('users_view_ips')) {
|
|
echo 'Forbidden';
|
|
exit;
|
|
}
|
|
|
|
if (isset($_SERVER['http_if_modified_since'])) {
|
|
header('Status: 304 Not Modified');
|
|
exit;
|
|
}
|
|
|
|
$hostname = gethostbyaddr(trim($_GET['ip'] ?? ''));
|
|
if ($hostname === false) {
|
|
header('Expires: ' . date('D, d-M-Y H:i:s \U\T\C', time() + 3600 * 24 * 120)); // 120 days
|
|
header('Last-Modified: ' . date('D, d-M-Y H:i:s \U\T\C', time()));
|
|
}
|
|
echo $hostname;
|