diff options
Diffstat (limited to 'src/usr/local/www')
21 files changed, 99 insertions, 46 deletions
diff --git a/src/usr/local/www/diag_backup.php b/src/usr/local/www/diag_backup.php index 7e75e7e..c236ac3 100644 --- a/src/usr/local/www/diag_backup.php +++ b/src/usr/local/www/diag_backup.php @@ -372,7 +372,7 @@ if ($_POST) { /* this will be picked up by /index.php */ conf_mount_rw(); mark_subsystem_dirty("restore"); - touch("/conf/needs_package_sync"); + touch("/conf/needs_package_sync_after_reboot"); /* remove cache, we will force a config reboot */ if (file_exists("{$g['tmp_path']}/config.cache")) { unlink("{$g['tmp_path']}/config.cache"); diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php index c67c3cc..e89e934 100644 --- a/src/usr/local/www/firewall_nat.php +++ b/src/usr/local/www/firewall_nat.php @@ -353,7 +353,7 @@ foreach ($a_nat as $natent): <td> <a class="fa fa-pencil" title="<?=gettext("Edit rule"); ?>" href="firewall_nat_edit.php?id=<?=$i?>"></a> <a class="fa fa-clone" title="<?=gettext("Add a new NAT based on this one")?>" href="firewall_nat_edit.php?dup=<?=$i?>"></a> - <a class="fa fa-trash" title="<?=gettext("Delete rule")?>" href="firewall_nat.php?act=del&id=<?=$i?>" onclick="return confirm('<?=gettext("Are you sure you want to delete this rule?")?>')"></a> + <a class="fa fa-trash" title="<?=gettext("Delete rule")?>" href="firewall_nat.php?act=del&id=<?=$i?>"></a> </td> </tr> <?php diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php index f0aea90..0c09a59 100644 --- a/src/usr/local/www/firewall_nat_edit.php +++ b/src/usr/local/www/firewall_nat_edit.php @@ -531,7 +531,7 @@ if ($_POST) { } function build_srctype_list() { - global $pconfig, $ifdisp; + global $pconfig, $ifdisp, $config; $list = array('any' => 'Any', 'single' => 'Single host or alias', 'network' => 'Network'); @@ -553,6 +553,26 @@ function build_srctype_list() { return($list); } +function srctype_selected() { + global $pconfig, $config; + + $selected = ""; + + $sel = is_specialnet($pconfig['src']); + if (!$sel) { + if ($pconfig['srcmask'] == 32) { + $selected = 'single'; + } else { + $selected = 'network'; + } + } else { + $selected = $pconfig['src']; + } + + + return($selected); +} + function build_dsttype_list() { global $pconfig, $config, $ifdisp; @@ -599,33 +619,26 @@ function build_dsttype_list() { } function dsttype_selected() { - global $pconfig; - - $sel = is_specialnet($pconfig['dst']); - - if (!$sel) { - if ($pconfig['dstmask'] == 32) - return('single'); - - return('network'); - } + global $pconfig, $config; - return($pconfig['dst']); -} - -function srctype_selected() { - global $pconfig; - - $sel = is_specialnet($pconfig['src']); + $selected = ""; - if (!$sel) { - if ($pconfig['srcmask'] == 32) - return('single'); - - return('network'); + if (is_array($config['virtualip']['vip'])) { + $selected = $pconfig['dst']; + } else { + $sel = is_specialnet($pconfig['dst']); + if (!$sel) { + if ($pconfig['dstmask'] == 32) { + $selected = 'single'; + } else { + $selected = 'network'; + } + } else { + $selected = $pconfig['dst']; + } } - return($pconfig['src']); + return($selected); } $closehead = false; @@ -693,7 +706,20 @@ $section->addInput(new Form_Select( array_combine(explode(" ", strtolower($protocols)), explode(" ", $protocols)) ))->setHelp('Choose which protocol this rule should match. In most cases "TCP" is specified.'); +$btnsrcadv = new Form_Button( + 'srcadv', + 'Advanced' +); + +$btnsrcadv->removeClass('btn-primary')->addClass('btn-default'); + +$section->addInput(new Form_StaticText( + 'Source', + $btnsrcadv +)); + $group = new Form_Group('Source'); +$group->addClass('srcadv'); $group->add(new Form_Checkbox( 'srcnot', @@ -1172,6 +1198,12 @@ events.push(function(){ } } + function hideSource(hide) { + hideClass('srcadv', hide); + hideClass('srcportrange', hide || !portsenabled); + hideInput('srcadv', !hide); + } + // ---------- "onclick" functions --------------------------------------------------------------------------------- $('#srcbeginport').on('change', function() { src_rep_change(); @@ -1219,14 +1251,19 @@ events.push(function(){ typesel_change(); }); + $("#srcadv").click(function() { + hideSource(false); + }); // ---------- On initial page load -------------------------------------------------------------------------------- + $("#srcadv").prop('type' ,'button'); ext_change(); dst_change($('#interface').val(),'<?=htmlspecialchars($pconfig['interface'])?>','<?=htmlspecialchars($pconfig['dst'])?>'); iface_old = $('#interface').val(); typesel_change(); proto_change(); nordr_change(); + hideSource(true); // --------- Autocomplete ----------------------------------------------------------------------------------------- var addressarray = <?= json_encode(get_alias_list(array("host", "network", "openvpn", "urltable"))) ?>; diff --git a/src/usr/local/www/firewall_shaper.php b/src/usr/local/www/firewall_shaper.php index e439aed..9783808 100644 --- a/src/usr/local/www/firewall_shaper.php +++ b/src/usr/local/www/firewall_shaper.php @@ -76,7 +76,7 @@ if ($_GET['reset'] != "") { exit; } -$pgtitle = array(gettext("Firewall"), gettext("Traffic Shaper")); +$pgtitle = array(gettext("Firewall"), gettext("Traffic Shaper"), gettext("Interfaces")); $shortcut_section = "trafficshaper"; $shaperIFlist = get_configured_interface_with_descr(); diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php index 8e8a0cc..927600c 100644 --- a/src/usr/local/www/services_unbound.php +++ b/src/usr/local/www/services_unbound.php @@ -251,7 +251,7 @@ function build_if_list($selectedifs) { } $closehead = false; -$pgtitle = array(gettext("Services"), gettext("DNS Resolver")); +$pgtitle = array(gettext("Services"), gettext("DNS Resolver"), gettext("General")); $shortcut_section = "resolver"; include_once("head.inc"); diff --git a/src/usr/local/www/system_advanced_admin.php b/src/usr/local/www/system_advanced_admin.php index a4c4c62..03d2f0d 100644 --- a/src/usr/local/www/system_advanced_admin.php +++ b/src/usr/local/www/system_advanced_admin.php @@ -317,7 +317,7 @@ if ($_POST) { } } -$pgtitle = array(gettext("System"), gettext("Advanced: Admin Access")); +$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Admin Access")); include("head.inc"); if ($input_errors) diff --git a/src/usr/local/www/system_advanced_firewall.php b/src/usr/local/www/system_advanced_firewall.php index edce9f6..ab3d7d8 100644 --- a/src/usr/local/www/system_advanced_firewall.php +++ b/src/usr/local/www/system_advanced_firewall.php @@ -402,7 +402,7 @@ if ($_POST) { } } -$pgtitle = array(gettext("System"), gettext("Advanced: Firewall and NAT")); +$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Firewall and NAT")); include("head.inc"); if ($input_errors) diff --git a/src/usr/local/www/system_advanced_misc.php b/src/usr/local/www/system_advanced_misc.php index 24ed18c..b462849 100644 --- a/src/usr/local/www/system_advanced_misc.php +++ b/src/usr/local/www/system_advanced_misc.php @@ -315,7 +315,7 @@ if ($_POST) { } } -$pgtitle = array(gettext("System"), gettext("Advanced: Miscellaneous")); +$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Miscellaneous")); include("head.inc"); if ($input_errors) diff --git a/src/usr/local/www/system_advanced_network.php b/src/usr/local/www/system_advanced_network.php index 80ea22f..6a3f3f5 100644 --- a/src/usr/local/www/system_advanced_network.php +++ b/src/usr/local/www/system_advanced_network.php @@ -171,7 +171,7 @@ if ($_POST) { } } -$pgtitle = array(gettext("System"), gettext("Advanced: Networking")); +$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Networking")); include("head.inc"); if ($input_errors) diff --git a/src/usr/local/www/system_advanced_notifications.php b/src/usr/local/www/system_advanced_notifications.php index dadfb8a..bdc6034 100644 --- a/src/usr/local/www/system_advanced_notifications.php +++ b/src/usr/local/www/system_advanced_notifications.php @@ -199,7 +199,7 @@ if ($_POST) { } } -$pgtitle = array(gettext("System"), gettext("Advanced: Notifications")); +$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("Notifications")); include("head.inc"); if ($input_errors) @@ -358,7 +358,7 @@ $section->addInput(new Form_Input( 'submit', 'Test SMTP settings' ))->addClass('btn-info')->setHelp('A test notification will be sent even if the service is '. - 'marked as disabled.'); + 'marked as disabled. The last SAVED values will be used, not necessarily the values entered here.'); $form->add($section); diff --git a/src/usr/local/www/system_advanced_sysctl.php b/src/usr/local/www/system_advanced_sysctl.php index 423ed74..8d1e0b0 100644 --- a/src/usr/local/www/system_advanced_sysctl.php +++ b/src/usr/local/www/system_advanced_sysctl.php @@ -166,7 +166,7 @@ if ($_POST) { } } -$pgtitle = array(gettext("System"), gettext("Advanced: System Tunables")); +$pgtitle = array(gettext("System"), gettext("Advanced"), gettext("System Tunables")); include("head.inc"); if ($input_errors) diff --git a/src/usr/local/www/system_authservers.php b/src/usr/local/www/system_authservers.php index 7f10912..821fc68 100644 --- a/src/usr/local/www/system_authservers.php +++ b/src/usr/local/www/system_authservers.php @@ -67,7 +67,7 @@ require("guiconfig.inc"); require_once("auth.inc"); -$pgtitle = array(gettext("System"), gettext("Authentication Servers")); +$pgtitle = array(gettext("System"), gettext("User Manager"), gettext("Authentication Servers")); $shortcut_section = "authentication"; if (is_numericint($_GET['id'])) { diff --git a/src/usr/local/www/system_camanager.php b/src/usr/local/www/system_camanager.php index 6e5459a..59c1f8e 100644 --- a/src/usr/local/www/system_camanager.php +++ b/src/usr/local/www/system_camanager.php @@ -75,7 +75,7 @@ $ca_methods = array( $ca_keylens = array("512", "1024", "2048", "4096"); $openssl_digest_algs = array("sha1", "sha224", "sha256", "sha384", "sha512"); -$pgtitle = array(gettext("System"), gettext("Certificate Authority Manager")); +$pgtitle = array(gettext("System"), gettext("Certificate Manager"), gettext("CAs")); if (is_numericint($_GET['id'])) { $id = $_GET['id']; diff --git a/src/usr/local/www/system_certmanager.php b/src/usr/local/www/system_certmanager.php index d179667..32d5fad 100644 --- a/src/usr/local/www/system_certmanager.php +++ b/src/usr/local/www/system_certmanager.php @@ -82,7 +82,7 @@ $cert_types = array( $altname_types = array("DNS", "IP", "email", "URI"); $openssl_digest_algs = array("sha1", "sha224", "sha256", "sha384", "sha512"); -$pgtitle = array(gettext("System"), gettext("Certificate Manager")); +$pgtitle = array(gettext("System"), gettext("Certificate Manager"), gettext("Certificates")); if (is_numericint($_GET['userid'])) { $userid = $_GET['userid']; diff --git a/src/usr/local/www/system_crlmanager.php b/src/usr/local/www/system_crlmanager.php index b84de92..98a9b68 100644 --- a/src/usr/local/www/system_crlmanager.php +++ b/src/usr/local/www/system_crlmanager.php @@ -70,7 +70,7 @@ require_once("vpn.inc"); global $openssl_crl_status; -$pgtitle = array(gettext("System"), gettext("Certificate Revocation List Manager")); +$pgtitle = array(gettext("System"), gettext("Certificate Manager"), gettext("Certificate Revocation Lists")); $crl_methods = array( "internal" => gettext("Create an internal Certificate Revocation List"), diff --git a/src/usr/local/www/system_groupmanager.php b/src/usr/local/www/system_groupmanager.php index dfeb12f..bd2eb5c 100644 --- a/src/usr/local/www/system_groupmanager.php +++ b/src/usr/local/www/system_groupmanager.php @@ -70,7 +70,7 @@ require("guiconfig.inc"); -$pgtitle = array(gettext("System"), gettext("Group Manager")); +$pgtitle = array(gettext("System"), gettext("User Manager"), gettext("Groups")); if (!is_array($config['system']['group'])) { $config['system']['group'] = array(); diff --git a/src/usr/local/www/system_groupmanager_addprivs.php b/src/usr/local/www/system_groupmanager_addprivs.php index e238228..1e97e59 100644 --- a/src/usr/local/www/system_groupmanager_addprivs.php +++ b/src/usr/local/www/system_groupmanager_addprivs.php @@ -83,7 +83,7 @@ function admin_groups_sort() { require("guiconfig.inc"); -$pgtitle = array(gettext("System"), gettext("Group manager"), gettext("Add privileges")); +$pgtitle = array(gettext("System"), gettext("User Manager"), gettext("Groups"), gettext("Add Privileges")); if (is_numericint($_GET['groupid'])) { $groupid = $_GET['groupid']; diff --git a/src/usr/local/www/system_usermanager.php b/src/usr/local/www/system_usermanager.php index 8b3175f..67fbbe1 100644 --- a/src/usr/local/www/system_usermanager.php +++ b/src/usr/local/www/system_usermanager.php @@ -73,7 +73,7 @@ require("certs.inc"); require("guiconfig.inc"); // start admin user code -$pgtitle = array(gettext("System"), gettext("User Manager")); +$pgtitle = array(gettext("System"), gettext("User Manager"), gettext("Users")); if (isset($_POST['userid']) && is_numericint($_POST['userid'])) { $id = $_POST['userid']; diff --git a/src/usr/local/www/system_usermanager_addprivs.php b/src/usr/local/www/system_usermanager_addprivs.php index 98a209c..1086a65 100644 --- a/src/usr/local/www/system_usermanager_addprivs.php +++ b/src/usr/local/www/system_usermanager_addprivs.php @@ -70,7 +70,7 @@ function admusercmp($a, $b) { require("guiconfig.inc"); -$pgtitle = array("System", "User manager", "Add privileges"); +$pgtitle = array(gettext("System"), gettext("User Manager"), gettext("Users"), gettext("Add Privileges")); if (is_numericint($_GET['userid'])) { $userid = $_GET['userid']; diff --git a/src/usr/local/www/system_usermanager_settings.php b/src/usr/local/www/system_usermanager_settings.php index 6585112..09029ed 100644 --- a/src/usr/local/www/system_usermanager_settings.php +++ b/src/usr/local/www/system_usermanager_settings.php @@ -76,7 +76,7 @@ else { $pconfig['backend'] = &$config['system']['webgui']['backend']; // Page title for main admin -$pgtitle = array(gettext("System"), gettext("User manager settings")); +$pgtitle = array(gettext("System"), gettext("User Manager"), gettext("Settings")); $save_and_test = false; diff --git a/src/usr/local/www/vpn_openvpn_server.php b/src/usr/local/www/vpn_openvpn_server.php index 7a94bec..0bbafb3 100644 --- a/src/usr/local/www/vpn_openvpn_server.php +++ b/src/usr/local/www/vpn_openvpn_server.php @@ -419,6 +419,9 @@ if ($_POST) { /* If we are not in shared key mode, then we need the CA/Cert. */ if ($pconfig['mode'] != "p2p_shared_key") { + if (empty(trim($pconfig['certref']))) { + $input_errors[] = gettext("The selected certificate is not valid"); + } $reqdfields = explode(" ", "caref certref"); $reqdfieldsn = array(gettext("Certificate Authority"), gettext("Certificate")); } elseif (!$pconfig['autokey_enable']) { @@ -744,12 +747,25 @@ if($act=="new" || $act=="edit") : )); } + $certhelp = ""; + if (count($a_cert)) { + if (!empty(trim($pconfig['certref']))) { + $thiscert = lookup_cert($pconfig['certref']); + $purpose = cert_get_purpose($thiscert['crt'], true); + if ($purpose['server'] != "Yes") { + $certhelp = gettext("Warning: The previously saved server was not created as an SSL Server certificate and may not work properly."); + } + } + } else { + $certhelp = sprintf('No Certificates defined. You may create one here: %s', '<a href="system_camanager.php">System > Cert Manager</a>'); + } + $section->addInput(new Form_Select( 'certref', 'Server certificate', $pconfig['certref'], - openvpn_build_cert_list() - ))->setHelp(count($a_cert) ? '':sprintf('No Certificates defined. You may create one here: %s', '<a href="system_camanager.php">System > Cert Manager</a>')); + openvpn_build_cert_list(false, true) + ))->setHelp($certhelp); $section->addInput(new Form_Select( 'dh_length', |