gluon-web-remote

Web remote Administration for big size of gluon routers
git clone git://archive.git.mtrnord.blog/MTRNord/gluon-web-remote.git
Log | Files | Refs | README

commit a2067b943aa0e08c3e2c04f0bd9167f183574d49
parent 9ebb4077e527a3c3a9baa536e872278333b2fcba
Author: Marcel <info@nordgedanken.de>
Date:   Fri, 23 Oct 2015 22:22:01 +0200

add FFFL and activate Nodelist download

Diffstat:
MindexClass.php | 24+++++++++++++-----------
Mnodes/communities.json | 11++++++++++-
2 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/indexClass.php b/indexClass.php @@ -11,16 +11,18 @@ class main { ############ # getNodes # ############ - function getNodes($communityURL, $communityID){ - if(!empty($communityURL)){ - if(!empty($communityID)){ - //$nodes = file_get_contents($communityURL); - $nodes = file_get_contents("http://map.ffki.de/nodes.json"); - //$nodes_file = fopen("nodes/nodes"+$communityID+".json", "w+") or die("Unable to open file!"); - $nodes_file = fopen("nodes/nodesFFKI.json", "w+") or die("Unable to open file!"); - fwrite($nodes_file, $nodes); - fclose($nodes_file); - } + function getNodes($communityID){ + if(!empty($communityID)){ + $communities_str = file_get_contents("nodes/communities.json"); + $json_communities = json_decode($communities_str); + $communityURL = $json_communities->{$communityID}->{"nodesURL"}; + + $nodes = file_get_contents($communityURL); + //$nodes = file_get_contents("http://map.ffki.de/nodes.json"); + $nodes_file = fopen("nodes/nodes"+$communityID+".json", "w+") or die("Unable to open file!"); + //$nodes_file = fopen("nodes/nodesFFKI.json", "w+") or die("Unable to open file!"); + fwrite($nodes_file, $nodes); + fclose($nodes_file); } } @@ -28,7 +30,7 @@ class main { # parseMAC # ############ function parseMAC($nodeName, $communityID){ - main::getNodes(); + main::getNodes($communityID); //$nodes_string = file_get_contents("nodes/nodes"+$communityID+".json"); $nodes_str = file_get_contents("nodes/nodesFFKI.json"); diff --git a/nodes/communities.json b/nodes/communities.json @@ -1,9 +1,18 @@ { "FFKI": { "name": "Freifunk Kiel", + "nodesURL": "http://map.ffki.de/nodes.json", "v6": "fda1:384a:74de:", "v6mask": "/48", "v4": "10.116.0.0", - "v4mask": "/16" + "v4mask": "/16"- + }, + "FFFL": { + "name": "Freifunk Flensburg", + "nodesURL": "http://map.freifunk-flensburg.de/data/nodes.json", + "v6": "fddf:bf7:10:1:", + "v6mask": "/64", + "v4": "10.129.0.0", + "v4mask": "/16"- } }