Skip to content

Commit

Permalink
admin array
Browse files Browse the repository at this point in the history
  • Loading branch information
attogram committed Apr 17, 2019
1 parent 08fd184 commit 99c9384
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Future Developments

* custom config adminIP - allow multiple IPs
* refactor feed processing to simpleXML
* refactor layout to CSS GRID
* number format - remove/grey-out trailing zeros
Expand Down
4 changes: 2 additions & 2 deletions custom/config.example.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
// Custom Site Title
//$config['title'] = 'Attogram Currency Exchange Rates';

// IP address of administrator machine
//$config['adminIP'] = '127.0.0.1';
// Administrators - array of IP Addresses
//$config['adminIP'] = ['127.0.0.1', '::1'];

// Hidden Feeds - array of Feed codes
//$config['hidden'] = ['BankRussia'];
2 changes: 1 addition & 1 deletion src/CurrencyExchangeRates.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ protected function displayMenu()
protected function isAdmin()
{
if (!empty($this->config['adminIP'])
&& $this->config['adminIP'] === $this->router->getServer('REMOTE_ADDR')
&& in_array($this->router->getServer('REMOTE_ADDR'), $this->config['adminIP'])
) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/CustomizationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function loadConfig()
if (empty($this->config['title']) || !is_string($this->config['title'])) {
$this->config['title'] = 'Attogram Currency Exchange Rates';
}
if (empty($this->config['adminIP']) || !is_string($this->config['adminIP'])) {
if (empty($this->config['adminIP']) || !is_array($this->config['adminIP'])) {
$this->config['adminIP'] = null;
}
if (empty($this->config['hidden']) || !is_array($this->config['hidden'])) {
Expand Down

0 comments on commit 99c9384

Please sign in to comment.