diff --git a/includes/configure_client.php b/includes/configure_client.php index cc9a1b5b..ba2e9e6f 100755 --- a/includes/configure_client.php +++ b/includes/configure_client.php @@ -16,7 +16,7 @@ function DisplayWPAConfig(){ foreach($known_return as $line) { if (preg_match('/network\s*=/', $line)) { - $network = array('visible' => false, 'configured' => true); + $network = array('visible' => false, 'configured' => true, 'connected' => false); } elseif ($network !== null) { if (preg_match('/^\s*}\s*$/', $line)) { $networks[$ssid] = $network; @@ -126,10 +126,18 @@ function DisplayWPAConfig(){ 'protocol' => ConvertToSecurity($arrNetwork[3]), 'channel' => ConvertToChannel($arrNetwork[1]), 'passphrase' => '', - 'visible' => true + 'visible' => true, + 'connected' => false ); } } + + exec( 'iwconfig wlan0', $iwconfig_return ); + foreach ($iwconfig_return as $line) { + if (preg_match( '/ESSID:\"(.+)\"/i',$line,$iwconfig_ssid )) { + $networks[$iwconfig_ssid[1]]['connected'] = true; + } + } ?>
@@ -156,11 +164,14 @@ function DisplayWPAConfig(){ $network) { ?> - - - - - + + + + + + + +