当前位置: 首页>>代码示例>>PHP>>正文


PHP openvpn_delete函数代码示例

本文整理汇总了PHP中openvpn_delete函数的典型用法代码示例。如果您正苦于以下问题:PHP openvpn_delete函数的具体用法?PHP openvpn_delete怎么用?PHP openvpn_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了openvpn_delete函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: gettext

         $input_errors[] = gettext("Server Bridge DHCP Start must be an IPv4 address.");
     }
     if ($pconfig['serverbridge_dhcp_end'] && !is_ipaddrv4($pconfig['serverbridge_dhcp_end'])) {
         $input_errors[] = gettext("Server Bridge DHCP End must be an IPv4 address.");
     }
     if (ip2ulong($pconfig['serverbridge_dhcp_start']) > ip2ulong($pconfig['serverbridge_dhcp_end'])) {
         $input_errors[] = gettext("The Server Bridge DHCP range is invalid (start higher than end).");
     }
 }
 do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
 if (count($input_errors) == 0) {
     // validation correct, save data
     $server = array();
     // delete(rename) old interface so a new TUN or TAP interface can be created.
     if (isset($id) && $pconfig['dev_mode'] != $a_server[$id]['dev_mode']) {
         openvpn_delete('server', $a_server[$id]);
     }
     // 1 on 1 copy of config attributes
     $copy_fields = "mode,protocol,dev_mode,local_port,description,crypto,digest,engine\n\t\t\t\t\t\t,tunnel_network,tunnel_networkv6,remote_network,remote_networkv6\n\t\t\t\t\t\t,gwredir,local_network,local_networkv6,maxclients,compression\n\t\t\t\t\t\t,passtos,client2client,dynamic_ip,pool_enable,topology_subnet\n\t\t\t\t\t\t,serverbridge_dhcp,serverbridge_interface,serverbridge_dhcp_start\n\t\t\t\t\t\t,serverbridge_dhcp_end,dns_domain,dns_server1,dns_server2,dns_server3\n\t\t\t\t\t\t,dns_server4,push_register_dns,ntp_server1,ntp_server2,netbios_enable\n\t\t\t\t\t\t,netbios_ntype,netbios_scope,no_tun_ipv6,verbosity_level,wins_server1\n\t\t\t\t\t\t,wins_server2,client_mgmt_port";
     foreach (explode(",", $copy_fields) as $fieldname) {
         $fieldname = trim($fieldname);
         if (isset($pconfig[$fieldname])) {
             $server[$fieldname] = $pconfig[$fieldname];
         }
     }
     // attributes containing some kind of logic
     if ($vpnid != 0) {
         $server['vpnid'] = $vpnid;
     } else {
         $server['vpnid'] = openvpn_vpnid_next();
     }
开发者ID:aya,项目名称:core,代码行数:31,代码来源:vpn_openvpn_server.php

示例2: elseif

    }
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (isset($_POST['id']) && is_numericint($_POST['id'])) {
        $id = $_POST['id'];
    }
    if (isset($_POST['act'])) {
        $act = $_POST['act'];
    }
    if ($act == "del") {
        // remove client
        if (!isset($id) || !isset($a_client[$id])) {
            redirectHeader("vpn_openvpn_client.php");
            exit;
        }
        if (!empty($a_client[$id])) {
            openvpn_delete('client', $a_client[$id]);
        }
        unset($a_client[$id]);
        write_config();
    } else {
        // update client (after validation)
        $pconfig = $_POST;
        $input_errors = array();
        if (isset($id) && $a_client[$id]) {
            $vpnid = $a_client[$id]['vpnid'];
        }
        if (isset($pconfig['mode']) && $pconfig['mode'] != "p2p_shared_key") {
            $tls_mode = true;
        } else {
            $tls_mode = false;
        }
开发者ID:Anasxrt,项目名称:core,代码行数:31,代码来源:vpn_openvpn_client.php


注:本文中的openvpn_delete函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。