1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Processed with phpcbf for PSR-2 coding standard

This commit is contained in:
billz 2019-09-07 16:42:31 +01:00
parent ef406edc61
commit 8be24381a8
20 changed files with 106 additions and 87 deletions

View File

@ -7,5 +7,5 @@
*/ */
function DisplayAbout() function DisplayAbout()
{ {
echo renderTemplate("about"); echo renderTemplate("about");
} }

View File

@ -46,7 +46,7 @@ function DisplayWPAConfig()
fwrite($wpa_file, "network={".PHP_EOL); fwrite($wpa_file, "network={".PHP_EOL);
fwrite($wpa_file, "\tssid=\"".$ssid."\"".PHP_EOL); fwrite($wpa_file, "\tssid=\"".$ssid."\"".PHP_EOL);
fwrite($wpa_file, "\tkey_mgmt=NONE".PHP_EOL); fwrite($wpa_file, "\tkey_mgmt=NONE".PHP_EOL);
fwrite($wpa_file, "\tscan_ssid=1".PHP_EOL); fwrite($wpa_file, "\tscan_ssid=1".PHP_EOL);
if (array_key_exists('priority', $network)) { if (array_key_exists('priority', $network)) {
fwrite($wpa_file, "\tpriority=".$network['priority'].PHP_EOL); fwrite($wpa_file, "\tpriority=".$network['priority'].PHP_EOL);
} }
@ -96,5 +96,4 @@ function DisplayWPAConfig()
connectedWifiStations($networks); connectedWifiStations($networks);
echo renderTemplate("configure_client", compact("status")); echo renderTemplate("configure_client", compact("status"));
} }

View File

@ -4,5 +4,5 @@ include_once('functions.php');
include_once('session.php'); include_once('session.php');
if (csrfValidateRequest() && !CSRFValidate()) { if (csrfValidateRequest() && !CSRFValidate()) {
handleInvalidCSRFToken(); handleInvalidCSRFToken();
} }

View File

@ -33,12 +33,12 @@ function DisplayDashboard()
$ipv4Addrs = _('No IPv4 Address Found'); $ipv4Addrs = _('No IPv4 Address Found');
} else { } else {
foreach ($matchesIpv4AddrAndSubnet as $inet) { foreach ($matchesIpv4AddrAndSubnet as $inet) {
$address = $inet[1]; $address = $inet[1];
$suffix = (int) $inet[2]; $suffix = (int) $inet[2];
$netmask = long2ip(-1 << (32 - $suffix)); $netmask = long2ip(-1 << (32 - $suffix));
$ipv4Addrs .= " $address"; $ipv4Addrs .= " $address";
$ipv4Netmasks .= " $netmask"; $ipv4Netmasks .= " $netmask";
} }
$ipv4Addrs = trim($ipv4Addrs); $ipv4Addrs = trim($ipv4Addrs);
$ipv4Netmasks = trim($ipv4Netmasks); $ipv4Netmasks = trim($ipv4Netmasks);
@ -173,12 +173,21 @@ function DisplayDashboard()
echo renderTemplate("dashboard", compact( echo renderTemplate("dashboard", compact(
"status", "status",
"ipv4Addrs", "ipv4Netmasks", "ipv4Addrs",
"ipv6Addrs", "macAddr", "ipv4Netmasks",
"strRxPackets", "strRxBytes", "ipv6Addrs",
"strTxPackets", "strTxBytes", "macAddr",
"connectedSSID", "connectedBSSID", "strRxPackets",
"bitrate", "signalLevel", "txPower", "frequency", "strLinkQuality", "strRxBytes",
"strTxPackets",
"strTxBytes",
"connectedSSID",
"connectedBSSID",
"bitrate",
"signalLevel",
"txPower",
"frequency",
"strLinkQuality",
"wlan0up" "wlan0up"
)); ));
} }
@ -213,4 +222,3 @@ function getHumanReadableDatasize($numbytes, $precision = 2)
return $humanDatasize; return $humanDatasize;
} }

View File

