From 3f3b6cb7148030a58fa37b4458e0e2f534465053 Mon Sep 17 00:00:00 2001 From: dg9vh Date: Tue, 16 May 2017 19:47:38 +0000 Subject: [PATCH] enabled switching of YSFReflectors by clicking on name of reflector in table... has to be enabled in setup --- include/ysfgatewayinfo.php | 6 ++- scripts/switchysfreflector.php | 92 ++++++++++++++++++++++++++++++++++ setup.php | 10 +++- version.php | 2 +- 4 files changed, 107 insertions(+), 3 deletions(-) create mode 100644 scripts/switchysfreflector.php diff --git a/include/ysfgatewayinfo.php b/include/ysfgatewayinfo.php index 2de7d0e..011fba9 100644 --- a/include/ysfgatewayinfo.php +++ b/include/ysfgatewayinfo.php @@ -48,7 +48,11 @@ echo ""; echo "$counter"; for ($i = 0; $i < 4; $i++) { - echo"$reflector[$i]"; + if ($i == 0 && defined("ENABLEYSFREFLECTORSWITCHING")) { + echo"$reflector[$i]"; + } else { + echo"$reflector[$i]"; + } } echo "\n"; $counter++; diff --git a/scripts/switchysfreflector.php b/scripts/switchysfreflector.php new file mode 100644 index 0000000..2a12de4 --- /dev/null +++ b/scripts/switchysfreflector.php @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + <?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 abbdeba..3a03061 100644 --- a/setup.php +++ b/setup.php @@ -281,9 +281,13 @@ foreach ($files as $file) {
>
- +
>
+
+ +
>
+
" name="SWITCHNETWORKUSER" class="form-control" placeholder="username" aria-describedby="SWITCHNETWORKUSER"> @@ -329,6 +333,10 @@ foreach ($files as $file) { " name="RESTARTPW" class="form-control" placeholder="password" aria-describedby="RESTARTPW">
+
+ + " name="REBOOTYSFGATEWAY" class="form-control" placeholder="sudo systemctl restart ysfgateway.service" aria-describedby="REBOOTYSFGATEWAY"> +
" name="REBOOTMMDVM" class="form-control" placeholder="sudo systemctl restart mmdvmhost.service" aria-describedby="REBOOTMMDVM"> diff --git a/version.php b/version.php index a5b7166..636de92 100644 --- a/version.php +++ b/version.php @@ -1,3 +1,3 @@