mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
WIP: WifiAPEnable handling
This commit is contained in:
parent
66a3944039
commit
d6bd7d2c4a
@ -531,25 +531,33 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status)
|
|||||||
|
|
||||||
$good_input = true;
|
$good_input = true;
|
||||||
|
|
||||||
// Check for Logging Checkbox
|
// Check for WiFi client AP mode checkbox
|
||||||
$logEnable = 0;
|
$wifiAPEnable = 0;
|
||||||
if($arrHostapdConf['LogEnable'] == 0) {
|
if($arrHostapdConf['WifiAPEnable'] == 0) {
|
||||||
if(isset($_POST['logEnable'])) {
|
if(isset($_POST['wifiAPEnable'])) {
|
||||||
// Need code to enable logfile logging here
|
$wifiAPEnable = 1;
|
||||||
$logEnable = 1;
|
//exec('sudo /etc/raspap/hostapd/servicesdisable.sh');
|
||||||
exec('sudo /etc/raspap/hostapd/enablelog.sh');
|
//exec('sudo /etc/raspap/hostapd/servicesstart.sh');
|
||||||
} else {
|
|
||||||
exec('sudo /etc/raspap/hostapd/disablelog.sh');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if(isset($_POST['logEnable'])) {
|
|
||||||
$logEnable = 1;
|
|
||||||
exec('sudo /etc/raspap/hostapd/enablelog.sh');
|
|
||||||
} else {
|
|
||||||
exec('sudo /etc/raspap/hostapd/disablelog.sh');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for Logfile output checkbox
|
||||||
|
$logEnable = 0;
|
||||||
|
if($arrHostapdConf['LogEnable'] == 0) {
|
||||||
|
if(isset($_POST['logEnable'])) {
|
||||||
|
$logEnable = 1;
|
||||||
|
exec('sudo /etc/raspap/hostapd/enablelog.sh');
|
||||||
|
} else {
|
||||||
|
exec('sudo /etc/raspap/hostapd/disablelog.sh');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(isset($_POST['logEnable'])) {
|
||||||
|
$logEnable = 1;
|
||||||
|
exec('sudo /etc/raspap/hostapd/enablelog.sh');
|
||||||
|
} else {
|
||||||
|
exec('sudo /etc/raspap/hostapd/disablelog.sh');
|
||||||
|
}
|
||||||
|
}
|
||||||
write_php_ini(["LogEnable" => $logEnable],'/etc/raspap/hostapd.ini');
|
write_php_ini(["LogEnable" => $logEnable],'/etc/raspap/hostapd.ini');
|
||||||
|
|
||||||
// Verify input
|
// Verify input
|
||||||
@ -600,7 +608,6 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status)
|
|||||||
fwrite($tmp_file, 'auth_algs=1'.PHP_EOL);
|
fwrite($tmp_file, 'auth_algs=1'.PHP_EOL);
|
||||||
fwrite($tmp_file, 'wpa_key_mgmt=WPA-PSK'.PHP_EOL);
|
fwrite($tmp_file, 'wpa_key_mgmt=WPA-PSK'.PHP_EOL);
|
||||||
fwrite($tmp_file, 'beacon_int=100'.PHP_EOL);
|
fwrite($tmp_file, 'beacon_int=100'.PHP_EOL);
|
||||||
|
|
||||||
fwrite($tmp_file, 'ssid='.$_POST['ssid'].PHP_EOL);
|
fwrite($tmp_file, 'ssid='.$_POST['ssid'].PHP_EOL);
|
||||||
fwrite($tmp_file, 'channel='.$_POST['channel'].PHP_EOL);
|
fwrite($tmp_file, 'channel='.$_POST['channel'].PHP_EOL);
|
||||||
if ($_POST['hw_mode'] === 'n') {
|
if ($_POST['hw_mode'] === 'n') {
|
||||||
|
Loading…
Reference in New Issue
Block a user