mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-26 23:26:47 +01:00
Define constant for Open for security protocol
This commit is contained in:
@@ -78,7 +78,7 @@ function DisplayWPAConfig()
|
||||
|
||||
$ok = true;
|
||||
foreach ($tmp_networks as $ssid => $network) {
|
||||
if ($network['protocol'] === 'Open') {
|
||||
if ($network['protocol'] === $wifi::SECURITY_OPEN) {
|
||||
fwrite($wpa_file, "network={".PHP_EOL);
|
||||
fwrite($wpa_file, "\tssid=\"".$ssid."\"".PHP_EOL);
|
||||
fwrite($wpa_file, "\tkey_mgmt=NONE".PHP_EOL);
|
||||
|
||||
@@ -16,6 +16,7 @@ class WiFiManager
|
||||
|
||||
private const MIN_RSSI = -100;
|
||||
private const MAX_RSSI = -55;
|
||||
const SECURITY_OPEN = 'OPEN';
|
||||
|
||||
public function knownWifiStations(&$networks)
|
||||
{
|
||||
@@ -127,7 +128,7 @@ class WiFiManager
|
||||
$networks[$ssid] = [
|
||||
'ssid' => $ssid,
|
||||
'configured' => false,
|
||||
'protocol' => $current['security'] ?? 'OPEN',
|
||||
'protocol' => $current['security'] ?? self::SECURITY_OPEN,
|
||||
'channel' => $channel,
|
||||
'passphrase' => '',
|
||||
'visible' => true,
|
||||
@@ -138,6 +139,10 @@ class WiFiManager
|
||||
++$index;
|
||||
}
|
||||
};
|
||||
|
||||
if (is_string($scan_results)) {
|
||||
$scan_results = explode("\n", trim($scan_results));
|
||||
}
|
||||
|
||||
foreach ($scan_results as $line) {
|
||||
$line = trim($line);
|
||||
@@ -149,7 +154,7 @@ class WiFiManager
|
||||
'ssid' => '',
|
||||
'signal' => null,
|
||||
'freq' => null,
|
||||
'security' => 'OPEN'
|
||||
'security' => self::SECURITY_OPEN
|
||||
];
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user