function get_user_privdesc(&$user) { global $priv_list; $privs = array(); if (!isset($user['priv']) || !is_array($user['priv'])) { $user_privs = array(); } else { $user_privs = $user['priv']; } $names = local_user_get_groups($user, true); foreach ($names as $name) { $group = getGroupEntry($name); if (isset($group['priv']) && is_array($group['priv'])) { foreach ($group['priv'] as $pname) { if (in_array($pname, $user_privs)) { continue; } if (empty($priv_list[$pname])) { continue; } $priv = $priv_list[$pname]; $priv['group'] = $group['name']; $priv['id'] = $pname; $privs[] = $priv; } } } foreach ($user_privs as $pname) { if (!empty($priv_list[$pname])) { $priv_list[$pname]['id'] = $pname; $privs[] = $priv_list[$pname]; } } legacy_html_escape_form_data($privs); return $privs; }
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ require_once "guiconfig.inc"; require_once "services.inc"; // request report data if (!isset($config['gateways']['gateway_group']) || !is_array($config['gateways']['gateway_group'])) { $a_gateway_groups = array(); } else { $a_gateway_groups =& $config['gateways']['gateway_group']; } $gateways_status = return_gateways_status(); $a_gateways = return_gateways_array(); legacy_html_escape_form_data($a_gateways); legacy_html_escape_form_data($a_gateway_groups); $service_hook = 'apinger'; include "head.inc"; ?> <body> <?php include "fbegin.inc"; ?> <section class="page-content-main"> <div class="container-fluid"> <div class="row"> <section class="col-xs-12"> <div class="tab-content content-box col-xs-12"> <div class="responsive-table">
} if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { if (ppp_inuse($a_ppps[$id]['if'])) { $input_errors[] = gettext("This point-to-point link cannot be deleted because it is still being used as an interface."); } else { unset($a_ppps[$id]['pppoe-reset-type']); handle_pppoe_reset($a_ppps[$id]); unset($a_ppps[$id]); write_config(); header("Location: interfaces_ppps.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_ppps); $main_buttons = array(array('href' => 'interfaces_ppps_edit.php', 'label' => gettext('Add'))); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data("id"); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("Point-to-Point"); ?>
$input_errors[] = gettext("This bridge cannot be deleted because it is assigned as an interface."); } else { if (!does_interface_exist($a_bridges[$id]['bridgeif'])) { log_error("Bridge interface does not exist, skipping ifconfig destroy."); } else { mwexec("/sbin/ifconfig " . escapeshellarg($a_bridges[$id]['bridgeif']) . " destroy"); } unset($a_bridges[$id]); write_config(); header("Location: interfaces_bridge.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_bridges); $main_buttons = array(array('href' => 'interfaces_bridge_edit.php', 'label' => gettext('Add'))); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data("id"); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("Bridge");
$config['ipsec']['client'] = $client; write_config(); mark_subsystem_dirty('ipsec'); header("Location: vpn_ipsec_mobile.php"); exit; } } // initialize missing post attributes foreach (explode(",", $form_fields) as $fieldname) { $fieldname = trim($fieldname); if (!isset($pconfig[$fieldname])) { $pconfig[$fieldname] = null; } } } legacy_html_escape_form_data($pconfig); $pgtitle = array(gettext("VPN"), gettext("IPsec"), gettext("Mobile")); $shortcut_section = "ipsec"; include "head.inc"; ?> <body> <script type="text/javascript"> //<![CDATA[ $( document ).ready(function() { pool_change(); dns_domain_change(); dns_split_change(); dns_server_change(); wins_server_change();
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ require_once "guiconfig.inc"; require_once "vpn.inc"; require_once "services.inc"; require_once "interfaces.inc"; $pgtitle = array(gettext("Status"), gettext("IPsec"), gettext("SAD")); $shortcut_section = "ipsec"; include "head.inc"; $sad = ipsec_dump_sad(); legacy_html_escape_form_data($sad); ?> <body> <?php include "fbegin.inc"; ?> <section class="page-content-main"> <div class="container-fluid"> <div class="row"> <section class="col-xs-12"> <? $active_tab = "/diag_ipsec_sad.php"; include('diag_ipsec_tabs.inc'); ?> <div class="tab-content content-box col-xs-12"> <div class="table-responsive"> <table class="table table-striped"> <?php
} write_config(); if ($changes > 0) { // reload filter, rrd when interfaces have changed (original from apply action) filter_configure(); enable_rrd_graphing(); } // redirect header("Location: interfaces_assign.php"); exit; } } } /* collect (unused) interfaces */ $interfaces = list_interfaces(); legacy_html_escape_form_data($interfaces); $unused_interfaces = array(); foreach ($interfaces as $portname => $portinfo) { $portused = false; foreach ($config['interfaces'] as $ifname => $ifdata) { if ($ifdata['if'] == $portname) { $portused = true; break; } } if (!$portused) { $unused_interfaces[$portname] = $portinfo; } } include "head.inc"; ?>
$remipp = escapeshellarg($_POST['remipp']); if (!empty($port) and !empty($remipp)) { $retval = kill_client($port, $remipp); echo htmlentities("|{$port}|{$remipp}|{$retval}|"); } else { echo gettext("invalid input"); } exit; } } $servers = openvpn_get_active_servers(); legacy_html_escape_form_data($servers); $sk_servers = openvpn_get_active_servers("p2p"); legacy_html_escape_form_data($sk_servers); $clients = openvpn_get_active_clients(); legacy_html_escape_form_data($clients); include "head.inc"; ?> <body> <?php include "fbegin.inc"; ?> <script type="text/javascript"> //<![CDATA[ $( document ).ready(function() { // link kill buttons $(".act_kill_client").click(function(){ var port = $(this).attr("data-client-port");
if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { if (vlan_inuse($a_vlans[$id])) { $input_errors[] = gettext("This VLAN cannot be deleted because it is still being used as an interface."); } else { if (does_interface_exist($a_vlans[$id]['vlanif'])) { legacy_interface_destroy($a_vlans[$id]['vlanif']); } unset($a_vlans[$id]); write_config(); header("Location: interfaces_vlan.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_vlans); $main_buttons = array(array('href' => 'interfaces_vlan_edit.php', 'label' => gettext('Add'))); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data("id"); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("VLAN");
if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { $members = explode(" ", $a_ifgroups[$id]['members']); foreach ($members as $ifs) { $realif = get_real_interface($ifs); if (!empty($realif)) { mwexec("/sbin/ifconfig " . escapeshellarg($realif) . " -group " . escapeshellarg($a_ifgroups[$id]['ifname'])); } } unset($a_ifgroups[$id]); write_config(); header("Location: interfaces_groups.php"); exit; } } include "head.inc"; legacy_html_escape_form_data($a_ifgroups); $main_buttons = array(array('href' => 'interfaces_groups_edit.php', 'label' => gettext('Add'))); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data("id"); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("Group");
foreach ($delmembers as $tag) { mwexec("/usr/sbin/ngctl shutdown {$qinq['vlanif']}h{$tag}:"); } } mwexec("/usr/sbin/ngctl shutdown {$qinq['vlanif']}qinq:"); mwexec("/usr/sbin/ngctl shutdown {$qinq['vlanif']}:"); mwexec("/sbin/ifconfig {$qinq['vlanif']} destroy"); unset($a_qinqs[$id]); write_config(); header("Location: interfaces_qinq.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_qinqs); $main_buttons = array(array('href' => 'interfaces_qinq_edit.php', 'label' => gettext('Add'))); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data("id"); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("QinQ");
$id = $_POST['id']; } if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { if (lagg_inuse($a_laggs[$id]['laggif'])) { $input_errors[] = gettext("This LAGG interface cannot be deleted because it is still being used."); } else { mwexec_bg("/sbin/ifconfig " . escapeshellarg($a_laggs[$id]['laggif']) . " destroy"); unset($a_laggs[$id]); write_config(); header("Location: interfaces_lagg.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_laggs); $main_buttons = array(array('href' => 'interfaces_lagg_edit.php', 'label' => gettext('Add'))); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data("id"); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("LAGG");
$id = $_POST['id']; } if (!empty($_POST['action']) && $_POST['action'] == "del" && isset($id)) { if (gif_inuse($a_gifs[$id]['gifif'])) { $input_errors[] = gettext("This gif TUNNEL cannot be deleted because it is still being used as an interface."); } else { mwexec("/sbin/ifconfig " . escapeshellarg($a_gifs[$id]['gifif']) . " destroy"); unset($a_gifs[$id]); write_config(); header("Location: interfaces_gif.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_gifs); $main_buttons = array(array('href' => 'interfaces_gif_edit.php', 'label' => gettext('Add'))); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data("id"); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("GIF");
break; case 'ikedisconnectconn': if ($ikesaid !== null) { mwexec("/usr/local/sbin/ipsec down con" . $ikeid . "[" . $ikesaid . "]"); } else { } case 'childdisconnect': mwexec("/usr/local/sbin/ipsec down con" . $ikeid . "{" . $ikesaid . "}"); break; } } } $status = ipsec_smp_dump_status(); $pconfig = $config['ipsec']['phase1']; legacy_html_escape_form_data($pconfig); legacy_html_escape_form_data($status); $pgtitle = array(gettext("Status"), gettext("IPsec")); $shortcut_section = "ipsec"; include "head.inc"; ?> <script type="text/javascript"> //<![CDATA[ function show_childsa(id, buttonid) { document.getElementById(buttonid).innerHTML=''; aodiv = document.getElementById(id); aodiv.style.display = ""; } //]]> </script> <body>
find_alias_reference(array('staticroutes', 'route'), array('network'), $alias_name, $is_alias_referenced, $referenced_by); if ($is_alias_referenced) { $savemsg = sprintf(gettext("Cannot delete alias. Currently in use by %s"), $referenced_by); } else { unset($a_aliases[$_POST['id']]); if (write_config()) { filter_configure(); mark_subsystem_dirty('aliases'); } header("Location: firewall_aliases.php?tab=" . $selected_tab); exit; } } } } legacy_html_escape_form_data($a_aliases); $main_buttons = array(array('href' => 'firewall_aliases_edit.php?tab=' . $selected_tab, 'label' => gettext("Add a new alias"))); include "head.inc"; ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(){ var id = $(this).attr("id").split('_').pop(-1); BootstrapDialog.show({ type:BootstrapDialog.TYPE_INFO, title: "<?php echo gettext("Aliases"); ?> ",
break; } } } if ($referenced_by !== false) { $savemsg = sprintf(gettext("Cannot delete Schedule. Currently in use by %s"), $referenced_by); } else { unset($a_schedules[$id]); write_config(); header("Location: firewall_schedule.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_schedules); $main_buttons = array(array('label' => gettext('Add a new schedule'), 'href' => 'firewall_schedule_edit.php')); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(){ var id = $(this).attr("id").split('_').pop(-1); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("Rules"); ?> ",
// move selected rules if (!isset($id)) { // if rule not set/found, move to end $id = count($a_routes); } $a_routes = legacy_move_config_list_items($a_routes, $id, $pconfig['route']); if (write_config()) { mark_subsystem_dirty('staticroutes'); } } header("Location: system_routes.php"); exit; } $a_gateways = return_gateways_array(true, true, true); legacy_html_escape_form_data($a_routes); legacy_html_escape_form_data($a_gateways); $main_buttons = array(array('label' => gettext('Add route'), 'href' => 'system_routes_edit.php')); include "head.inc"; ?> <script type="text/javascript"> $( document ).ready(function() { // link remove route $(".act-del-route").click(function(event){ var id = $(this).data('id'); event.preventDefault(); BootstrapDialog.show({ type:BootstrapDialog.TYPE_INFO, title: "<?php echo gettext("Route");
} } elseif (isset($pconfig['action']) && $pconfig['action'] == 'toggle' && isset($id)) { // toggle item if (isset($a_1to1[$id]['disabled'])) { unset($a_1to1[$id]['disabled']); } else { $a_1to1[$id]['disabled'] = true; } if (write_config(gettext('Toggled NAT rule'))) { mark_subsystem_dirty('natconf'); } header("Location: firewall_nat_1to1.php"); exit; } } legacy_html_escape_form_data($a_1to1); include "head.inc"; $main_buttons = array(array('label' => gettext("add rule"), 'href' => 'firewall_nat_1to1_edit.php')); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(){ var id = $(this).attr("id").split('_').pop(-1); if (id != 'x') { // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("1:1");
} interfaces_carp_setup(); set_single_sysctl('net.inet.carp.allow', '1'); } } } $carpcount = 0; foreach ($a_vip as $carp) { if ($carp['mode'] == "carp") { $carpcount++; break; } } // fetch pfsync info $pfsyncnodes = json_decode(configd_run("filter list pfsync json"), true); legacy_html_escape_form_data($a_vip); $status = get_single_sysctl('net.inet.carp.allow') > 0; $carp_detected_problems = array_pop(get_sysctl("net.inet.carp.demotion")) > 0; include "head.inc"; ?> <body> <?php include "fbegin.inc"; ?> <section class="page-content-main"> <div class="container-fluid"> <div class="row"> <?php if (isset($savemsg)) {
$crl['serial'] = empty($pconfig['serial']) ? 9999 : $pconfig['serial']; $crl['lifetime'] = empty($pconfig['lifetime']) ? 9999 : $pconfig['lifetime']; $crl['cert'] = array(); } if (!isset($id)) { $a_crl[] = $crl; } write_config("Saved CRL {$crl['descr']}"); openvpn_refresh_crls(); header("Location: system_crlmanager.php"); exit; } } } legacy_html_escape_form_data($pconfig); legacy_html_escape_form_data($thiscrl); include "head.inc"; ?> <body> <script type="text/javascript"> $( document ).ready(function() { // delete cert revocation list $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data('id'); var descr = $(this).data('descr'); BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php
$tunableent['tunable'] = $pconfig['tunable']; $tunableent['value'] = $pconfig['value']; $tunableent['descr'] = $pconfig['descr']; if (isset($id)) { $a_tunable[$id] = $tunableent; } else { $a_tunable[] = $tunableent; } mark_subsystem_dirty('sysctl'); write_config(); header("Location: system_advanced_sysctl.php"); exit; } } } legacy_html_escape_form_data($a_tunable); if ($act != 'edit') { $main_buttons = array(array('href' => 'system_advanced_sysctl.php?act=edit', 'label' => gettext('Add a new tunable'))); } include "head.inc"; ?> <body> <script type="text/javascript"> $( document ).ready(function() { // delete entry $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data('id'); BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER,
} elseif (isset($pconfig['act']) && $pconfig['act'] == 'toggle' && isset($id)) { // toggle item if (isset($a_nat[$id]['disabled'])) { unset($a_nat[$id]['disabled']); } else { $a_nat[$id]['disabled'] = true; } if (write_config("Firewall: NAT: Outbound, enable/disable NAT rule")) { mark_subsystem_dirty('natconf'); } header("Location: firewall_nat.php"); exit; } } include "head.inc"; legacy_html_escape_form_data($a_nat); $main_buttons = array(array('label' => gettext('Add'), 'href' => 'firewall_nat_edit.php')); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(){ var id = $(this).attr("id").split('_').pop(-1); if (id != 'x') { // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("Port Forward");
} write_config(); header("Location: system_groupmanager.php"); exit; } else { // input errors, load page in edit mode $act = 'edit'; } } else { // POST without a valid action, redirect to overview header("Location: system_groupmanager.php"); exit; } } legacy_html_escape_form_data($pconfig); legacy_html_escape_form_data($a_group); include "head.inc"; ?> <body> <?php include "fbegin.inc"; ?> <script type="text/javascript"> //<![CDATA[ function setall_selected(id) { selbox = document.getElementById(id); count = selbox.options.length; for (index = 0; index<count; index++) { selbox.options[index].selected = true; }
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (!empty($_POST['action']) && $_POST['action'] == "del" && !empty($a_clones[$_POST['id']])) { if (clone_inuse($a_clones[$_POST['id']]['cloneif'])) { /* check if still in use */ $input_errors[] = gettext("This wireless clone cannot be deleted because it is assigned as an interface."); } else { mwexec("/sbin/ifconfig " . escapeshellarg($a_clones[$_POST['id']]['cloneif']) . " destroy"); unset($a_clones[$_POST['id']]); write_config(); header("Location: interfaces_wireless.php"); exit; } } } include "head.inc"; legacy_html_escape_form_data($a_clones); $main_buttons = array(array('href' => 'interfaces_wireless_edit.php', 'label' => gettext('Add'))); ?> <body> <script type="text/javascript"> $( document ).ready(function() { // link delete buttons $(".act_delete").click(function(event){ event.preventDefault(); var id = $(this).data("id"); // delete single BootstrapDialog.show({ type:BootstrapDialog.TYPE_DANGER, title: "<?php echo gettext("Wireless");
$savemsg = gettext("Authentication Server") . " {$serverdeleted} " . gettext("deleted") . "<br />"; write_config($savemsg); redirectHeader("system_authservers.php"); } } $pgtitle = array(gettext('System'), gettext('Users'), gettext('Servers')); $shortcut_section = "authentication"; // list of all possible fields for auth item (used for form init) $all_authfields = array('type', 'name', 'ldap_caref', 'ldap_host', 'ldap_port', 'ldap_urltype', 'ldap_protver', 'ldap_scope', 'ldap_basedn', 'ldap_authcn', 'ldap_extended_query', 'ldap_binddn', 'ldap_bindpw', 'ldap_attr_user', 'radius_host', 'radius_auth_port', 'radius_acct_port', 'radius_secret', 'radius_timeout', 'radius_srvcs'); foreach ($all_authfields as $fieldname) { if (!isset($pconfig[$fieldname])) { $pconfig[$fieldname] = null; } } legacy_html_escape_form_data($pconfig); legacy_html_escape_form_data($a_server); include "head.inc"; $main_buttons = array(array('label' => 'Add server', 'href' => 'system_authservers.php?act=new')); ?> <body> <script type="text/javascript"> //<![CDATA[ function select_clicked() { if (document.getElementById("ldap_port").value == '' || document.getElementById("ldap_host").value == '' || document.getElementById("ldap_scope").value == '' || document.getElementById("ldap_basedn").value == '' ) { alert("<?php
} include "head.inc"; ?> <body> <?php include "fbegin.inc"; ?> <section class="page-content-main"> <div class="container-fluid"> <div class="row"> <section class="col-xs-12"> <?php foreach (get_configured_interface_with_descr(false, true) as $ifdescr => $ifname) { $ifinfo = get_interface_info($ifdescr); legacy_html_escape_form_data($ifinfo); $ifdescr = htmlspecialchars($ifdescr); $ifname = htmlspecialchars($ifname); // Load MAC-Manufacturer table $mac_man = load_mac_manufacturer_table(); ?> <div class="tab-content content-box col-xs-12 __mb"> <div class="table-responsive"> <table class="table table-striped"> <thead> <tr> <th colspan="2" class="listtopic"> <?php echo htmlspecialchars($ifname); ?> <?php