@ -138,10 +138,17 @@ function DisplayDHCPConfig()
echo renderTemplate("dhcp", compact( echo renderTemplate("dhcp", compact(
"status", "status",
"serviceStatus", "serviceStatus",
"RangeStart", "RangeEnd", "RangeStart",
"RangeEnd",
"arrRangeLeaseTime", "arrRangeLeaseTime",
"mselected", "hselected", "dselected", "infiniteselected", "mselected",
"dnsmasq_state", "conf", "dhcpHost", "hselected",
"interfaces", "leases" "dselected",
"infiniteselected",
"dnsmasq_state",
"conf",
"dhcpHost",
"interfaces",
"leases"
)); ));
} }

View File

@ -116,8 +116,8 @@ function CSRFValidate()
*/ */
function csrfValidateRequest() function csrfValidateRequest()
{ {
$request_method = strtolower($_SERVER['REQUEST_METHOD']); $request_method = strtolower($_SERVER['REQUEST_METHOD']);
return in_array($request_method, [ "post", "put", "patch", "delete" ]); return in_array($request_method, [ "post", "put", "patch", "delete" ]);
} }
/** /**
@ -194,7 +194,9 @@ function ParseConfig($arrConfig)
$config = array(); $config = array();
foreach ($arrConfig as $line) { foreach ($arrConfig as $line) {
$line = trim($line); $line = trim($line);
if ($line == "" || $line[0] == "#") { continue; } if ($line == "" || $line[0] == "#") {
continue;
}
list($option, $value) = array_map("trim", explode("=", $line, 2)); list($option, $value) = array_map("trim", explode("=", $line, 2));
@ -384,14 +386,14 @@ function DisplayOpenVPNConfig()
} else { } else {
echo '<input type="submit" class="btn btn-warning" name="StopOpenVPN" value="Stop OpenVPN" />' , PHP_EOL; echo '<input type="submit" class="btn btn-warning" name="StopOpenVPN" value="Stop OpenVPN" />' , PHP_EOL;
} }
?> ?>
</form> </form>
</div><!-- /.panel-body --> </div><!-- /.panel-body -->
</div><!-- /.panel-primary --> </div><!-- /.panel-primary -->
<div class="panel-footer"> Information provided by openvpn</div> <div class="panel-footer"> Information provided by openvpn</div>
</div><!-- /.col-lg-12 --> </div><!-- /.col-lg-12 -->
</div><!-- /.row --> </div><!-- /.row -->
<?php <?php
} }
/** /**
@ -420,7 +422,7 @@ function DisplayTorProxyConfig()
} }
} }
?> ?>
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
<div class="panel panel-primary"> <div class="panel panel-primary">
@ -535,7 +537,7 @@ function DisplayTorProxyConfig()
</div><!-- /.panel-primary --> </div><!-- /.panel-primary -->
</div><!-- /.col-lg-12 --> </div><!-- /.col-lg-12 -->
</div><!-- /.row --> </div><!-- /.row -->
<?php <?php
} }
/** /**
@ -585,7 +587,7 @@ function renderTemplate($name, $data = [])
return "template $name ($file) not found"; return "template $name ($file) not found";
} }
if (is_array($data)){ if (is_array($data)) {
extract($data); extract($data);
} }

View File

@ -59,10 +59,15 @@ function DisplayHostAPDConfig()
echo renderTemplate("hostapd", compact( echo renderTemplate("hostapd", compact(
"status", "status",
"serviceStatus", "hostapdstatus", "serviceStatus",
"interfaces", "arrConfig", "hostapdstatus",
"arr80211Standard", "selectedHwMode", "interfaces",
"arrSecurity", "arrEncType", "arrHostapdConf" "arrConfig",
"arr80211Standard",
"selectedHwMode",
"arrSecurity",
"arrEncType",
"arrHostapdConf"
)); ));
} }
@ -260,4 +265,3 @@ function SaveHostAPDConfig($wpa_array, $enc_types, $modes, $interfaces, $status)
return true; return true;
} }

View File

@ -1,5 +1,5 @@
<?php <?php
if (session_status() == PHP_SESSION_NONE) { if (session_status() == PHP_SESSION_NONE) {
session_start(); session_start();
} }

View File

@ -102,4 +102,3 @@ function DisplaySystem()
echo renderTemplate("system", compact("arrLocales", "status", "system")); echo renderTemplate("system", compact("arrLocales", "status", "system"));
} }

View File

@ -51,7 +51,7 @@ function nearbyWifiStations(&$networks, $cached = true)
deleteCache($cacheKey); deleteCache($cacheKey);
} }
$scan_results = cache($cacheKey, function() { $scan_results = cache($cacheKey, function () {
exec('sudo wpa_cli -i ' . RASPI_WIFI_CLIENT_INTERFACE . ' scan'); exec('sudo wpa_cli -i ' . RASPI_WIFI_CLIENT_INTERFACE . ' scan');
sleep(3); sleep(3);

View File

@ -5,7 +5,7 @@
<div class="panel-body"> <div class="panel-body">
<?php $status->showMessages(); ?> <?php $status->showMessages(); ?>
<form role="form" action="?page=auth_conf" method="POST"> <form role="form" action="?page=auth_conf" method="POST">
<?php echo CSRFTokenFieldTag() ?> <?php echo CSRFTokenFieldTag() ?>
<div class="row"> <div class="row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="username"><?php echo _("Username"); ?></label> <label for="username"><?php echo _("Username"); ?></label>

View File

@ -12,7 +12,7 @@
</div> </div>
<form method="POST" action="?page=wpa_conf" name="wpa_conf_form" class="row"> <form method="POST" action="?page=wpa_conf" name="wpa_conf_form" class="row">
<?php echo CSRFTokenFieldTag() ?> <?php echo CSRFTokenFieldTag() ?>
<input type="hidden" name="client_settings" ?> <input type="hidden" name="client_settings" ?>
<div class="js-wifi-stations loading-spinner"></div> <div class="js-wifi-stations loading-spinner"></div>
</form> </form>

View File

@ -1,9 +1,9 @@
<?php <?php
$arrHostapdConf = parse_ini_file('/etc/raspap/hostapd.ini'); $arrHostapdConf = parse_ini_file('/etc/raspap/hostapd.ini');
if ($arrHostapdConf['WifiAPEnable'] == 1) { if ($arrHostapdConf['WifiAPEnable'] == 1) {
$client_iface = 'uap0'; $client_iface = 'uap0';
} else { } else {
$client_iface = RASPI_WIFI_CLIENT_INTERFACE; $client_iface = RASPI_WIFI_CLIENT_INTERFACE;
} }
exec('cat '.RASPI_DNSMASQ_LEASES.'| grep -E $(arp -i '.$client_iface.' -n | grep -oE "(([0-9]|[a-f]|[A-F]){2}:){5}([0-9]|[a-f]|[A-F]){2}" | tr "\n" "\|" | sed "s/.$//")', $clients); exec('cat '.RASPI_DNSMASQ_LEASES.'| grep -E $(arp -i '.$client_iface.' -n | grep -oE "(([0-9]|[a-f]|[A-F]){2}:){5}([0-9]|[a-f]|[A-F]){2}" | tr "\n" "\|" | sed "s/.$//")', $clients);
?> ?>
@ -64,14 +64,14 @@ exec('cat '.RASPI_DNSMASQ_LEASES.'| grep -E $(arp -i '.$client_iface.' -n | grep
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($clients as $client): ?> <?php foreach ($clients as $client) : ?>
<?php $props = explode(' ', $client) ?> <?php $props = explode(' ', $client) ?>
<tr> <tr>
<td><?php echo htmlspecialchars($props[3], ENT_QUOTES) ?></td> <td><?php echo htmlspecialchars($props[3], ENT_QUOTES) ?></td>
<td><?php echo htmlspecialchars($props[2], ENT_QUOTES) ?></td> <td><?php echo htmlspecialchars($props[2], ENT_QUOTES) ?></td>
<td><?php echo htmlspecialchars($props[1], ENT_QUOTES) ?></td> <td><?php echo htmlspecialchars($props[1], ENT_QUOTES) ?></td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
</div><!-- /.table-responsive --> </div><!-- /.table-responsive -->
@ -83,14 +83,14 @@ exec('cat '.RASPI_DNSMASQ_LEASES.'| grep -E $(arp -i '.$client_iface.' -n | grep
<div class="col-lg-12"> <div class="col-lg-12">
<div class="row"> <div class="row">
<form action="?page=wlan0_info" method="POST"> <form action="?page=wlan0_info" method="POST">
<?php echo CSRFTokenFieldTag() ?> <?php echo CSRFTokenFieldTag() ?>
<?php if (!RASPI_MONITOR_ENABLED): ?> <?php if (!RASPI_MONITOR_ENABLED) : ?>
<?php if (!$wlan0up): ?> <?php if (!$wlan0up) : ?>
<input type="submit" class="btn btn-success" value="<?php echo _("Start ").RASPI_WIFI_CLIENT_INTERFACE ?>" name="ifup_wlan0" /> <input type="submit" class="btn btn-success" value="<?php echo _("Start ").RASPI_WIFI_CLIENT_INTERFACE ?>" name="ifup_wlan0" />
<?php else: ?> <?php else : ?>
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop ").RASPI_WIFI_CLIENT_INTERFACE ?>" name="ifdown_wlan0" /> <input type="submit" class="btn btn-warning" value="<?php echo _("Stop ").RASPI_WIFI_CLIENT_INTERFACE ?>" name="ifdown_wlan0" />
<?php endif ?> <?php endif ?>
<?php endif ?> <?php endif ?>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh") ?></a> <a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh") ?></a>
</form> </form>
</div> </div>

View File

@ -17,13 +17,13 @@
<h4><?php echo _('Hourly traffic amount'); ?></h4> <h4><?php echo _('Hourly traffic amount'); ?></h4>
<label for="cbxInterfacehourly"><?php echo _('interface'); ?></label> <label for="cbxInterfacehourly"><?php echo _('interface'); ?></label>
<select id="cbxInterfacehourly" class="form-control" name="interfacehourly"> <select id="cbxInterfacehourly" class="form-control" name="interfacehourly">
<?php foreach ($interfaces as $if): ?> <?php foreach ($interfaces as $if) : ?>
<?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?> <?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?>
<option value="<?php echo $if_quoted ?>"><?php echo $if_quoted ?></option> <option value="<?php echo $if_quoted ?>"><?php echo $if_quoted ?></option>
<?php endforeach ?> <?php endforeach ?>
</select> </select>
<div class="hidden alert alert-info" id="divLoaderBandwidthhourly"> <div class="hidden alert alert-info" id="divLoaderBandwidthhourly">
<?php echo sprintf(_("Loading %s bandwidth chart"), _('hourly')); ?> <?php echo sprintf(_("Loading %s bandwidth chart"), _('hourly')); ?>
</div> </div>
<div id="divChartBandwidthhourly"></div> <div id="divChartBandwidthhourly"></div>
<div id="divTableBandwidthhourly"></div> <div id="divTableBandwidthhourly"></div>
@ -36,13 +36,13 @@
<h4><?php echo _('Daily traffic amount'); ?></h4> <h4><?php echo _('Daily traffic amount'); ?></h4>
<label for="cbxInterfacedaily"><?php echo _('interface'); ?></label> <label for="cbxInterfacedaily"><?php echo _('interface'); ?></label>
<select id="cbxInterfacedaily" class="form-control" name="interfacedaily"> <select id="cbxInterfacedaily" class="form-control" name="interfacedaily">
<?php foreach ($interfaces as $if): ?> <?php foreach ($interfaces as $if) : ?>
<?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?> <?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?>
<option value="<?php echo $if_quoted ?>"><?php echo $if_quoted ?></option> <option value="<?php echo $if_quoted ?>"><?php echo $if_quoted ?></option>
<?php endforeach ?> <?php endforeach ?>
</select> </select>
<div class="hidden alert alert-info" id="divLoaderBandwidthdaily"> <div class="hidden alert alert-info" id="divLoaderBandwidthdaily">
<?php echo sprintf(_("Loading %s bandwidth chart"), _('daily')); ?> <?php echo sprintf(_("Loading %s bandwidth chart"), _('daily')); ?>
</div> </div>
<div id="divChartBandwidthdaily"></div> <div id="divChartBandwidthdaily"></div>
<div id="divTableBandwidthdaily"></div> <div id="divTableBandwidthdaily"></div>
@ -55,13 +55,13 @@
<h4><?php echo _("Monthly traffic amount"); ?></h4> <h4><?php echo _("Monthly traffic amount"); ?></h4>
<label for="cbxInterfacemonthly"><?php echo _('interface'); ?></label> <label for="cbxInterfacemonthly"><?php echo _('interface'); ?></label>
<select id="cbxInterfacemonthly" class="form-control" name="interfacemonthly"> <select id="cbxInterfacemonthly" class="form-control" name="interfacemonthly">
<?php foreach ($interfaces as $if): ?> <?php foreach ($interfaces as $if) : ?>
<?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?> <?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?>
<option value="<?php echo $if_quoted ?>"><?php echo $if_quoted ?></option> <option value="<?php echo $if_quoted ?>"><?php echo $if_quoted ?></option>
<?php endforeach ?> <?php endforeach ?>
</select> </select>
<div class="hidden alert alert-info" id="divLoaderBandwidthmonthly"> <div class="hidden alert alert-info" id="divLoaderBandwidthmonthly">
<?php echo sprintf(_("Loading %s bandwidth chart"), _('monthly')); ?> <?php echo sprintf(_("Loading %s bandwidth chart"), _('monthly')); ?>
</div> </div>
<div id="divChartBandwidthmonthly"></div> <div id="divChartBandwidthmonthly"></div>
<div id="divTableBandwidthmonthly"></div> <div id="divTableBandwidthmonthly"></div>

View File

@ -26,9 +26,9 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="code">Interface</label> <label for="code">Interface</label>
<select class="form-control" name="interface"> <select class="form-control" name="interface">
<?php foreach ($interfaces as $if): ?> <?php foreach ($interfaces as $if) : ?>
<?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?> <?php $if_quoted = htmlspecialchars($if, ENT_QUOTES) ?>
<?php $selected = $if === $conf['interface'] ? ' selected="selected"' : '' ?> <?php $selected = $if === $conf['interface'] ? ' selected="selected"' : '' ?>
<option value="<?php echo $if_quoted ?>"<?php echo $selected ?>><?php echo $if_quoted ?></option> <option value="<?php echo $if_quoted ?>"<?php echo $selected ?>><?php echo $if_quoted ?></option>
<?php endforeach ?> <?php endforeach ?>
</select> </select>
@ -63,11 +63,11 @@
</select> </select>
</div> </div>
</div> </div>
<?php if (!RASPI_MONITOR_ENABLED): ?> <?php if (!RASPI_MONITOR_ENABLED) : ?>
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" /> <input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" />
<?php if ($dnsmasq_state): ?> <?php if ($dnsmasq_state) : ?>
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop dnsmasq") ?>" name="stopdhcpd" /> <input type="submit" class="btn btn-warning" value="<?php echo _("Stop dnsmasq") ?>" name="stopdhcpd" />
<?php else: ?> <?php else : ?>
<input type="submit" class="btn btn-success" value="<?php echo _("Start dnsmasq") ?>" name="startdhcpd" /> <input type="submit" class="btn btn-success" value="<?php echo _("Start dnsmasq") ?>" name="startdhcpd" />
<?php endif ?> <?php endif ?>
<?php endif ?> <?php endif ?>
@ -93,12 +93,12 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($leases as $lease): ?> <?php foreach ($leases as $lease) : ?>
<?php foreach (explode(' ', $lease) as $prop): ?> <?php foreach (explode(' ', $lease) as $prop) : ?>
<tr> <tr>
<td><?php echo htmlspecialchars($prop, ENT_QUOTES) ?></td> <td><?php echo htmlspecialchars($prop, ENT_QUOTES) ?></td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
@ -111,8 +111,8 @@
<div class="tab-pane fade in" id="static-leases"> <div class="tab-pane fade in" id="static-leases">
<div class="dhcp-static-leases js-dhcp-static-lease-container"> <div class="dhcp-static-leases js-dhcp-static-lease-container">
<?php foreach ($dhcpHost as $host): ?> <?php foreach ($dhcpHost as $host) : ?>
<?php list($mac, $ip) = array_map("trim", explode(",", $host)); ?> <?php list($mac, $ip) = array_map("trim", explode(",", $host)); ?>
<div class="row dhcp-static-lease-row js-dhcp-static-lease-row"> <div class="row dhcp-static-lease-row js-dhcp-static-lease-row">
<div class="col-md-5 col-xs-5"> <div class="col-md-5 col-xs-5">
<input type="text" name="static_leases[mac][]" value="<?php echo htmlspecialchars($mac, ENT_QUOTES) ?>" placeholder="<?php echo _("MAC address") ?>" class="form-control"> <input type="text" name="static_leases[mac][]" value="<?php echo htmlspecialchars($mac, ENT_QUOTES) ?>" placeholder="<?php echo _("MAC address") ?>" class="form-control">
@ -153,7 +153,7 @@
</div> </div>
</div> </div>
</template> </template>
<?php if (!RASPI_MONITOR_ENABLED): ?> <?php if (!RASPI_MONITOR_ENABLED) : ?>
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" /> <input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" />
<?php <?php
if ($dnsmasq_state) { if ($dnsmasq_state) {

View File

@ -121,7 +121,7 @@
<?php <?php
$checkedWifiAPEnabled = ''; $checkedWifiAPEnabled = '';
if ($arrHostapdConf['WifiAPEnable'] == 1) { if ($arrHostapdConf['WifiAPEnable'] == 1) {
$checkedWifiAPEnabled = ' checked="checked"'; $checkedWifiAPEnabled = ' checked="checked"';
} }
?> ?>
<input id="chxwificlientap" name="wifiAPEnable" type="checkbox" class="form-check-input" data-toggle="toggle" data-on="Enabled" data-off="Disabled" data-width="100" value="1"<?php echo $checkedWifiAPEnabled; ?> /> <input id="chxwificlientap" name="wifiAPEnable" type="checkbox" class="form-check-input" data-toggle="toggle" data-on="Enabled" data-off="Disabled" data-width="100" value="1"<?php echo $checkedWifiAPEnabled; ?> />
@ -135,7 +135,7 @@ $checkedWifiAPEnabled = ' checked="checked"';
<?php <?php
$checkedLogEnabled = ''; $checkedLogEnabled = '';
if ($arrHostapdConf['LogEnable'] == 1) { if ($arrHostapdConf['LogEnable'] == 1) {
$checkedLogEnabled = ' checked="checked"'; $checkedLogEnabled = ' checked="checked"';
} }
?> ?>
<input id="chxlogenable" name="logEnable" type="checkbox" class="form-check-input" data-toggle="toggle" data-on="Enabled" data-off="Disabled" data-width="100" value="1"<?php echo $checkedLogEnabled; ?> /> <input id="chxlogenable" name="logEnable" type="checkbox" class="form-check-input" data-toggle="toggle" data-on="Enabled" data-off="Disabled" data-width="100" value="1"<?php echo $checkedLogEnabled; ?> />
@ -149,7 +149,7 @@ $checkedLogEnabled = ' checked="checked"';
<?php <?php
$checkedHiddenSSID = ''; $checkedHiddenSSID = '';
if ($arrConfig['ignore_broadcast_ssid'] == 1 || $arrConfig['ignore_broadcast_ssid'] == 2) { if ($arrConfig['ignore_broadcast_ssid'] == 1 || $arrConfig['ignore_broadcast_ssid'] == 2) {
$checkedHiddenSSID = ' checked="checked"'; $checkedHiddenSSID = ' checked="checked"';
} }
?> ?>
<input id="chxhiddenssid" name="hiddenSSID" type="checkbox" class="form-check-input" data-toggle="toggle" data-on="Enabled" data-off="Disabled" data-width="100" value="1"<?php echo $checkedHiddenSSID; ?> /> <input id="chxhiddenssid" name="hiddenSSID" type="checkbox" class="form-check-input" data-toggle="toggle" data-on="Enabled" data-off="Disabled" data-width="100" value="1"<?php echo $checkedHiddenSSID; ?> />
@ -433,8 +433,8 @@ if(ops[i].value == country){
</script> </script>
</div> </div>
</div><!-- /.panel-body --> </div><!-- /.panel-body -->
</div><!-- /.panel-primary --> </div><!-- /.panel-primary -->
<?php if (!RASPI_MONITOR_ENABLED): ?> <?php if (!RASPI_MONITOR_ENABLED) : ?>
<input type="submit" class="btn btn-outline btn-primary" name="SaveHostAPDSettings" value="<?php echo _("Save settings"); ?>" /> <input type="submit" class="btn btn-outline btn-primary" name="SaveHostAPDSettings" value="<?php echo _("Save settings"); ?>" />
<?php <?php
if ($hostapdstatus[0] == 0) { if ($hostapdstatus[0] == 0) {
@ -442,7 +442,7 @@ if(ops[i].value == country){
} else { } else {
echo '<input type="submit" class="btn btn-warning" name="StopHotspot" value="' . _("Stop hotspot") . '"/>' , PHP_EOL; echo '<input type="submit" class="btn btn-warning" name="StopHotspot" value="' . _("Stop hotspot") . '"/>' , PHP_EOL;
}; };
endif ?> endif ?>
</form> </form>
</div></div><!-- /.panel-primary --> </div></div><!-- /.panel-primary -->
<div class="panel-footer"> <?php echo _("Information provided by hostapd"); ?></div> <div class="panel-footer"> <?php echo _("Information provided by hostapd"); ?></div>

View File

@ -66,12 +66,12 @@ if ($cpuload > 90) {
</div> </div>
<form action="?page=system_info" method="POST"> <form action="?page=system_info" method="POST">
<?php echo CSRFTokenFieldTag() ?> <?php echo CSRFTokenFieldTag() ?>
<?php if (!RASPI_MONITOR_ENABLED): ?> <?php if (!RASPI_MONITOR_ENABLED) : ?>
<input type="submit" class="btn btn-warning" name="system_reboot" value="<?php echo _("Reboot"); ?>" /> <input type="submit" class="btn btn-warning" name="system_reboot" value="<?php echo _("Reboot"); ?>" />
<input type="submit" class="btn btn-warning" name="system_shutdown" value="<?php echo _("Shutdown"); ?>" /> <input type="submit" class="btn btn-warning" name="system_shutdown" value="<?php echo _("Shutdown"); ?>" />
<?php endif ?> <?php endif ?>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh") ?></a> <a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh") ?></a>
</form> </form>
</div> </div>
</div> </div>
@ -82,7 +82,7 @@ if ($cpuload > 90) {
<div class="row"> <div class="row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="code"><?php echo _("Select a language"); ?></label> <label for="code"><?php echo _("Select a language"); ?></label>
<?php SelectorOptions('locale', $arrLocales, $_SESSION['locale']); ?> <?php SelectorOptions('locale', $arrLocales, $_SESSION['locale']); ?>
</div> </div>
</div> </div>
<input type="submit" class="btn btn-outline btn-primary" name="SaveLanguage" value="<?php echo _("Save settings"); ?>" /> <input type="submit" class="btn btn-outline btn-primary" name="SaveLanguage" value="<?php echo _("Save settings"); ?>" />

View File

@ -14,7 +14,7 @@
</div> </div>
<form action="?page=system_info" method="POST"> <form action="?page=system_info" method="POST">
<?php echo CSRFTokenFieldTag() ?> <?php echo CSRFTokenFieldTag() ?>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh"); ?></a> <a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh"); ?></a>
</form> </form>

View File

@ -1,9 +1,9 @@
<?php if (empty($networks)): ?> <?php if (empty($networks)) : ?>
<p class="lead text-center"><?php echo _('No Wifi stations found') ?></p> <p class="lead text-center"><?php echo _('No Wifi stations found') ?></p>
<p class="text-center"><?php echo _('Click "Rescan" to search for nearby Wifi stations.') ?></p> <p class="text-center"><?php echo _('Click "Rescan" to search for nearby Wifi stations.') ?></p>
<?php endif ?> <?php endif ?>
<?php $index = 0; ?> <?php $index = 0; ?>
<?php foreach ($networks as $ssid => $network): ?> <?php foreach ($networks as $ssid => $network) : ?>
<div class="col-md-6"> <div class="col-md-6">
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">
@ -89,5 +89,5 @@
</div><!-- /.panel-default --> </div><!-- /.panel-default -->
</div><!-- /.col-md-6 --> </div><!-- /.col-md-6 -->
<?php $index += 1; ?> <?php $index += 1; ?>
<?php endforeach ?> <?php endforeach ?>