show admin label when host in ADMIN_REMOTE_ADDRESS_WHITELIST

This commit is contained in:
ghost 2023-09-09 01:09:07 +03:00
parent 01eeb1b347
commit 15d57568dd
3 changed files with 11 additions and 0 deletions

View File

@ -2,6 +2,7 @@
// Load dependencies
require_once (__DIR__ . '/../config/app.php');
require_once (__DIR__ . '/../library/access.php');
require_once (__DIR__ . '/../library/mysql.php');
require_once (__DIR__ . '/../../vendor/autoload.php');
@ -181,6 +182,9 @@ $peers = $memory->getByMethodCallback(
<div class="container">
<div class="row">
<a class="logo" href="<?php echo WEBSITE_URL ?>"><?php echo str_replace('YGG', '<span>YGG</span>', WEBSITE_NAME) ?></a>
<?php if (Access::address(ADMIN_REMOTE_ADDRESS_WHITELIST)) { ?>
<sup class="label label-green font-size-12 font-width-normal cursor-default"><?php echo _('admin') ?></sup>
<?php } ?>
<form name="search" method="get" action="<?php echo WEBSITE_URL ?>/search.php">
<input type="text" name="query" value="" placeholder="<?php echo _('this, address, ip, geo, port, keyword...') ?>" />
<button type="submit"><?php echo _('search') ?></button>

View File

@ -213,6 +213,9 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId);
<div class="container">
<div class="row">
<a class="logo" href="<?php echo WEBSITE_URL ?>"><?php echo str_replace('YGG', '<span>YGG</span>', WEBSITE_NAME) ?></a>
<?php if (Access::address(ADMIN_REMOTE_ADDRESS_WHITELIST)) { ?>
<sup class="label label-green font-size-12 font-width-normal cursor-default"><?php echo _('admin') ?></sup>
<?php } ?>
<form name="search" method="get" action="<?php echo WEBSITE_URL ?>/search.php">
<input type="text" name="query" value="" placeholder="<?php echo _('this, address, ip, geo, port, keyword...') ?>" />
<button type="submit"><?php echo _('search') ?></button>

View File

@ -1,6 +1,7 @@
<?php
require_once (__DIR__ . '/../config/app.php');
require_once (__DIR__ . '/../library/access.php');
require_once (__DIR__ . '/../library/mysql.php');
require_once(__DIR__ . '/../library/sphinxql.php');
require_once __DIR__ . '/../../vendor/autoload.php';
@ -84,6 +85,9 @@ $results = $sphinx->searchPeers($requestQuery,
<div class="container">
<div class="row">
<a class="logo" href="<?php echo WEBSITE_URL ?>"><?php echo str_replace('YGG', '<span>YGG</span>', WEBSITE_NAME) ?></a>
<?php if (Access::address(ADMIN_REMOTE_ADDRESS_WHITELIST)) { ?>
<sup class="label label-green font-size-12 font-width-normal cursor-default"><?php echo _('admin') ?></sup>
<?php } ?>
<form name="search" method="get" action="<?php echo WEBSITE_URL ?>/search.php">
<input type="text" name="query" value="<?php echo !empty($_SERVER['REMOTE_ADDR']) && $requestQuery == $_SERVER['REMOTE_ADDR'] ? 'this' : htmlentities($requestQuery) ?>" placeholder="<?php echo _('this, address, ip, geo, port, keyword...') ?>" />
<button type="submit"><?php echo _('search') ?></button>