本文整理汇总了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.");
}
}
示例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);
?>
示例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";