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


PHP make_config_revision_entry函数代码示例

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


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

示例1: filter_generate_gateways

 if ($_POST['mode'] == "advanced" && ($mode == "automatic" || $mode == "hybrid")) {
     /*
      *    user has enabled advanced outbound NAT and doesn't have rules
      *    lets automatically create entries
      *    for all of the interfaces to make life easier on the pip-o-chap
      */
     if (empty($GatewaysList)) {
         filter_generate_gateways();
     }
     $tonathosts = filter_nat_rules_automatic_tonathosts(true);
     $automatic_rules = filter_nat_rules_outbound_automatic("");
     foreach ($tonathosts as $tonathost) {
         foreach ($automatic_rules as $natent) {
             $natent['source']['network'] = $tonathost['subnet'];
             $natent['descr'] .= sprintf(gettext(' - %1$s to %2$s'), $tonathost['descr'], convert_real_interface_to_friendly_descr($natent['interface']));
             $natent['created'] = make_config_revision_entry(null, gettext("Manual Outbound NAT Switch"));
             /* Try to detect already auto created rules and avoid duplicate them */
             $found = false;
             foreach ($a_out as $rule) {
                 if ($rule['interface'] == $natent['interface'] && $rule['source']['network'] == $natent['source']['network'] && $rule['dstport'] == $natent['dstport'] && $rule['target'] == $natent['target'] && $rule['descr'] == $natent['descr']) {
                     $found = true;
                     break;
                 }
             }
             if ($found === false) {
                 $a_out[] = $natent;
             }
         }
     }
     $savemsg = gettext("Default rules for each interface have been created.");
     unset($GatewaysList);
开发者ID:Toudix,项目名称:core,代码行数:31,代码来源:firewall_nat_out.php

示例2: make_config_revision_entry

         }
     }
     $filterent['source'] = $a_filter[$id]['source'];
     $filterent['destination'] = $a_filter[$id]['destination'];
     $filterent['associated-rule-id'] = $a_filter[$id]['associated-rule-id'];
 }
 if (isset($a_filter[$id]['created']) && is_array($a_filter[$id]['created'])) {
     $filterent['created'] = $a_filter[$id]['created'];
 }
 $filterent['updated'] = make_config_revision_entry();
 // Allow extending of the firewall edit page and include custom input validation
 pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_write_config");
 if (isset($id) && $a_filter[$id]) {
     $a_filter[$id] = $filterent;
 } else {
     $filterent['created'] = make_config_revision_entry();
     if (is_numeric($after)) {
         array_splice($a_filter, $after + 1, 0, array($filterent));
     } else {
         $a_filter[] = $filterent;
     }
 }
 filter_rules_sort();
 if (write_config()) {
     mark_subsystem_dirty('filter');
 }
 if (isset($_POST['floating'])) {
     header("Location: firewall_rules.php?if=FloatingRules");
 } else {
     header("Location: firewall_rules.php?if=" . htmlspecialchars($_POST['interface']));
 }
开发者ID:rohankapoorcom,项目名称:pfsense,代码行数:31,代码来源:firewall_rules_edit.php

示例3: easyrule_pass_rule_add

function easyrule_pass_rule_add($int, $proto, $srchost, $dsthost, $dstport, $ipproto)
{
    global $config;
    /* No rules, start a new array */
    if (!is_array($config['filter']['rule'])) {
        $config['filter']['rule'] = array();
    }
    filter_rules_sort();
    $a_filter =& $config['filter']['rule'];
    /* Make up a new rule */
    $filterent = array();
    $filterent['type'] = 'pass';
    $filterent['interface'] = $int;
    $filterent['ipprotocol'] = $ipproto;
    $filterent['descr'] = gettext("Easy Rule: Passed from Firewall Log View");
    if ($proto != "any") {
        $filterent['protocol'] = $proto;
    } else {
        unset($filterent['protocol']);
    }
    /* Default to only allow echo requests, since that's what most people want and
     *  it should be a safe choice. */
    if ($proto == "icmp") {
        $filterent['icmptype'] = 'echoreq';
    }
    if (strtolower($proto) == "icmp6" || strtolower($proto) == "icmpv6") {
        $filterent['protocol'] = "icmp";
    }
    if (is_subnet($srchost)) {
        list($srchost, $srcmask) = explode("/", $srchost);
    } elseif (is_specialnet($srchost)) {
        $srcmask = 0;
    } elseif (is_ipaddrv6($srchost)) {
        $srcmask = 128;
    } else {
        $srcmask = 32;
    }
    if (is_subnet($dsthost)) {
        list($dsthost, $dstmask) = explode("/", $dsthost);
    } elseif (is_specialnet($dsthost)) {
        $dstmask = 0;
    } elseif (is_ipaddrv6($dsthost)) {
        $dstmask = 128;
    } else {
        $dstmask = 32;
    }
    pconfig_to_address($filterent['source'], $srchost, $srcmask);
    pconfig_to_address($filterent['destination'], $dsthost, $dstmask, '', $dstport, $dstport);
    $filterent['created'] = make_config_revision_entry(null, gettext("Easy Rule"));
    $a_filter[] = $filterent;
    write_config($filterent['descr']);
    $retval = filter_configure();
    return true;
}
开发者ID:noikiy,项目名称:core-2,代码行数:54,代码来源:diag_logs_filter.php


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