#!/bin/sh export DATE="28.8.2010";SCRIPT=${0#/rom} export TITLE="Admin: Map Data" . ${SCRIPT%/*}/cgi-bin-pre.sh cat<Admin: Map Data EOF if [ "$REQUEST_METHOD" = "POST" ]; then read QUERY_STRING fi if [ -z "$QUERY_STRING" ]; then map_update="$(nvram get ff_map_update)" map_server="$(nvram get ff_map_server)" if [ -z "$map_server" ]; then map_server="http://map.berlin.freifunk.net/freifunkmap.php" fi ff_adm_latlon=$(nvram get ff_adm_latlon) if [ -z "$ff_adm_latlon" ];then IFS=\;\,\: set - $(nvram get ff_adm_gps) unset IFS if [ -n "$1" ] && [ -n "$2" ];then ff_adm_latlon="$1,$2" fi fi # ...Werte holen ANT_INFO=$(nvram get ff_map_hfinfo) ff_adm_note=$(nvram get ff_adm_note) # Reste der MagicS/ff_adm_note - spart den Leuten das Neueingeben und säubern... # kann in einer der nächsten Versionen einfach weg: ### cut 8<--- if [ -z "$ANT_INFO" ];then MagicBEG='§§_HF-Info(' MagicEND=')HF-Info_§§' ANT_INFO=$(echo "$ff_adm_note"|sed -n "s/.*${MagicBEG}\(.*\)${MagicEND}.*/\1/p") ff_adm_note=$(echo "$ff_adm_note"|sed "s/${MagicBEG}.*${MagicEND}//") fi ### until here --->8 [ -n "$ANT_INFO" ] && eval "$(echo "$ANT_INFO"|sed 's/:/\=/g')" cat< function set_val(id,val) { document.getElementById(id).value = val; } function select_(id) { document.getElementById(id).selected='selected'; } function set_Ant(idx) { var a = document.getElementById("SelAnt").options[idx].value.split(new RegExp(":")); select_("Atyp_" + idx); set_val("type", a[0]); set_val("gain", a[1]); set_val("angP", a[2]); set_val("angO", a[3]); } function SelFreeAnt(id) { if( document.getElementById("SelAnt").selectedIndex != (A.length-1) ) { select_("Atyp_" + (A.length-1) ); if ( id != "type") set_val("type", A[A.length-1][1]); } } function set_Dir(idx) { select_("Hdir_" + idx); set_val("Hdir", document.getElementById("SelDir").options[idx].value); } function SelFreeDir() { select_("Hdir_" + (document.getElementById("SelDir").options.length-1) ); } function set_Pol(idx) { select_("PolE_" + idx); set_val("PolE", document.getElementById("SelPol").options[idx].value); } function SelFreePol() { select_("PolE_" + (document.getElementById("SelPol").options.length-1) ); }
Freifunk Map Server:
URL:
Update Intervall:
GPS Position:
Optional Configuration of your Antenna
Height: meters

Adjustment
Tilt:
Direction: °
Polarization: °

Antenna
Type:
Gain: dbi
Beam Width:Largura do Feixe: °   with polarization
  °   perpendicular to polarization
Notes
 
   

Note: There are two different map techniques. They differ in the way they aquire data. Both techniques link the collected information with card material grabbed from a service provider on the Internet. Currently, both techniques exist in parallel and they do not exchange data.

Local Decentralized Map:
This map technique floods geopositions and node names with the OLSR protocol. No additional server is required, because the single routers can inform each other. Only stations on your local radio network are displayed. This map uses the Microsoft Virtual Earth as well as the Google Earth program because those do not require registration.
Global server-based Freifunk Map:
This map technique collects geopositions and all data you entered on this page on a centeral server on the Internet. For this reason, also stations on foreign radio networks can be displayed. Especially the antenna data may enable us to develop a server-based radio planning software. This map uses google maps with the google registration of the server owner.
EOF else IFS=\&;set ${QUERY_STRING%%[^%&=+-:@-_a-z~]*};unset IFS;eval $* DIRTY= if [ -n "$post_map" ]; then ff_map_hfinfo="A_type:${A_type};A_gain:${A_gain};A_angP:${A_angP};A_angO:${A_angO};A_Vpos:${A_Vpos};A_Hdir:${A_Hdir};A_Vdir:${A_Vdir};A_PolE:${A_PolE};" for V in ff_map_server ff_map_hfinfo ff_map_update ff_adm_note ff_adm_latlon; do eval "C=\$$V" C=$(unescape $C) if [ "$C" != "$(nvram get $V)" ]; then DIRTY=1 nvram set $V="$C" fi done fi if [ -n "$DIRTY" ]; then nvram unset ff_adm_gps nvram commit>/dev/null 2>&1 /etc/init.d/S70freifunkmap start cat< Changes committed. EOF if [ "disabled" != "$ff_map_update" ];then cat<
Refreshing data on the map server (takes a moment)...
$(/etc/init.d/S70freifunkmap update ERROR)
...ok.
EOF fi cat< EOF else cat< No settings are changed. EOF fi fi . ${SCRIPT%/*}/cgi-bin-post.sh