From 417e9489bb72df8b47a0671c68d38815975e171d Mon Sep 17 00:00:00 2001 From: zbchristian <33725910+zbchristian@users.noreply.github.com> Date: Sun, 14 Jun 2020 17:40:50 +0200 Subject: [PATCH 1/3] disable check on existing session variable --- includes/wifi_functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/wifi_functions.php b/includes/wifi_functions.php index e40a628d..6822ba12 100755 --- a/includes/wifi_functions.php +++ b/includes/wifi_functions.php @@ -142,12 +142,12 @@ function sortNetworksByRSSI(&$networks) */ function getWifiInterface() { - if (empty($_SESSION['ap_interface'])) { +// if (empty($_SESSION['ap_interface'])) { $arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini'); $iface = $_SESSION['ap_interface'] = isset($arrHostapdConf['WifiInterface']) ? $arrHostapdConf['WifiInterface'] : RASPI_WIFI_AP_INTERFACE; // check for 2nd wifi interface -> wifi client on different interface exec("iw dev | awk '$1==\"Interface\" && $2!=\"$iface\" {print $2}'",$iface2); $_SESSION['wifi_client_interface'] = empty($iface2) ? $iface : trim($iface2[0]); - } +// } } From a8238d688e214439fa6dd1eaf53a9aae30befb53 Mon Sep 17 00:00:00 2001 From: zbchristian <33725910+zbchristian@users.noreply.github.com> Date: Sun, 14 Jun 2020 18:19:34 +0200 Subject: [PATCH 2/3] select correct wifi interface as client --- templates/dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/dashboard.php b/templates/dashboard.php index b7257de6..0b0e7c0d 100755 --- a/templates/dashboard.php +++ b/templates/dashboard.php @@ -3,7 +3,7 @@ $arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini'); if ($arrHostapdConf['WifiAPEnable'] == 1) { $client_interface = 'uap0'; } else { - $client_interface = $_SESSION['ap_interface']; + $client_interface = $_SESSION['wifi_client_interface']; } $ap_iface = $_SESSION['ap_interface']; $MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"'; From e6652c025d1f6b7a55e31d4860a190d16b23e944 Mon Sep 17 00:00:00 2001 From: zbchristian <33725910+zbchristian@users.noreply.github.com> Date: Sun, 14 Jun 2020 18:22:51 +0200 Subject: [PATCH 3/3] Remove check on existing SESSION variable --- includes/wifi_functions.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/includes/wifi_functions.php b/includes/wifi_functions.php index 6822ba12..c4ec7c60 100755 --- a/includes/wifi_functions.php +++ b/includes/wifi_functions.php @@ -142,12 +142,10 @@ function sortNetworksByRSSI(&$networks) */ function getWifiInterface() { -// if (empty($_SESSION['ap_interface'])) { $arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini'); $iface = $_SESSION['ap_interface'] = isset($arrHostapdConf['WifiInterface']) ? $arrHostapdConf['WifiInterface'] : RASPI_WIFI_AP_INTERFACE; // check for 2nd wifi interface -> wifi client on different interface exec("iw dev | awk '$1==\"Interface\" && $2!=\"$iface\" {print $2}'",$iface2); $_SESSION['wifi_client_interface'] = empty($iface2) ? $iface : trim($iface2[0]); -// } }