Fix initial login to fetch encrypted token
authorChristian Weiske <cweiske@cweiske.de>
Mon, 6 Jan 2020 17:04:15 +0000 (18:04 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 6 Jan 2020 17:04:24 +0000 (18:04 +0100)
Test URL paths:
- /setupapp/radio567/asp/BrowseXPA/loginXML.asp?token=0
- /setupapp/radio567/asp/BrowseXPA/LoginXML.asp?token=0
- /RadioNativeLogin.php

src/header.php
www/index.php

index 785ada50b3241f672829de9be5f5fec553f4eeb0..03a38c3b089261a6c7b0e73d92804e6e321b0586 100644 (file)
@@ -2,7 +2,7 @@
 set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__ . '/../src/');
 
 $requestUriNoQuery = explode('?', $_SERVER['REQUEST_URI'])[0];
-$path = $fullUri = urldecode($requestUriNoQuery);
+$path = urldecode($requestUriNoQuery);
 
 $dataDir = __DIR__ . '/../data/';
 $varDir  = realpath(__DIR__ . '/../var') . '/';
index abbe69890cffa619396c73101ba2fbdaae63b93b..920425fe26d3ad3762e84de07e132bd1e78c17cf 100644 (file)
@@ -1,9 +1,11 @@
 <?php
 require_once __DIR__ . '/../src/header.php';
 
-if (strtolower($fullUri) == '/setupapp/radio567/asp/browsexpa/loginxml.asp?token=0'
-    || $fullUri == '/RadioNativeLogin.php'
-) {
+$radioPodcastLogin = isset($_GET['token']) && $_GET['token'] == '0'
+    && strtolower($path) == '/setupapp/radio567/asp/browsexpa/loginxml.asp';
+$myNoxonLogin = $path == '/RadioNativeLogin.php';
+
+if ($radioPodcastLogin || $myNoxonLogin) {
     //initial login for "internet radio", podcasts and "my noxon"
     header('Content-type: text/html');
     readfile($dataDir . 'login-camelcase.xml');