From 0999209e5b3cc3b6469df8cfcb747db81360f873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Schw=C3=B6rer?= Date: Sat, 3 Feb 2018 14:43:28 +0100 Subject: [PATCH] setselfaddress --- www/internals/base.php | 16 ++++++++++++++++ www/pages/admin.php | 18 ++++++++++++++++++ www/pages/api_setselfadress.php | 20 ++++---------------- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/www/internals/base.php b/www/internals/base.php index 01692f8..8ca675f 100644 --- a/www/internals/base.php +++ b/www/internals/base.php @@ -328,4 +328,20 @@ function sendExceptionMail($e) { // } +} + +function get_client_ip() { + if (getenv('HTTP_CLIENT_IP')) return getenv('HTTP_CLIENT_IP'); + else if(getenv('HTTP_X_FORWARDED_FOR')) return getenv('HTTP_X_FORWARDED_FOR'); + else if(getenv('HTTP_X_FORWARDED')) return getenv('HTTP_X_FORWARDED'); + else if(getenv('HTTP_FORWARDED_FOR')) return getenv('HTTP_FORWARDED_FOR'); + else if(getenv('HTTP_FORWARDED')) return getenv('HTTP_FORWARDED'); + else if(getenv('REMOTE_ADDR')) return getenv('REMOTE_ADDR'); + else if (isset($_SERVER['HTTP_CLIENT_IP'])) return $_SERVER['HTTP_CLIENT_IP']; + else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) return $_SERVER['HTTP_X_FORWARDED_FOR']; + else if(isset($_SERVER['HTTP_X_FORWARDED'])) return $_SERVER['HTTP_X_FORWARDED']; + else if(isset($_SERVER['HTTP_FORWARDED_FOR'])) return $_SERVER['HTTP_FORWARDED_FOR']; + else if(isset($_SERVER['HTTP_FORWARDED'])) return $_SERVER['HTTP_FORWARDED']; + else if(isset($_SERVER['REMOTE_ADDR'])) return $_SERVER['REMOTE_ADDR']; + else return 'UNKNOWN'; } \ No newline at end of file diff --git a/www/pages/admin.php b/www/pages/admin.php index 6698bdc..8dd8f44 100644 --- a/www/pages/admin.php +++ b/www/pages/admin.php @@ -88,6 +88,24 @@ function dumpConsistency($c) { +
+
Self IP Addr
+ + + +
+
Registered IP:
+
Current IP:
+
+
+ + +
ExtendedGitGraph
diff --git a/www/pages/api_setselfadress.php b/www/pages/api_setselfadress.php index 15dc0d5..aa96d14 100644 --- a/www/pages/api_setselfadress.php +++ b/www/pages/api_setselfadress.php @@ -1,21 +1,9 @@