mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Add network index to network array
This commit is contained in:
parent
7df8f68621
commit
9aa94a4d22
@ -6,9 +6,11 @@ function knownWifiStations(&$networks)
|
|||||||
{
|
{
|
||||||
// Find currently configured networks
|
// Find currently configured networks
|
||||||
exec(' sudo cat ' . RASPI_WPA_SUPPLICANT_CONFIG, $known_return);
|
exec(' sudo cat ' . RASPI_WPA_SUPPLICANT_CONFIG, $known_return);
|
||||||
|
$index = 0;
|
||||||
foreach ($known_return as $line) {
|
foreach ($known_return as $line) {
|
||||||
if (preg_match('/network\s*=/', $line)) {
|
if (preg_match('/network\s*=/', $line)) {
|
||||||
$network = array('visible' => false, 'configured' => true, 'connected' => false);
|
$network = array('visible' => false, 'configured' => true, 'connected' => false, 'index' => $index);
|
||||||
|
++$index;
|
||||||
} elseif (isset($network) && $network !== null) {
|
} elseif (isset($network) && $network !== null) {
|
||||||
if (preg_match('/^\s*}\s*$/', $line)) {
|
if (preg_match('/^\s*}\s*$/', $line)) {
|
||||||
$networks[$ssid] = $network;
|
$networks[$ssid] = $network;
|
||||||
@ -98,7 +100,8 @@ function nearbyWifiStations(&$networks, $cached = true)
|
|||||||
'channel' => ConvertToChannel($arrNetwork[1]),
|
'channel' => ConvertToChannel($arrNetwork[1]),
|
||||||
'passphrase' => '',
|
'passphrase' => '',
|
||||||
'visible' => true,
|
'visible' => true,
|
||||||
'connected' => false
|
'connected' => false,
|
||||||
|
'index' => -1
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user