summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-14 13:25:26 +0200
committerErich Eckner <git@eckner.net>2018-09-14 13:25:26 +0200
commit1de8372947333f1fdaeacb3f88e13ecea758367c (patch)
tree1845797dfbda320217fb376d0c19ea8dc3415099
parente0729dcac666e09129b600b89b4bd7c5e2ad768b (diff)
downloadsourceMirror-1de8372947333f1fdaeacb3f88e13ecea758367c.tar.xz
erlaubte Adressen können nun "x" als Platzhalter besitzen (ipv6)
-rw-r--r--erlaubteAdressen9
-rw-r--r--mirror.php9
2 files changed, 14 insertions, 4 deletions
diff --git a/erlaubteAdressen b/erlaubteAdressen
index 863c183..84be984 100644
--- a/erlaubteAdressen
+++ b/erlaubteAdressen
@@ -1,7 +1,8 @@
127.0.0.1
192.168.0.12
192.168.0.15
-2a02:2450:115a:96:f160:717f:45f8:6c60
-2a02:2450:115a:96:6f45:5c80:9478:d966
-2a02:2450:115a:96:339f:29fb:8919:bd49
-2a02:2450:115a:96:2a34:fedf:2f75:a69d
+x:x:x:x:2a34:fedf:2f75:a69d
+x:x:x:x:339f:29fb:8919:bd49
+x:x:x:x:6f45:5c80:9478:d966
+x:x:x:x:f160:717f:45f8:6c60
+x:x:x:x:5454:5ff:fe3a:d954
diff --git a/mirror.php b/mirror.php
index dee5b5c..65552b3 100644
--- a/mirror.php
+++ b/mirror.php
@@ -19,6 +19,15 @@
$ea = fopen($wurzel."erlaubteAdressen","r");
while (! feof($ea)) {
$zeile = trim(fgets($ea));
+ if ((strpos($zeile,"x:")!==false) &&
+ (strpos($_SERVER["SERVER_ADDR"],":")!==false)) {
+ $zeile = explode(":",$zeile);
+ $my_addr = explode(":",$_SERVER["SERVER_ADDR"]);
+ foreach ($zeile as $key => $val)
+ if ($val=="x")
+ $zeile[$key]=$my_addr[$key];
+ $zeile = implode(":",$zeile);
+ }
if ($zeile == $_SERVER["REMOTE_ADDR"])
break;
}