本文整理匯總了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;
}