mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-12-26 23:26:47 +01:00
Remove obsolete toggleState functions, add file_exists() check
This commit is contained in:
@@ -713,7 +713,6 @@ function formatDateAgo($datetime, $full = false)
|
||||
function initializeApp()
|
||||
{
|
||||
$_SESSION["theme_url"] = getThemeOpt();
|
||||
$_SESSION["toggleState"] = getSidebarState();
|
||||
$_SESSION["bridgedEnabled"] = getBridgedState();
|
||||
$_SESSION["providerID"] = getProviderID();
|
||||
}
|
||||
@@ -739,22 +738,17 @@ function getColorOpt()
|
||||
return $color;
|
||||
}
|
||||
|
||||
function getSidebarState()
|
||||
{
|
||||
if(isset($_COOKIE['sidebarToggled'])) {
|
||||
if ($_COOKIE['sidebarToggled'] == 'true' ) {
|
||||
return "toggled";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returns bridged AP mode status
|
||||
function getBridgedState()
|
||||
{
|
||||
$arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
|
||||
// defaults to false
|
||||
|
||||
$hostapdIni = RASPI_CONFIG . '/hostapd.ini';
|
||||
if (!file_exists($hostapdIni)) {
|
||||
return 0;
|
||||
} else {
|
||||
$arrHostapdConf = parse_ini_file($hostapdIni);
|
||||
}
|
||||
return $arrHostapdConf['BridgedEnable'];
|
||||
}
|
||||
}
|
||||
|
||||
// Returns VPN provider ID, if defined
|
||||
function getProviderID()
|
||||
|
||||
Reference in New Issue
Block a user