本文整理汇总了PHP中update_alias_names_upon_change函数的典型用法代码示例。如果您正苦于以下问题:PHP update_alias_names_upon_change函数的具体用法?PHP update_alias_names_upon_change怎么用?PHP update_alias_names_upon_change使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了update_alias_names_upon_change函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update_alias_names_upon_change
update_alias_names_upon_change(array('nat', 'rule'), array('destination', 'address'), $_POST['name'], $origname);
update_alias_names_upon_change(array('nat', 'rule'), array('destination', 'port'), $_POST['name'], $origname);
update_alias_names_upon_change(array('nat', 'rule'), array('target'), $_POST['name'], $origname);
update_alias_names_upon_change(array('nat', 'rule'), array('local-port'), $_POST['name'], $origname);
// NAT 1:1 Rules
//update_alias_names_upon_change(array('nat', 'onetoone'), array('external'), $_POST['name'], $origname);
//update_alias_names_upon_change(array('nat', 'onetoone'), array('source', 'address'), $_POST['name'], $origname);
update_alias_names_upon_change(array('nat', 'onetoone'), array('destination', 'address'), $_POST['name'], $origname);
// NAT Outbound Rules
update_alias_names_upon_change(array('nat', 'outbound', 'rule'), array('source', 'network'), $_POST['name'], $origname);
update_alias_names_upon_change(array('nat', 'outbound', 'rule'), array('sourceport'), $_POST['name'], $origname);
update_alias_names_upon_change(array('nat', 'outbound', 'rule'), array('destination', 'address'), $_POST['name'], $origname);
update_alias_names_upon_change(array('nat', 'outbound', 'rule'), array('dstport'), $_POST['name'], $origname);
update_alias_names_upon_change(array('nat', 'outbound', 'rule'), array('target'), $_POST['name'], $origname);
// Alias in an alias
update_alias_names_upon_change(array('aliases', 'alias'), array('address'), $_POST['name'], $origname);
}
pfSense_handle_custom_code("/usr/local/pkg/firewall_aliases_edit/pre_write_config");
if (isset($id) && $a_aliases[$id]) {
if ($a_aliases[$id]['name'] != $alias['name']) {
foreach ($a_aliases as $aliasid => $aliasd) {
if ($aliasd['address'] != "") {
$tmpdirty = false;
$tmpaddr = explode(" ", $aliasd['address']);
foreach ($tmpaddr as $tmpidx => $tmpalias) {
if ($tmpalias == $a_aliases[$id]['name']) {
$tmpaddr[$tmpidx] = $alias['name'];
$tmpdirty = true;
}
}
if ($tmpdirty == true) {
示例2: foreach
}
/* check for interface names with an alias */
if (is_array($ifdescrs)) {
foreach ($ifdescrs as $iface) {
if (is_alias($config['interfaces'][$iface]['descr'])) {
// Firewall rules
$origname = $config['interfaces'][$iface]['descr'];
$newname = $config['interfaces'][$iface]['descr'] . "Alias";
update_alias_names_upon_change(array('filter', 'rule'), array('source', 'address'), $newname, $origname);
update_alias_names_upon_change(array('filter', 'rule'), array('destination', 'address'), $newname, $origname);
// NAT Rules
update_alias_names_upon_change(array('nat', 'rule'), array('source', 'address'), $newname, $origname);
update_alias_names_upon_change(array('nat', 'rule'), array('destination', 'address'), $newname, $origname);
update_alias_names_upon_change(array('nat', 'rule'), array('target'), $newname, $origname);
// Alias in an alias
update_alias_names_upon_change(array('aliases', 'alias'), array('address'), $newname, $origname);
}
}
}
unlink_if_exists("{$g['tmp_path']}/config.cache");
// Reset configuration version to something low
// in order to force the config upgrade code to
// run through with all steps that are required.
$config['system']['version'] = "1.0";
// Deal with descriptions longer than 63 characters
for ($i = 0; isset($config["filter"]["rule"][$i]); $i++) {
if (count($config['filter']['rule'][$i]['descr']) > 63) {
$config['filter']['rule'][$i]['descr'] = substr($config['filter']['rule'][$i]['descr'], 0, 63);
}
}
// Move interface from ipsec to enc0
示例3: foreach
}
/* check for interface names with an alias */
if (is_array($ifdescrs)) {
foreach ($ifdescrs as $iface) {
if (is_alias($config['interfaces'][$iface]['descr'])) {
// Firewall rules
$origname = $config['interfaces'][$iface]['descr'];
$newname = $config['interfaces'][$iface]['descr'] . "Alias";
update_alias_names_upon_change('filter', 'rule', 'source', 'address', $newname, $origname);
update_alias_names_upon_change('filter', 'rule', 'destination', 'address', $newname, $origname);
// NAT Rules
update_alias_names_upon_change('nat', 'rule', 'target', '', $newname, $origname);
update_alias_names_upon_change('nat', 'rule', 'external-port', '', $newname, $origname);
update_alias_names_upon_change('nat', 'rule', 'local-port', '', $newname, $origname);
// Alias in an alias
update_alias_names_upon_change('aliases', 'alias', 'address', '', $newname, $origname);
}
}
}
unlink_if_exists("/tmp/config.cache");
write_config();
add_base_packages_menu_items();
conf_mount_ro();
$savemsg = "m0n0wall ayarları sisteme uyarlandı {$g['product_name']}.<p>Firewall şu anda yeniden başlatılıyor.";
$reboot_needed = true;
}
if (isset($config['captiveportal']['enable'])) {
/* for some reason ipfw doesn't init correctly except on bootup sequence */
$savemsg = "Ayarlar yapılandırıldı.<p>Firewall şu anda yeniden başlatılıyor.";
$reboot_needed = true;
}