mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Merge pull request #616 from zbchristian/zbchristian-wlan-switch
Correct session variable setting and client on dashboard
This commit is contained in:
		@@ -142,12 +142,10 @@ function sortNetworksByRSSI(&$networks)
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
function getWifiInterface()
 | 
					function getWifiInterface()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (empty($_SESSION['ap_interface'])) {
 | 
					 | 
				
			||||||
        $arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
 | 
					        $arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
 | 
				
			||||||
        $iface = $_SESSION['ap_interface'] = isset($arrHostapdConf['WifiInterface']) ?  $arrHostapdConf['WifiInterface'] : RASPI_WIFI_AP_INTERFACE;
 | 
					        $iface = $_SESSION['ap_interface'] = isset($arrHostapdConf['WifiInterface']) ?  $arrHostapdConf['WifiInterface'] : RASPI_WIFI_AP_INTERFACE;
 | 
				
			||||||
        // check for 2nd wifi interface -> wifi client on different interface
 | 
					        // check for 2nd wifi interface -> wifi client on different interface
 | 
				
			||||||
        exec("iw dev | awk '$1==\"Interface\" && $2!=\"$iface\" {print $2}'",$iface2);
 | 
					        exec("iw dev | awk '$1==\"Interface\" && $2!=\"$iface\" {print $2}'",$iface2);
 | 
				
			||||||
        $_SESSION['wifi_client_interface'] = empty($iface2) ? $iface : trim($iface2[0]);
 | 
					        $_SESSION['wifi_client_interface'] = empty($iface2) ? $iface : trim($iface2[0]);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@ $arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
 | 
				
			|||||||
if ($arrHostapdConf['WifiAPEnable'] == 1) {
 | 
					if ($arrHostapdConf['WifiAPEnable'] == 1) {
 | 
				
			||||||
    $client_interface = 'uap0';
 | 
					    $client_interface = 'uap0';
 | 
				
			||||||
} else {
 | 
					} else {
 | 
				
			||||||
    $client_interface = $_SESSION['ap_interface'];
 | 
					    $client_interface = $_SESSION['wifi_client_interface'];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
$ap_iface = $_SESSION['ap_interface'];
 | 
					$ap_iface = $_SESSION['ap_interface'];
 | 
				
			||||||
$MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"';
 | 
					$MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"';
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user