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


PHP openvpn_resync函数代码示例

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


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

示例1: openvpn_resync_gwgroup

function openvpn_resync_gwgroup($gwgroupname = "")
{
    global $config;
    if (!empty($gwgroupname)) {
        if (isset($config['openvpn']['openvpn-server'])) {
            foreach ($config['openvpn']['openvpn-server'] as &$settings) {
                if ($gwgroupname == $settings['interface']) {
                    log_error("Resyncing OpenVPN for gateway group " . $gwgroupname . " server " . $settings["description"] . ".");
                    openvpn_resync('server', $settings);
                }
            }
        }
        if (isset($config['openvpn']['openvpn-client'])) {
            foreach ($config['openvpn']['openvpn-client'] as &$settings) {
                if ($gwgroupname == $settings['interface']) {
                    log_error("Resyncing OpenVPN for gateway group " . $gwgroupname . " client " . $settings["description"] . ".");
                    openvpn_resync('client', $settings);
                }
            }
        }
        // Note: no need to resysnc Client Specific (csc) here, as changes to the OpenVPN real interface do not effect these.
    } else {
        log_error("openvpn_resync_gwgroup called with null gwgroup parameter.");
    }
}
开发者ID:paudam,项目名称:opnsense-core,代码行数:25,代码来源:system_gateway_groups.php

示例2: base64_encode

                if (isset($pconfig['mode']) && $pconfig['mode'] == "server_tls_user" && isset($server['strictusercn'])) {
                    $server['strictusercn'] = $pconfig['strictusercn'];
                }
            } else {
                $server['shared_key'] = base64_encode($pconfig['shared_key']);
            }
            if (isset($_POST['duplicate_cn']) && $_POST['duplicate_cn'] == "yes") {
                $server['duplicate_cn'] = true;
            }
            // update or add to config
            if (isset($id) && $a_server[$id]) {
                $a_server[$id] = $server;
            } else {
                $a_server[] = $server;
            }
            openvpn_resync('server', $server);
            write_config();
            header("Location: vpn_openvpn_server.php");
            exit;
        } elseif (!empty($pconfig['authmode'])) {
            $pconfig['authmode'] = implode(",", $pconfig['authmode']);
        }
    }
}
$pgtitle = array(gettext("OpenVPN"), gettext("Server"));
$shortcut_section = "openvpn";
include "head.inc";
$main_buttons = array(array('href' => 'vpn_openvpn_server.php?act=new', 'label' => gettext("add server")));
legacy_html_escape_form_data($pconfig);
?>
开发者ID:aya,项目名称:core,代码行数:30,代码来源:vpn_openvpn_server.php

示例3: openvpn_create_key

                $client['certref'] = $pconfig['certref'];
                if (!empty($pconfig['tlsauth_enable'])) {
                    if (!empty($pconfig['autotls_enable'])) {
                        $pconfig['tls'] = openvpn_create_key();
                    }
                    $client['tls'] = base64_encode($pconfig['tls']);
                }
            } else {
                $client['shared_key'] = base64_encode($pconfig['shared_key']);
            }
            if (isset($id) && isset($a_client[$id])) {
                $a_client[$id] = $client;
            } else {
                $a_client[] = $client;
            }
            openvpn_resync('client', $client);
            write_config();
            header("Location: vpn_openvpn_client.php");
            exit;
        }
    }
}
// escape form output before processing
legacy_html_escape_form_data($pconfig);
include "head.inc";
$main_buttons = array(array('href' => 'vpn_openvpn_client.php?act=new', 'label' => gettext("add client")));
?>

<body>
<?php 
include "fbegin.inc";
开发者ID:Anasxrt,项目名称:core,代码行数:31,代码来源:vpn_openvpn_client.php


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