mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
Replace some double quoted strings with single quoted ones
This commit is contained in:
parent
1539f42313
commit
32d36429ff
@ -749,7 +749,7 @@ function return_gateway_groups_array()
|
||||
} elseif (!empty($gateway['interface'])) {
|
||||
$gatewayip = get_interface_gateway($gateway['friendlyiface']);
|
||||
} else {
|
||||
$gatewayip = "";
|
||||
$gatewayip = '';
|
||||
}
|
||||
|
||||
if (!empty($gateway['interface'])) {
|
||||
|
||||
@ -182,12 +182,12 @@ function legacy_interface_stats($ifs = null)
|
||||
return $stats;
|
||||
}
|
||||
|
||||
$current_interface = "";
|
||||
$current_interface = '';
|
||||
foreach ($out as $line) {
|
||||
if (strpos($line, 'Interface') === 0) {
|
||||
$current_interface = explode('(', explode(' ', $line)[1])[0];
|
||||
$stats[$current_interface] = array();
|
||||
} elseif ($current_interface != "") {
|
||||
} elseif ($current_interface != '') {
|
||||
$stat = explode(':', $line);
|
||||
$stats[$current_interface][trim($stat[0])] = trim($stat[1]);
|
||||
}
|
||||
@ -459,7 +459,7 @@ function legacy_serial_devices()
|
||||
}
|
||||
$serialports = array();
|
||||
foreach (glob("/dev/cua?[0-9]{,.[0-9]}", GLOB_BRACE) as $device) {
|
||||
$serialports[$device] = array('descr' => "");
|
||||
$serialports[$device] = array('descr' => '');
|
||||
$tty = explode('.', explode('cua', $device)[1])[0];
|
||||
foreach ($modems as $modem) {
|
||||
if (isset($modem['ttyname']) && $modem['ttyname'] == $tty) {
|
||||
|
||||
@ -39,7 +39,7 @@ require_once("notices.smtp.inc");
|
||||
* RESULT
|
||||
* Files a notice and kicks off the various alerts, smtp, system log, etc.
|
||||
******/
|
||||
function file_notice($id, $notice, $category = "General", $url = "", $priority = 1) {
|
||||
function file_notice($id, $notice, $category = 'General', $url = '', $priority = 1) {
|
||||
/*
|
||||
* $category - Category that this notice should be displayed under. This can be arbitrary,
|
||||
* but a page must be set to receive this messages for it to be displayed.
|
||||
@ -164,12 +164,13 @@ function print_notices($notices, $category = "all")
|
||||
}
|
||||
$categories = array_unique($categories);
|
||||
sort($categories);
|
||||
$toreturn = '';
|
||||
foreach($categories as $category) {
|
||||
$toreturn .= "<ul><li>{$category}<ul>";
|
||||
foreach($notices as $notice) {
|
||||
if(strtolower($notice['category']) == strtolower($category)) {
|
||||
if($notice['id'] != "") {
|
||||
if($notice['url'] != "") {
|
||||
if($notice['id'] != '') {
|
||||
if($notice['url'] != '') {
|
||||
$toreturn .= "<li><a href={$notice['url']}>{$notice['id']}</a> - {$notice['notice']}</li>";
|
||||
} else {
|
||||
$toreturn .= "<li>{$notice['id']} - {$notice['notice']}</li>";
|
||||
|
||||
@ -487,7 +487,7 @@ function unbound_add_domain_overrides($pvt = false)
|
||||
$result[$domain_key][] = $domain['ip'];
|
||||
}
|
||||
|
||||
$domain_entries = "";
|
||||
$domain_entries = '';
|
||||
foreach ($result as $domain => $ips) {
|
||||
if ($pvt == true) {
|
||||
$domain_entries .= "private-domain: \"$domain\"\n";
|
||||
@ -607,7 +607,7 @@ function unbound_add_host_entries()
|
||||
$added_item = array();
|
||||
|
||||
foreach ($config['unbound']['hosts'] as $host) {
|
||||
if ($host['host'] != "") {
|
||||
if ($host['host'] != '') {
|
||||
$host['host'] = $host['host'].".";
|
||||
}
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@ function is_numericint($arg)
|
||||
function gen_subnet($ipaddr, $bits)
|
||||
{
|
||||
if (!is_ipaddr($ipaddr) || !is_numeric($bits)) {
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
return long2ip(ip2long($ipaddr) & gen_subnet_mask_long($bits));
|
||||
}
|
||||
@ -199,7 +199,7 @@ function gen_subnetv6($ipaddr, $bits)
|
||||
/* return the highest (broadcast) address in the subnet given a host address and a subnet bit count */
|
||||
function gen_subnet_max($ipaddr, $bits) {
|
||||
if (!is_ipaddr($ipaddr) || !is_numeric($bits)) {
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
|
||||
return long2ip32(ip2long($ipaddr) | ~gen_subnet_mask_long($bits));
|
||||
@ -477,7 +477,7 @@ function is_linklocal($ipaddr)
|
||||
function get_ll_scope($addr)
|
||||
{
|
||||
if (!is_linklocal($addr) || !strstr($addr, "%")) {
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
list ($ll, $scope) = explode("%", $addr);
|
||||
return $scope;
|
||||
@ -1110,11 +1110,11 @@ function get_sysctl($names)
|
||||
function get_single_sysctl($name)
|
||||
{
|
||||
if (empty($name)) {
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
$value = get_sysctl($name);
|
||||
if (empty($value) || !isset($value[$name])) {
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
return $value[$name];
|
||||
}
|
||||
|
||||
@ -98,13 +98,13 @@ if($need_alert_display == true) {
|
||||
foreach($menuSystem as $topMenuItem): ?>
|
||||
<?php
|
||||
if (count($topMenuItem->Children) >= 1): ?>
|
||||
<a href="#<?=$topMenuItem->Id;?>" class="list-group-item <?= $topMenuItem->Selected ? 'active-menu-title' : ""; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="<?=$topMenuItem->CssClass;?> __iconspacer"></span><?=gettext($topMenuItem->VisibleName);?> </a>
|
||||
<div class="collapse <?=$topMenuItem->Selected ? 'active-menu in' :"";?>" id="<?=$topMenuItem->Id;?>">
|
||||
<a href="#<?=$topMenuItem->Id;?>" class="list-group-item <?= $topMenuItem->Selected ? 'active-menu-title' : ''; ?>" data-toggle="collapse" data-parent="#mainmenu"><span class="<?=$topMenuItem->CssClass;?> __iconspacer"></span><?=gettext($topMenuItem->VisibleName);?> </a>
|
||||
<div class="collapse <?=$topMenuItem->Selected ? 'active-menu in' :'';?>" id="<?=$topMenuItem->Id;?>">
|
||||
<?php
|
||||
foreach($topMenuItem->Children as $subMenuItem): ?>
|
||||
<?php
|
||||
if ($subMenuItem->Url == '' ):?>
|
||||
<a href="#<?=$topMenuItem->Id;?>_<?=$subMenuItem->Id;?>" class="list-group-item <?=$subMenuItem->Selected ? "active-menu-title" : "";?>" data-toggle="collapse" data-parent="#<?=$topMenuItem->Id;?>" aria-expanded="<?=$subMenuItem->Selected ? "true" : "false";?>">
|
||||
<a href="#<?=$topMenuItem->Id;?>_<?=$subMenuItem->Id;?>" class="list-group-item <?=$subMenuItem->Selected ? "active-menu-title" : '';?>" data-toggle="collapse" data-parent="#<?=$topMenuItem->Id;?>" aria-expanded="<?=$subMenuItem->Selected ? "true" : "false";?>">
|
||||
<div style="display: table;width: 100%;">
|
||||
<div style="display: table-row">
|
||||
<div style="display: table-cell"><?=gettext($subMenuItem->VisibleName);?></div>
|
||||
@ -112,22 +112,22 @@ if($need_alert_display == true) {
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<div class="collapse <?=$subMenuItem->Selected ? "active-menu in" :"";?>" id="<?=$topMenuItem->Id;?>_<?=$subMenuItem->Id;?>">
|
||||
<div class="collapse <?=$subMenuItem->Selected ? "active-menu in" :'';?>" id="<?=$topMenuItem->Id;?>_<?=$subMenuItem->Id;?>">
|
||||
<?php
|
||||
foreach ($subMenuItem->Children as $subsubMenuItem):?>
|
||||
<?php
|
||||
if ($subsubMenuItem->IsExternal == "Y"):?>
|
||||
<a href="<?=$subsubMenuItem->Url;?>" target="_blank" rel="noopener noreferrer" class="list-group-item menu-level-3-item <?=$subsubMenuItem->Selected ? "active" :"";?>"><?=gettext($subsubMenuItem->VisibleName);?></a>
|
||||
<a href="<?=$subsubMenuItem->Url;?>" target="_blank" rel="noopener noreferrer" class="list-group-item menu-level-3-item <?=$subsubMenuItem->Selected ? 'active' :'';?>"><?=gettext($subsubMenuItem->VisibleName);?></a>
|
||||
<?php
|
||||
elseif ($aclObj->isPageAccessible($_SESSION['Username'],$subsubMenuItem->Url)):?>
|
||||
<a href="<?=$subsubMenuItem->Url;?>" class="list-group-item menu-level-3-item <?=$subsubMenuItem->Selected ? "active" :"";?>"><?=gettext($subsubMenuItem->VisibleName);?></a>
|
||||
<a href="<?=$subsubMenuItem->Url;?>" class="list-group-item menu-level-3-item <?=$subsubMenuItem->Selected ? 'active' :'';?>"><?=gettext($subsubMenuItem->VisibleName);?></a>
|
||||
<?php
|
||||
endif;
|
||||
endforeach;?>
|
||||
</div>
|
||||
<?php
|
||||
elseif ($subMenuItem->IsExternal == "Y" ):?>
|
||||
<a href="<?=$subMenuItem->Url;?>" target="_blank" rel="noopener noreferrer" class="list-group-item <?=$subMenuItem->Selected ? "active" : "";?>" aria-expanded="<?=$subMenuItem->Selected ? "true" : "false";?>">
|
||||
<a href="<?=$subMenuItem->Url;?>" target="_blank" rel="noopener noreferrer" class="list-group-item <?=$subMenuItem->Selected ? 'active' : '';?>" aria-expanded="<?=$subMenuItem->Selected ? 'true' : 'false';?>">
|
||||
<div style="display: table;width: 100%;">
|
||||
<div style="display: table-row">
|
||||
<div style="display: table-cell"><?=gettext($subMenuItem->VisibleName);?></div>
|
||||
@ -137,7 +137,7 @@ if($need_alert_display == true) {
|
||||
</a>
|
||||
<?php
|
||||
elseif ($aclObj->isPageAccessible($_SESSION['Username'],$subMenuItem->Url)):?>
|
||||
<a href="<?=$subMenuItem->Url;?>" class="list-group-item <?=$subMenuItem->Selected ? "active" :"";?>">
|
||||
<a href="<?=$subMenuItem->Url;?>" class="list-group-item <?=$subMenuItem->Selected ? 'active' :'';?>">
|
||||
<div style="display: table;width: 100%;">
|
||||
<div style="display: table-row">
|
||||
<div style="display: table-cell"><?=gettext($subMenuItem->VisibleName);?></div>
|
||||
@ -155,12 +155,12 @@ if($need_alert_display == true) {
|
||||
else: ?>
|
||||
<?php
|
||||
if ($topMenuItem->IsExternal == "Y" ):?>
|
||||
<a href="<?=$topMenuItem->Url;?>" target="_blank" rel="noopener noreferrer" class="list-group-item <?=$topMenuItem->Selected ? "active-menu-title" : "";?>" data-parent="#mainmenu">
|
||||
<a href="<?=$topMenuItem->Url;?>" target="_blank" rel="noopener noreferrer" class="list-group-item <?=$topMenuItem->Selected ? 'active-menu-title' : '';?>" data-parent="#mainmenu">
|
||||
<span class="<?=$topMenuItem->CssClass;?> __iconspacer"></span><?=gettext($topMenuItem->VisibleName);?>
|
||||
</a>
|
||||
<?php
|
||||
elseif ($aclObj->isPageAccessible($_SESSION['Username'],$topMenuItem->Url)):?>
|
||||
<a href="<?=$topMenuItem->Url;?>" class="list-group-item <?=$topMenuItem->Selected ? "active-menu-title" : "";?>" data-parent="#mainmenu">
|
||||
<a href="<?=$topMenuItem->Url;?>" class="list-group-item <?=$topMenuItem->Selected ? 'active-menu-title' : '';?>" data-parent="#mainmenu">
|
||||
<span class="<?=$topMenuItem->CssClass;?> __iconspacer"></span><?=gettext($topMenuItem->VisibleName);?>
|
||||
</a>
|
||||
|
||||
@ -198,11 +198,11 @@ if($need_alert_display == true) {
|
||||
<a href="#" id="updatepref" style="display:none" onclick="return updatePref();" class="btn btn-primary"><?=gettext("Save Settings");?></a>
|
||||
<button id="add_widget_btn" type="button" class="btn btn-default" data-toggle="modal" data-target="#modal_widgets"><i class="fa fa-plus-circle fa-fw"></i> <?= gettext('Add widget') ?></button>
|
||||
<select class="selectpicker" data-width="120px" id="column_count">
|
||||
<option value="1" <?=$pconfig['column_count'] == "1" ? 'selected="selected"' : "";?>><?= gettext('1 column');?></option>
|
||||
<option value="2" <?=$pconfig['column_count'] == "2" ? 'selected="selected"' : "";?>><?= sprintf(gettext('%s columns'), '2') ?></option>
|
||||
<option value="3" <?=$pconfig['column_count'] == "3" ? 'selected="selected"' : "";?>><?= sprintf(gettext('%s columns'), '3') ?></option>
|
||||
<option value="4" <?=$pconfig['column_count'] == "4" ? 'selected="selected"' : "";?>><?= sprintf(gettext('%s columns'), '4') ?></option>
|
||||
<option value="6" <?=$pconfig['column_count'] == "6" ? 'selected="selected"' : "";?>><?= sprintf(gettext('%s columns'), '6') ?></option>
|
||||
<option value="1" <?=$pconfig['column_count'] == "1" ? 'selected="selected"' : '';?>><?= gettext('1 column');?></option>
|
||||
<option value="2" <?=$pconfig['column_count'] == "2" ? 'selected="selected"' : '';?>><?= sprintf(gettext('%s columns'), '2') ?></option>
|
||||
<option value="3" <?=$pconfig['column_count'] == "3" ? 'selected="selected"' : '';?>><?= sprintf(gettext('%s columns'), '3') ?></option>
|
||||
<option value="4" <?=$pconfig['column_count'] == "4" ? 'selected="selected"' : '';?>><?= sprintf(gettext('%s columns'), '4') ?></option>
|
||||
<option value="6" <?=$pconfig['column_count'] == "6" ? 'selected="selected"' : '';?>><?= sprintf(gettext('%s columns'), '6') ?></option>
|
||||
</select>
|
||||
<?php endif; ?>
|
||||
</form>
|
||||
|
||||
@ -151,7 +151,7 @@ include_once("head.inc");
|
||||
$(window).trigger('resize');
|
||||
})
|
||||
// show advanced when option set
|
||||
if ($("#outgoing_interface").val() != "" || $("#custom_options").val() != "" || $("#enable_wpad").prop('checked')) {
|
||||
if ($("#outgoing_interface").val() != '' || $("#custom_options").val() != '' || $("#enable_wpad").prop('checked')) {
|
||||
$("#show_advanced_dns").click();
|
||||
}
|
||||
});
|
||||
@ -180,7 +180,7 @@ include_once("head.inc");
|
||||
<tr>
|
||||
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Enable");?></td>
|
||||
<td>
|
||||
<input name="enable" type="checkbox" value="yes" <?=!empty($pconfig['enable']) ? "checked=\"checked\"" : "";?> />
|
||||
<input name="enable" type="checkbox" value="yes" <?=!empty($pconfig['enable']) ? 'checked="checked"' : '';?> />
|
||||
<?= gettext('Enable Unbound') ?>
|
||||
</td>
|
||||
</tr>
|
||||
@ -209,14 +209,14 @@ include_once("head.inc");
|
||||
<tr>
|
||||
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("DNSSEC");?></td>
|
||||
<td>
|
||||
<input name="dnssec" type="checkbox" value="yes" <?=!empty($pconfig['dnssec']) ? "checked=\"checked\"" : "";?> />
|
||||
<input name="dnssec" type="checkbox" value="yes" <?=!empty($pconfig['dnssec']) ? 'checked="checked"' : '';?> />
|
||||
<?= gettext('Enable DNSSEC Support') ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a id="help_for_regdhcp" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("DHCP Registration");?></td>
|
||||
<td>
|
||||
<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?=!empty($pconfig['regdhcp']) ? "checked=\"checked\"" : "";?> />
|
||||
<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?=!empty($pconfig['regdhcp']) ? 'checked="checked"' : '';?> />
|
||||
<?= gettext('Register DHCP leases') ?>
|
||||
<div class="hidden" data-for="help_for_regdhcp">
|
||||
<?= gettext("If this option is set, then machines that specify " .
|
||||
@ -240,7 +240,7 @@ include_once("head.inc");
|
||||
<tr>
|
||||
<td><a id="help_for_regdhcpstatic" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?= gettext('DHCP Static Mappings');?></td>
|
||||
<td>
|
||||
<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?=!empty($pconfig['regdhcpstatic']) ? "checked=\"checked\"" : "";?> />
|
||||
<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?=!empty($pconfig['regdhcpstatic']) ? 'checked="checked"' : '';?> />
|
||||
<?= gettext('Register DHCP static mappings') ?>
|
||||
<div class="hidden" data-for="help_for_regdhcpstatic">
|
||||
<?= sprintf(gettext("If this option is set, then DHCP static mappings will ".
|
||||
@ -266,7 +266,7 @@ include_once("head.inc");
|
||||
<tr>
|
||||
<td><a id="help_for_txtsupport" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("TXT Comment Support");?></td>
|
||||
<td>
|
||||
<input name="txtsupport" type="checkbox" value="yes" <?=!empty($pconfig['txtsupport']) ? "checked=\"checked\"" : "";?> />
|
||||
<input name="txtsupport" type="checkbox" value="yes" <?=!empty($pconfig['txtsupport']) ? 'checked="checked"' : '';?> />
|
||||
<?= gettext('Create corresponding TXT records') ?>
|
||||
<div class="hidden" data-for="help_for_txtsupport">
|
||||
<?=gettext("If this option is set, then any descriptions associated with Host entries and DHCP Static mappings will create a corresponding TXT record.");?><br />
|
||||
@ -276,7 +276,7 @@ include_once("head.inc");
|
||||
<tr>
|
||||
<td><a id="help_for_forwarding" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("DNS Query Forwarding");?></td>
|
||||
<td>
|
||||
<input name="forwarding" type="checkbox" value="yes" <?=!empty($pconfig['forwarding']) ? "checked=\"checked\"" : "";?> />
|
||||
<input name="forwarding" type="checkbox" value="yes" <?=!empty($pconfig['forwarding']) ? 'checked="checked"' : '';?> />
|
||||
<?= gettext('Enable Forwarding Mode') ?>
|
||||
<div class="hidden" data-for="help_for_forwarding">
|
||||
<?= gettext('The configured system nameservers will be used to forward queries to.') ?>
|
||||
@ -316,7 +316,7 @@ include_once("head.inc");
|
||||
<td>
|
||||
<select id="outgoing_interface" name="outgoing_interface[]" multiple="multiple" class="selectpicker" title="<?= html_safe(gettext('All (recommended)')) ?>">
|
||||
<?php foreach ($interfaces as $ifname => $ifdescr): ?>
|
||||
<option value="<?= html_safe($ifname) ?>" <?=!empty($pconfig['outgoing_interface'][0]) && in_array($ifname, $pconfig['outgoing_interface']) ? 'selected="selected"' : "" ?>>
|
||||
<option value="<?= html_safe($ifname) ?>" <?=!empty($pconfig['outgoing_interface'][0]) && in_array($ifname, $pconfig['outgoing_interface']) ? 'selected="selected"' : '' ?>>
|
||||
<?= html_safe($ifdescr) ?>
|
||||
</option>
|
||||
<?php endforeach ?>
|
||||
@ -330,7 +330,7 @@ include_once("head.inc");
|
||||
<tr class="showadv" style="display:none">
|
||||
<td><a id="help_for_enable_wpad" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("WPAD Records");?></td>
|
||||
<td>
|
||||
<input id="enable_wpad" name="enable_wpad" type="checkbox" value="yes" <?=!empty($pconfig['enable_wpad']) ? "checked=\"checked\"" : "";?> />
|
||||
<input id="enable_wpad" name="enable_wpad" type="checkbox" value="yes" <?=!empty($pconfig['enable_wpad']) ? 'checked="checked"' : '';?> />
|
||||
<div class="hidden" data-for="help_for_enable_wpad">
|
||||
<?=gettext("If this option is set, CNAME records for the WPAD host of all configured domains will be automatically added as well as overrides for TXT records for domains. " .
|
||||
"This allows automatic proxy configuration in your network but you should not enable it if you are not using WPAD or if you want to configure it by yourself.");?><br />
|
||||
@ -345,14 +345,14 @@ include_once("head.inc");
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<?= sprintf(gettext("If Unbound is enabled, the DHCP".
|
||||
" service (if enabled) will automatically serve the LAN IP".
|
||||
" address as a DNS server to DHCP clients so they will use".
|
||||
" Unbound resolver. If forwarding is enabled, Unbound".
|
||||
" will use the DNS servers entered in %sSystem: General setup%s".
|
||||
" or those obtained via DHCP or PPP on WAN if the \"Allow".
|
||||
" DNS server list to be overridden by DHCP/PPP on WAN\"".
|
||||
" is checked."),'<a href="system_general.php">','</a>');?>
|
||||
<?= sprintf(gettext('If Unbound is enabled, the DHCP'.
|
||||
' service (if enabled) will automatically serve the LAN IP'.
|
||||
' address as a DNS server to DHCP clients so they will use'.
|
||||
' Unbound resolver. If forwarding is enabled, Unbound'.
|
||||
' will use the DNS servers entered in %sSystem: General setup%s'.
|
||||
' or those obtained via DHCP or PPP on WAN if the "Allow'.
|
||||
' DNS server list to be overridden by DHCP/PPP on WAN"'.
|
||||
' is checked.'),'<a href="system_general.php">','</a>');?>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@ -45,9 +45,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$act = null;
|
||||
}
|
||||
$pconfig = array();
|
||||
$pconfig['aclname'] = isset($id) && !empty($a_acls[$id]['aclname']) ? $a_acls[$id]['aclname'] : "";
|
||||
$pconfig['aclaction'] = isset($id) && !empty($a_acls[$id]['aclaction']) ? $a_acls[$id]['aclaction'] : "";
|
||||
$pconfig['description'] = isset($id) && !empty($a_acls[$id]['description']) ? $a_acls[$id]['description'] : "";
|
||||
$pconfig['aclname'] = isset($id) && !empty($a_acls[$id]['aclname']) ? $a_acls[$id]['aclname'] : '';
|
||||
$pconfig['aclaction'] = isset($id) && !empty($a_acls[$id]['aclaction']) ? $a_acls[$id]['aclaction'] : '';
|
||||
$pconfig['description'] = isset($id) && !empty($a_acls[$id]['description']) ? $a_acls[$id]['description'] : '';
|
||||
$pconfig['row'] = isset($id) && !empty($a_acls[$id]['row']) ? $a_acls[$id]['row'] : array();
|
||||
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$input_errors = array();
|
||||
@ -139,7 +139,7 @@ if (!isset($_GET['act'])) {
|
||||
function removeRow() {
|
||||
if ( $('#acl_networks_table > tbody > tr').length == 1 ) {
|
||||
$('#acl_networks_table > tbody > tr:last > td > input').each(function(){
|
||||
$(this).val("");
|
||||
$(this).val('');
|
||||
});
|
||||
} else {
|
||||
$(this).parent().parent().remove();
|
||||
@ -150,7 +150,7 @@ if (!isset($_GET['act'])) {
|
||||
// copy last row and reset values
|
||||
$('#acl_networks_table > tbody').append('<tr>'+$('#acl_networks_table > tbody > tr:last').html()+'</tr>');
|
||||
$('#acl_networks_table > tbody > tr:last > td > input').each(function(){
|
||||
$(this).val("");
|
||||
$(this).val('');
|
||||
});
|
||||
// link network / cidr
|
||||
var item_cnt = $('#acl_networks_table > tbody > tr').length;
|
||||
@ -227,22 +227,22 @@ if (!isset($_GET['act'])) {
|
||||
<td><a id="help_for_aclaction" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Action");?></td>
|
||||
<td>
|
||||
<select name="aclaction" class="selectpicker">
|
||||
<option value="allow" <?= $pconfig['aclaction'] == "allow" ? "selected=\"selected\"" : ""; ?>>
|
||||
<option value="allow" <?= $pconfig['aclaction'] == "allow" ? 'selected="selected"' : ''; ?>>
|
||||
<?=gettext("Allow");?>
|
||||
</option>
|
||||
<option value="deny" <?= $pconfig['aclaction'] == "deny" ? "selected=\"selected\"" : ""; ?>>
|
||||
<option value="deny" <?= $pconfig['aclaction'] == "deny" ? 'selected="selected"' : ''; ?>>
|
||||
<?=gettext("Deny");?>
|
||||
</option>
|
||||
<option value="refuse" <?= $pconfig['aclaction'] == "refuse" ? "selected=\"selected\"" : ""; ?>>
|
||||
<option value="refuse" <?= $pconfig['aclaction'] == "refuse" ? 'selected="selected"' : ''; ?>>
|
||||
<?=gettext("Refuse");?>
|
||||
</option>
|
||||
<option value="allow snoop" <?= $pconfig['aclaction'] == "allow snoop" ? "selected=\"selected\"" : ""; ?>>
|
||||
<option value="allow snoop" <?= $pconfig['aclaction'] == "allow snoop" ? 'selected="selected"' : ''; ?>>
|
||||
<?=gettext("Allow Snoop");?>
|
||||
</option>
|
||||
<option value="deny nonlocal" <?= $pconfig['aclaction'] == "deny nonlocal" ? "selected=\"selected\"" : ""; ?>>
|
||||
<option value="deny nonlocal" <?= $pconfig['aclaction'] == "deny nonlocal" ? 'selected="selected"' : ''; ?>>
|
||||
<?=gettext("Deny Non-local");?>
|
||||
</option>
|
||||
<option value="refuse nonlocal" <?= $pconfig['aclaction'] == "refuse nonlocal" ? "selected=\"selected\"" : ""; ?>>
|
||||
<option value="refuse nonlocal" <?= $pconfig['aclaction'] == "refuse nonlocal" ? 'selected="selected"' : ''; ?>>
|
||||
<?=gettext("Refuse Non-local");?>
|
||||
</option>
|
||||
</select>
|
||||
@ -289,7 +289,7 @@ if (!isset($_GET['act'])) {
|
||||
<select name="acl_networks_mask[]" data-network-id="acl_network_<?=$item_idx;?>" class="ipv4v6net" id="mask<?=$item_idx;?>">
|
||||
<?php
|
||||
for ($i = 128; $i > 0; $i--):?>
|
||||
<option value="<?=$i;?>" <?= $item['mask'] == $i ? "selected=\"selected\"" : ""?>>
|
||||
<option value="<?=$i;?>" <?= $item['mask'] == $i ? 'selected="selected"' : ''?>>
|
||||
<?=$i;?>
|
||||
</option>
|
||||
<?php
|
||||
|
||||
@ -200,7 +200,7 @@ include("head.inc");
|
||||
<?php
|
||||
$rrs = array("A" => gettext("A or AAAA (IPv4 or IPv6 address)"), "MX" => gettext("MX (Mail server)"));
|
||||
foreach ($rrs as $rr => $name) :?>
|
||||
<option value="<?=$rr;?>" <?=($rr == $pconfig['rr'] || ($rr == 'A' && $pconfig['rr'] == 'AAAA')) ? "selected=\"selected\"" : "";?> >
|
||||
<option value="<?=$rr;?>" <?=($rr == $pconfig['rr'] || ($rr == 'A' && $pconfig['rr'] == 'AAAA')) ? 'selected="selected"' : '';?> >
|
||||
<?=$name;?>
|
||||
</option>
|
||||
<?php
|
||||
|
||||
@ -188,9 +188,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
}
|
||||
);
|
||||
|
||||
$exp_data = "";
|
||||
$exp_data = '';
|
||||
$res_crt = openssl_x509_read(base64_decode($a_cert[$id]['crt']));
|
||||
$res_key = openssl_pkey_get_private(array(0 => base64_decode($a_cert[$id]['prv']) , 1 => ""));
|
||||
$res_key = openssl_pkey_get_private(array(0 => base64_decode($a_cert[$id]['prv']) , 1 => ''));
|
||||
|
||||
openssl_pkcs12_export($res_crt, $exp_data, $res_key, null, $args);
|
||||
$exp_size = strlen($exp_data);
|
||||
@ -588,7 +588,7 @@ if (empty($act)) {
|
||||
function removeRowAltNm() {
|
||||
if ( $('#altNametable > tbody > tr').length == 1 ) {
|
||||
$('#altNametable > tbody > tr:last > td > input').each(function(){
|
||||
$(this).val("");
|
||||
$(this).val('');
|
||||
});
|
||||
} else {
|
||||
$(this).parent().parent().remove();
|
||||
@ -606,7 +606,7 @@ if (empty($act)) {
|
||||
// copy last row and reset values
|
||||
$('#altNametable > tbody').append('<tr>'+$('#altNametable > tbody > tr:last').html()+'</tr>');
|
||||
$('#altNametable > tbody > tr:last > td > input').each(function(){
|
||||
$(this).val("");
|
||||
$(this).val('');
|
||||
});
|
||||
$(".act-removerow-altnm").click(removeRowAltNm);
|
||||
});
|
||||
@ -726,7 +726,7 @@ $( document ).ready(function() {
|
||||
<select name="certmethod" id="certmethod">
|
||||
<?php
|
||||
foreach ($cert_methods as $method => $desc) :?>
|
||||
<option value="<?=$method;?>" <?=$pconfig['certmethod'] == $method ? "selected=\"selected\"":"";?>>
|
||||
<option value="<?=$method;?>" <?=$pconfig['certmethod'] == $method ? 'selected="selected"' : ''; ?>>
|
||||
<?=$desc;?>
|
||||
</option>
|
||||
<?php
|
||||
@ -786,7 +786,7 @@ $( document ).ready(function() {
|
||||
if (!$ca['prv']) {
|
||||
continue;
|
||||
}?>
|
||||
<option value="<?=$ca['refid'];?>" <?=isset($pconfig['caref']) && isset($ca['refid']) && $pconfig['caref'] == $ca['refid'] ? "selected=\"selected\"" : "";?>><?=$ca['descr'];?></option>
|
||||
<option value="<?=$ca['refid'];?>" <?=isset($pconfig['caref']) && isset($ca['refid']) && $pconfig['caref'] == $ca['refid'] ? 'selected="selected"' : '';?>><?=$ca['descr'];?></option>
|
||||
<?php
|
||||
endforeach; ?>
|
||||
</select>
|
||||
@ -799,9 +799,9 @@ $( document ).ready(function() {
|
||||
<td><a id="help_for_digest_cert_type" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Type");?> </td>
|
||||
<td>
|
||||
<select name="cert_type">
|
||||
<option value="usr_cert" <?=$pconfig['cert_type'] == 'usr_cert' ? "selected=\"selected\"" : "";?>> <?=gettext("Client Certificate");?> </option>
|
||||
<option value="server_cert" <?=$pconfig['cert_type'] == 'server_cert' ? "selected=\"selected\"" : "";?>> <?=gettext("Server Certificate");?> </option>
|
||||
<option value="v3_ca" <?=$pconfig['cert_type'] == 'v3_ca' ? "selected=\"selected\"" : "";?>> <?=gettext("Certificate Authority");?> </option>
|
||||
<option value="usr_cert" <?=$pconfig['cert_type'] == 'usr_cert' ? 'selected="selected"' : '';?>> <?=gettext("Client Certificate");?> </option>
|
||||
<option value="server_cert" <?=$pconfig['cert_type'] == 'server_cert' ? 'selected="selected"' : '';?>> <?=gettext("Server Certificate");?> </option>
|
||||
<option value="v3_ca" <?=$pconfig['cert_type'] == 'v3_ca' ? 'selected="selected"' : '';?>> <?=gettext("Certificate Authority");?> </option>
|
||||
</select>
|
||||
<div class="hidden" data-for="help_for_digest_cert_type">
|
||||
<?=gettext("Choose the type of certificate to generate here, the type defines it's constraints");?>
|
||||
@ -814,7 +814,7 @@ $( document ).ready(function() {
|
||||
<select name='keylen'>
|
||||
<?php
|
||||
foreach ($cert_keylens as $len) :?>
|
||||
<option value="<?=$len;?>" <?=$pconfig['keylen'] == $len ? "selected=\"selected\"" : "";?>><?=$len;?></option>
|
||||
<option value="<?=$len;?>" <?=$pconfig['keylen'] == $len ? 'selected="selected"' : '';?>><?=$len;?></option>
|
||||
<?php
|
||||
endforeach; ?>
|
||||
</select>
|
||||
@ -826,7 +826,7 @@ $( document ).ready(function() {
|
||||
<select name='digest_alg' id='digest_alg'>
|
||||
<?php
|
||||
foreach ($openssl_digest_algs as $digest_alg) :?>
|
||||
<option value="<?=$digest_alg;?>" <?=$pconfig['digest_alg'] == $digest_alg ? "selected=\"selected\"" : "";?>>
|
||||
<option value="<?=$digest_alg;?>" <?=$pconfig['digest_alg'] == $digest_alg ? 'selected="selected"' : '';?>>
|
||||
<?=strtoupper($digest_alg);?>
|
||||
</option>
|
||||
<?php
|
||||
@ -852,7 +852,7 @@ $( document ).ready(function() {
|
||||
<select name="dn_country" id="dn_country" class="selectpicker">
|
||||
<?php
|
||||
foreach (get_country_codes() as $cc => $cn):?>
|
||||
<option value="<?=$cc;?>" <?=$pconfig['dn_country'] == $cc ? "selected=\"selected\"" : "";?>>
|
||||
<option value="<?=$cc;?>" <?=$pconfig['dn_country'] == $cc ? 'selected="selected"' : '';?>>
|
||||
<?=$cc;?> (<?=$cn;?>)
|
||||
</option>
|
||||
<?php
|
||||
@ -952,10 +952,10 @@ $( document ).ready(function() {
|
||||
<tr>
|
||||
<td>
|
||||
<select name="altname_type[]" id="altname_type">
|
||||
<option value="DNS" <?=$altname_type == "DNS" ? "selected=\"selected\"" : "";?>><?=gettext("DNS");?></option>
|
||||
<option value="IP" <?=$altname_type == "IP" ? "selected=\"selected\"" : "";?>><?=gettext("IP");?></option>
|
||||
<option value="email" <?=$altname_type == "email" ? "selected=\"selected\"" : "";?>><?=gettext("email");?></option>
|
||||
<option value="URI" <?=$altname_type == "URI" ? "selected=\"selected\"" : "";?>><?=gettext("URI");?></option>
|
||||
<option value="DNS" <?=$altname_type == 'DNS' ? 'selected="selected"' : '';?>><?=gettext('DNS');?></option>
|
||||
<option value="IP" <?=$altname_type == 'IP' ? 'selected="selected"' : '';?>><?=gettext('IP');?></option>
|
||||
<option value="email" <?=$altname_type == 'email' ? 'selected="selected"' : '';?>><?=gettext('email');?></option>
|
||||
<option value="URI" <?=$altname_type == 'URI' ? 'selected="selected"' : '';?>><?=gettext('URI');?></option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user