summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Mazoyer <respawneral@gmail.com>2014-06-04 12:47:16 +0200
committerGuillaume Mazoyer <respawneral@gmail.com>2014-06-04 12:47:16 +0200
commitb73c9eca744c3e75791427348fa97de279827fb7 (patch)
tree3f7f6619ac028bfca26d9aa2357905117c010b35
parent69e49c133c7c1e7443e2bb7c2de3e1e8a3980cca (diff)
Provide a way to hide/show the visitor IP address.
-rw-r--r--config.php.example2
-rw-r--r--index.php7
2 files changed, 7 insertions, 2 deletions
diff --git a/config.php.example b/config.php.example
index 00fab71..37a33c2 100644
--- a/config.php.example
+++ b/config.php.example
@@ -13,6 +13,8 @@ $config['frontpage']['title'] = 'Looking Glass';
$config['frontpage']['show_title'] = true;
// Logo to display
$config['frontpage']['image'] = 'logo.png';
+// Show visitor IP address
+$config['frontpage']['show_visitor_ip'] = true;
// Disclaimer to inform people using the looking glass
$config['frontpage']['disclaimer'] = 'This is a disclaimer!';
// Frontpage order you can use: routers, commands, parameters, buttons
diff --git a/index.php b/index.php
index 3bcf81c..f1110bd 100644
--- a/index.php
+++ b/index.php
@@ -151,9 +151,12 @@ final class LookingGlass {
print '<div class="footer_bar">';
print '<p class="text-center">';
- if (isset($this->frontpage['disclaimer']) &&
- !empty($this->frontpage['disclaimer'])) {
+ if (!isset($this->frontpage['show_visitor_ip'] ||
+ $this->frontpage['show_visitor_ip']) {
print 'Your IP address: '.htmlentities($_SERVER['REMOTE_ADDR']).'<br />';
+ }
+
+ if (isset($this->frontpage['disclaimer'])) {
print $this->frontpage['disclaimer'];
print '<br /><br />';
}