From 677bac73ff46cbbe6e1791896eee414d69d45364 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Tue, 28 Mar 2017 08:28:39 +0000 Subject: [PATCH] added switch reflector button inspired by OE7JKT. Be sure to add /bin/sed into sudoers! Not finished completely, actually loads only DMRplus-Reflector-list. --- credits.php | 1 + include/functions.php | 26 ++++++++++- index.php | 18 ++++++++ scripts/switchreflector.php | 92 +++++++++++++++++++++++++++++++++++++ setup.php | 4 ++ 5 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 scripts/switchreflector.php diff --git a/credits.php b/credits.php index 6effd70..4b29f9b 100644 --- a/credits.php +++ b/credits.php @@ -42,6 +42,7 @@ textdomain('messages');
  • dg0cco
  • sa7bnt
  • ct2jay
  • +
  • oe7jkt
  • diff --git a/include/functions.php b/include/functions.php index bf905ca..a5d8e12 100644 --- a/include/functions.php +++ b/include/functions.php @@ -849,9 +849,33 @@ function decodeAlias($logLine) { return $tok1.$tok2.$tok3.$tok4.$tok5.$tok6.$tok7; } - function getGitVersion(){ exec("git rev-parse HEAD", $output); return 'GitID #'.substr($output[0],0,7).''; } + +function getDMRReflectors($network) { + $refls = array(); + switch ($network) { + case "DMRPLUS": + $refls = getDMRReflectorsFromURL("http://ham-dmr.de/reflector.db"); + break; + case "BRANDMEISTER": + $refls = getDMRReflectorsFromURL("http://185.79.71.94/reflector.db"); + break; + + } + return $refls; + +} + +function getDMRReflectorsFromURL($url) { + $data = file_get_contents($url); + $rows = explode("\n",$data); + $refls = array(); + foreach($rows as $row) { + $refls[] = str_getcsv($row,"@",''); + } + return $refls; +} ?> diff --git a/index.php b/index.php index 987e979..ab21365 100644 --- a/index.php +++ b/index.php @@ -133,6 +133,24 @@ if (defined("ENABLENETWORKSWITCHING")) { ?> + +
    +
    + + + +
    + + + + + + + + + + + + + + + <?php echo getCallsign($mmdvmconfigs) ?> - MMDVM-Dashboard by DG9VH + + + + + + + +
    + +'; + } else { + + header('WWW-Authenticate: Basic realm="Dashboard"'); + header('HTTP/1.0 401 Unauthorized'); + echo 'Zur Ausführung bitte die geforderten Login-Daten eingeben!'; + exit; + } + } +?> | get your own at: https://github.com/dg9vh/MMDVMHost-Dashboard +
    + + diff --git a/setup.php b/setup.php index 5cb6689..6e0381f 100644 --- a/setup.php +++ b/setup.php @@ -261,6 +261,10 @@ get_tz_options(constant("TIMEZONE"), "Timezone", '');
    >
    +
    + +
    >
    +
    " name="SWITCHNETWORKUSER" class="form-control" placeholder="username" aria-describedby="SWITCHNETWORKUSER">