Browse Source

show admin label when host in ADMIN_REMOTE_ADDRESS_WHITELIST

yggdrasil-0.4.7
ghost 1 year ago
parent
commit
15d57568dd
  1. 4
      src/public/index.php
  2. 3
      src/public/peer.php
  3. 4
      src/public/search.php

4
src/public/index.php

@ -2,6 +2,7 @@
// Load dependencies // Load dependencies
require_once (__DIR__ . '/../config/app.php'); require_once (__DIR__ . '/../config/app.php');
require_once (__DIR__ . '/../library/access.php');
require_once (__DIR__ . '/../library/mysql.php'); require_once (__DIR__ . '/../library/mysql.php');
require_once (__DIR__ . '/../../vendor/autoload.php'); require_once (__DIR__ . '/../../vendor/autoload.php');
@ -181,6 +182,9 @@ $peers = $memory->getByMethodCallback(
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<a class="logo" href="<?php echo WEBSITE_URL ?>"><?php echo str_replace('YGG', '<span>YGG</span>', WEBSITE_NAME) ?></a> <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"> <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...') ?>" /> <input type="text" name="query" value="" placeholder="<?php echo _('this, address, ip, geo, port, keyword...') ?>" />
<button type="submit"><?php echo _('search') ?></button> <button type="submit"><?php echo _('search') ?></button>

3
src/public/peer.php

@ -213,6 +213,9 @@ $peerPortStatuses = $db->findLastPeerPortStatusesByPeerId($requestPeerId);
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<a class="logo" href="<?php echo WEBSITE_URL ?>"><?php echo str_replace('YGG', '<span>YGG</span>', WEBSITE_NAME) ?></a> <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"> <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...') ?>" /> <input type="text" name="query" value="" placeholder="<?php echo _('this, address, ip, geo, port, keyword...') ?>" />
<button type="submit"><?php echo _('search') ?></button> <button type="submit"><?php echo _('search') ?></button>

4
src/public/search.php

@ -1,6 +1,7 @@
<?php <?php
require_once (__DIR__ . '/../config/app.php'); require_once (__DIR__ . '/../config/app.php');
require_once (__DIR__ . '/../library/access.php');
require_once (__DIR__ . '/../library/mysql.php'); require_once (__DIR__ . '/../library/mysql.php');
require_once(__DIR__ . '/../library/sphinxql.php'); require_once(__DIR__ . '/../library/sphinxql.php');
require_once __DIR__ . '/../../vendor/autoload.php'; require_once __DIR__ . '/../../vendor/autoload.php';
@ -84,6 +85,9 @@ $results = $sphinx->searchPeers($requestQuery,
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<a class="logo" href="<?php echo WEBSITE_URL ?>"><?php echo str_replace('YGG', '<span>YGG</span>', WEBSITE_NAME) ?></a> <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"> <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...') ?>" /> <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> <button type="submit"><?php echo _('search') ?></button>

Loading…
Cancel
Save