• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_alias函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: delete_static_route

function delete_static_route($id)
{
    global $config, $a_routes, $changedesc_prefix;
    if (!isset($a_routes[$id])) {
        return;
    }
    $targets = array();
    if (is_alias($a_routes[$id]['network'])) {
        foreach (filter_expand_alias_array($a_routes[$id]['network']) as $tgt) {
            if (is_ipaddrv4($tgt)) {
                $tgt .= "/32";
            } else {
                if (is_ipaddrv6($tgt)) {
                    $tgt .= "/128";
                }
            }
            if (!is_subnet($tgt)) {
                continue;
            }
            $targets[] = $tgt;
        }
    } else {
        $targets[] = $a_routes[$id]['network'];
    }
    foreach ($targets as $tgt) {
        $family = is_subnetv6($tgt) ? "-inet6" : "-inet";
        mwexec("/sbin/route delete {$family} " . escapeshellarg($tgt));
    }
    unset($targets);
}
开发者ID:rohankapoorcom,项目名称:pfsense,代码行数:30,代码来源:system_routes.php


示例2: gettext

        echo gettext("edit alias");
        ?>
" data-toggle="tooltip">
                          <i class="fa fa-list"></i>
                        </a>
<?php 
    } else {
        ?>
                        <?php 
        echo htmlspecialchars(pprint_address($natent['source']));
    }
    ?>
                    </td>
                    <td>
<?php 
    if (isset($natent['destination']['address']) && is_alias($natent['destination']['address'])) {
        ?>
                        <span title="<?php 
        echo htmlspecialchars(get_alias_description($natent['destination']['address']));
        ?>
" data-toggle="tooltip">
                          <?php 
        echo htmlspecialchars(pprint_address($natent['destination']));
        ?>
&nbsp;
                        </span>
                        <a href="/firewall_aliases_edit.php?name=<?php 
        echo htmlspecialchars($natent['destination']['address']);
        ?>
"
                            title="<?php 
开发者ID:8191,项目名称:opnsense-core,代码行数:31,代码来源:firewall_nat_1to1.php


示例3: elseif

     if (is_alias($_POST['ftp_bind_to'])) {
         $engine['bind_to'] = $_POST['ftp_bind_to'];
     } elseif (strtolower(trim($_POST['ftp_bind_to'])) == "all") {
         $engine['bind_to'] = "all";
     } else {
         $input_errors[] = gettext("You must provide a valid Alias or the reserved keyword 'all' for the 'Bind-To IP Address' value.");
     }
 } else {
     $input_errors[] = gettext("The 'Bind-To IP Address' value cannot be blank.  Provide a valid Alias or the reserved keyword 'all'.");
 }
 // Validate BOUNCE-TO Alias entries to be sure if one is set, then both are set; since
 // if you define a BOUNCE-TO address, you must also define the BOUNCE-TO port.
 if ($_POST['ftp_client_bounce_to_net'] && !is_alias($_POST['ftp_client_bounce_to_net'])) {
     $input_errors[] = gettext("Only aliases are allowed for the FTP Protocol BOUNCE-TO ADDRESS option.");
 }
 if ($_POST['ftp_client_bounce_to_port'] && !is_alias($_POST['ftp_client_bounce_to_port'])) {
     $input_errors[] = gettext("Only aliases are allowed for the FTP Protocol BOUNCE-TO PORT option.");
 }
 if ($_POST['ftp_client_bounce_to_net'] && empty($_POST['ftp_client_bounce_to_port'])) {
     $input_errors[] = gettext("FTP Protocol BOUNCE-TO PORT cannot be empty when BOUNCE-TO ADDRESS is set.");
 }
 if ($_POST['ftp_client_bounce_to_port'] && empty($_POST['ftp_client_bounce_to_net'])) {
     $input_errors[] = gettext("FTP Protocol BOUNCE-TO ADDRESS cannot be empty when BOUNCE-TO PORT is set.");
 }
 // Validate the BOUNCE-TO Alias entries for correct format of their defined values.  BOUNCE-TO ADDRESS must be
 // a valid single IP, and BOUNCE-TO PORT must be either a single port value or a port range value.  Provide
 // detailed error messages for the user that explain any problems.
 if ($_POST['ftp_client_bounce_to_net'] && $_POST['ftp_client_bounce_to_port']) {
     if (!snort_is_single_addr_alias($_POST['ftp_client_bounce_to_net'])) {
         $net = trim(filter_expand_alias($_POST['ftp_client_bounce_to_net']));
         $net = preg_replace('/\\s+/', ',', $net);
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:31,代码来源:snort_ftp_client_engine.php


示例4: unset

 if ($config['system']['gateway'] != "") {
     $config['interfaces']['wan']['gateway'] = $config['system']['gateway'];
 }
 unset($config['shaper']);
 /* optional if list */
 $ifdescrs = get_configured_interface_list(true, true);
 /* remove special characters from interface descriptions */
 if (is_array($ifdescrs)) {
     foreach ($ifdescrs as $iface) {
         $config['interfaces'][$iface]['descr'] = remove_bad_chars($config['interfaces'][$iface]['descr']);
     }
 }
 /* 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");
开发者ID:jdillard,项目名称:pfsense,代码行数:31,代码来源:diag_backup.php


示例5: gettext

 /* Ensure that our pool names are unique */
 for ($i = 0; isset($config['load_balancer']['lbpool'][$i]); $i++) {
     if ($_POST['name'] == $config['load_balancer']['lbpool'][$i]['name'] && $i != $id) {
         $input_errors[] = gettext("This pool name has already been used.  Pool names must be unique.");
     }
 }
 if (preg_match('/[ \\/]/', $_POST['name'])) {
     $input_errors[] = gettext("You cannot use spaces or slashes in the 'name' field.");
 }
 if (strlen($_POST['name']) > 16) {
     $input_errors[] = gettext("The 'name' field must be 16 characters or less.");
 }
 if (in_array($_POST['name'], $reserved_table_names)) {
     $input_errors[] = sprintf(gettext("The name '%s' is a reserved word and cannot be used."), $_POST['name']);
 }
 if (is_alias($_POST['name'])) {
     $input_errors[] = sprintf(gettext("Sorry, an alias is already named %s."), $_POST['name']);
 }
 if (!is_portoralias($_POST['port'])) {
     $input_errors[] = gettext("The port must be an integer between 1 and 65535, or a port alias.");
 }
 // May as well use is_port as we want a positive integer and such.
 if (!empty($_POST['retry']) && !is_port($_POST['retry'])) {
     $input_errors[] = gettext("The retry value must be an integer between 1 and 65535.");
 }
 if (is_array($_POST['servers'])) {
     foreach ($pconfig['servers'] as $svrent) {
         if (!is_ipaddr($svrent) && !is_subnetv4($svrent)) {
             $input_errors[] = sprintf(gettext("%s is not a valid IP address or IPv4 subnet (in \"enabled\" list)."), $svrent);
         } else {
             if (is_subnetv4($svrent) && subnet_size($svrent) > 64) {
开发者ID:nmccurdy,项目名称:pfsense,代码行数:31,代码来源:load_balancer_pool_edit.php


示例6: gettext

     if ($_POST['dsttype'] == "single") {
         $_POST['dstmask'] = 32;
     } else {
         if (is_ipaddr($_POST['dsttype'])) {
             $_POST['dst'] = $_POST['dsttype'];
             $_POST['dstmask'] = 32;
             $_POST['dsttype'] = "single";
         }
     }
 }
 /* For external, user can enter only ip's */
 if ($_POST['external'] && !is_ipaddr($_POST['external'])) {
     $input_errors[] = gettext("A valid external subnet must be specified.");
 }
 /* For dst, if user enters an alias and selects "network" then disallow. */
 if ($_POST['dsttype'] == "network" && is_alias($_POST['dst'])) {
     $input_errors[] = gettext("You must specify single host or alias for alias entries.");
 }
 /* For src, user can enter only ip's or networks */
 if (!is_specialnet($_POST['srctype'])) {
     if ($_POST['src'] && !is_ipaddr($_POST['src'])) {
         $input_errors[] = sprintf(gettext("%s is not a valid internal IP address."), $_POST['src']);
     }
     if ($_POST['srcmask'] && !is_numericint($_POST['srcmask'])) {
         $input_errors[] = gettext("A valid internal bit count must be specified.");
     }
 }
 /* For dst, user can enter ip's, networks or aliases */
 if (!is_specialnet($_POST['dsttype'])) {
     if ($_POST['dst'] && !is_ipaddroralias($_POST['dst'])) {
         $input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."), $_POST['dst']);
开发者ID:OptimWIFI,项目名称:pfsense,代码行数:31,代码来源:firewall_nat_1to1_edit.php


示例7: sprintf

                 $input_errors[] = sprintf(gettext("URL '%s' is not valid."), $_POST['address' . $x]);
             }
         }
     }
     unset($desc_fmt_err_found);
     if ($_POST['type'] == "url_ports") {
         $address = group_ports($address);
     }
 } else {
     /* item is a normal alias type */
     $wrongaliases = "";
     $desc_fmt_err_found = false;
     for ($x = 0; $x < 4999; $x++) {
         if ($_POST["address{$x}"] != "") {
             $_POST["address{$x}"] = trim($_POST["address{$x}"]);
             if (is_alias($_POST["address{$x}"])) {
                 if (!alias_same_type($_POST["address{$x}"], $_POST['type'])) {
                     // But alias type network can include alias type urltable. Feature#1603.
                     if (!($_POST['type'] == 'network' && preg_match("/urltable/i", alias_get_type($_POST["address{$x}"])))) {
                         $wrongaliases .= " " . $_POST["address{$x}"];
                     }
                 }
             } else {
                 if ($_POST['type'] == "port") {
                     if (!is_port($_POST["address{$x}"]) && !is_portrange($_POST["address{$x}"])) {
                         $input_errors[] = $_POST["address{$x}"] . " " . gettext("is not a valid port or alias.");
                     }
                 } else {
                     if ($_POST['type'] == "host" || $_POST['type'] == "network") {
                         if (is_subnet($_POST["address{$x}"]) || !is_ipaddr($_POST["address{$x}"]) && !is_hostname($_POST["address{$x}"]) && !is_iprange($_POST["address{$x}"])) {
                             $input_errors[] = sprintf(gettext('%1$s is not a valid %2$s alias.'), $_POST["address{$x}"], $_POST['type']);
开发者ID:wcchandler,项目名称:pfsense,代码行数:31,代码来源:firewall_aliases_edit.php


示例8: elseif

                    </td>
                    <td class="hidden-xs hidden-sm">
<?php 
    if (isset($natent['nonat'])) {
        $nat_address = '<I>NO NAT</I>';
    } elseif (!$natent['target']) {
        $nat_address = htmlspecialchars(convert_friendly_interface_to_friendly_descr($natent['interface'])) . " address";
    } elseif ($natent['target'] == "other-subnet") {
        $nat_address = $natent['targetip'] . '/' . $natent['targetip_subnet'];
    } else {
        $nat_address = $natent['target'];
    }
    ?>
                      <?php 
    echo htmlspecialchars($nat_address);
    if (isset($natent['target']) && is_alias($natent['target'])) {
        ?>
                        &nbsp;<a href="/firewall_aliases_edit.php?name=<?php 
        echo htmlspecialchars($natent['target']);
        ?>
"><i class="fa fa-list"></i> </a>
<?php 
    }
    ?>
                    </td>
                    <td class="hidden-xs hidden-sm">
                      <?php 
    echo empty($natent['natport']) ? "*" : htmlspecialchars($natent['natport']);
    ?>
                    </td>
                    <td>
开发者ID:karawan,项目名称:core,代码行数:31,代码来源:firewall_nat_out.php


示例9: login

function login($pass)
{
    // RETURN VALUE:
    //  0 - OK
    //  1 - unknown user
    //  2 - password doesn't match
    // VARIABLES:
    //  $admin - user has admin privileges (from auth table)
    //  $userid - whatever is used internally (aside from login)
    global $userid, $admin, $login, $conf_system_auth, $conf_ldap_server, $conf_ldap_domain, $posljednji_pristup;
    $q1 = myquery("select id, password, admin, UNIX_TIMESTAMP(posljednji_pristup) from auth where login='{$login}' and aktivan=1");
    if (mysql_num_rows($q1) <= 0) {
        return 1;
    }
    function is_alias($results)
    {
        foreach ($results as $k1 => $v1) {
            if ($k1 === "objectclass") {
                foreach ($v1 as $k2 => $v2) {
                    if ($v2 === "zimbraAlias") {
                        return true;
                    }
                }
            }
        }
        return false;
    }
    if ($conf_system_auth == "ldap") {
        $ds = ldap_connect($conf_ldap_server);
        ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
        if ($ds) {
            if (ldap_bind($ds)) {
                $i = 0;
                // Probavamo UID
                $login = ldap_escape($login);
                $sr = ldap_search($ds, "", "uid={$login}", array());
                if (!$sr) {
                    niceerror("ldap_search() failed.");
                    exit;
                }
                $results = ldap_get_entries($ds, $sr);
                // Ako ldap_get_entries vrati false, pretpostavićemo da nema rezultata
                // To se dešava rijetko ali se dešava i nije mi jasno zašto
                // Ovaj upit ce vratiti i aliase, koje moramo profiltrirati
                while ($results && is_alias($results[$i]) && $i < $results['count']) {
                    $i++;
                }
                // Probavamo email adresu
                if (!$results || $i == $results['count']) {
                    $sr = ldap_search($ds, "", "mail={$login}", array());
                    if (!$sr) {
                        niceerror("ldap_search() 1 failed.");
                        exit;
                    }
                    $results = ldap_get_entries($ds, $sr);
                    $i = 0;
                    while ($results && is_alias($results[$i]) && $i < $results['count']) {
                        $i++;
                    }
                }
                // Probavamo email adresu + domena
                if (!$results || $i == $results['count']) {
                    $sr = ldap_search($ds, "", "mail={$login}{$conf_ldap_domain}", array());
                    if (!$sr) {
                        niceerror("ldap_search() 2 failed.");
                        exit;
                    }
                    $results = ldap_get_entries($ds, $sr);
                    $i = 0;
                    while ($results && is_alias($results[$i]) && $i < $results['count']) {
                        $i++;
                    }
                }
                if (!$results || $i == $results['count']) {
                    return 1;
                }
                $dn = $results[$i]['dn'];
                if (!@ldap_bind($ds, $dn, $pass)) {
                    // ldap_bind generiše warning svaki put kad je pogrešna šifra :(
                    return 2;
                }
                // ldap_bind succeeded, user is authenticated
            } else {
                niceerror("LDAP anonymous bind failed.");
                exit;
            }
        } else {
            niceerror("Can't contact LDAP server.");
            exit;
        }
    } else {
        if ($conf_system_auth == "table") {
            if ($pass != mysql_result($q1, 0, 1)) {
                return 2;
            }
        }
    }
    $userid = mysql_result($q1, 0, 0);
    $admin = mysql_result($q1, 0, 2);
    $posljednji_pristup = mysql_result($q1, 0, 3);
//.........这里部分代码省略.........
开发者ID:msehalic,项目名称:zamger,代码行数:101,代码来源:libvedran.php


示例10: htmlspecialchars

// Check for returned "selected alias" if action is import
if ($_GET['act'] == "import") {
    if ($_GET['varname'] == "bind_to" && !empty($_GET['varvalue'])) {
        $pconfig[$_GET['varname']] = htmlspecialchars($_GET['varvalue']);
    }
}
if ($_POST['save']) {
    /* Grab all the POST values and save in new temp array */
    $engine = array();
    if ($_POST['frag3_name']) {
        $engine['name'] = trim($_POST['frag3_name']);
    } else {
        $engine['name'] = "default";
    }
    if ($_POST['frag3_bind_to']) {
        if (is_alias($_POST['frag3_bind_to'])) {
            $engine['bind_to'] = $_POST['frag3_bind_to'];
        } elseif (strtolower(trim($_POST['frag3_bind_to'])) == "all") {
            $engine['bind_to'] = "all";
        } else {
            $input_errors[] = gettext("You must provide a valid Alias or the reserved keyword 'all' for the 'Bind-To IP Address' value.");
        }
    } else {
        $input_errors[] = gettext("The 'Bind-To IP Address' value cannot be blank.  Provide a valid Alias or the reserved keyword 'all'.");
    }
    /* Validate the text input fields before saving */
    if (!empty($_POST['frag3_timeout']) || $_POST['frag3_timeout'] == 0) {
        $engine['timeout'] = $_POST['frag3_timeout'];
        if (!is_numeric($_POST['frag3_timeout']) || $_POST['frag3_timeout'] < 1) {
            $input_errors[] = gettext("The value for Timeout must be numeric and greater than zero.");
        }
开发者ID:LFCavalcanti,项目名称:pfsense-packages,代码行数:31,代码来源:snort_frag3_engine.php


示例11: trim

    if (!empty($suricatacfg["def_{$alias}"]) && is_alias($suricatacfg["def_{$alias}"])) {
        $avalue = trim(filter_expand_alias($suricatacfg["def_{$alias}"]));
        $avalue = preg_replace('/\\s+/', ',', trim($avalue));
    }
    $addr_vars .= "    " . strtoupper($alias) . ": \"{$avalue}\"\n";
}
$addr_vars = trim($addr_vars);
if (is_array($config['system']['ssh']) && isset($config['system']['ssh']['port'])) {
    $ssh_port = $config['system']['ssh']['port'];
} else {
    $ssh_port = "22";
}
$suricata_ports = array("ftp_ports" => "21", "http_ports" => "80", "oracle_ports" => "1521", "ssh_ports" => $ssh_port, "shellcode_ports" => "!80", "DNP3_PORTS" => "20000", "file_data_ports" => "\$HTTP_PORTS,110,143");
$port_vars = "";
foreach ($suricata_ports as $alias => $avalue) {
    if (!empty($suricatacfg["def_{$alias}"]) && is_alias($suricatacfg["def_{$alias}"])) {
        $avalue = trim(filter_expand_alias($suricatacfg["def_{$alias}"]));
        $avalue = preg_replace('/\\s+/', ',', trim($avalue));
    }
    $port_vars .= "    " . strtoupper($alias) . ": \"{$avalue}\"\n";
}
$port_vars = trim($port_vars);
// Define a Suppress List (Threshold) if one is configured
$suppress = suricata_find_list($suricatacfg['suppresslistname'], 'suppress');
if (!empty($suppress)) {
    $suppress_data = str_replace("\r", "", base64_decode($suppress['suppresspassthru']));
    @file_put_contents("{$suricatacfgdir}/threshold.config", $suppress_data);
} else {
    @file_put_contents("{$suricatacfgdir}/threshold.config", "");
}
// Add interface-specific detection engine settings
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:31,代码来源:suricata_generate_yaml.php


示例12: gettext

                </tr>
                <tr>
                    <td><a id="help_for_destination" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?php 
echo gettext("Destination");
?>
</td>
                    <td>
                      <table class="table table-condensed">
                        <tr>
                          <td>
                            <select name="destination" id="destination" class="selectpicker" data-live-search="true" data-size="5" data-width="auto">
                              <option data-other=true value="<?php 
echo $pconfig['destination'];
?>
" <?php 
echo !is_alias($pconfig['destination']) && $pconfig['destination'] != 'any' ? "selected=\"selected\"" : "";
?>
><?php 
echo gettext("Single host or Network");
?>
</option>
                              <option value="any" <?php 
echo $pconfig['destination'] == "any" ? "selected=\"selected\"" : "";
?>
><?php 
echo gettext("any");
?>
</option>
                              <optgroup label="<?php 
echo gettext("Aliases");
?>
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:firewall_nat_out_edit.php


示例13: foreach

 }
 /* check for name conflicts */
 foreach ($a_passlist as $p_list) {
     if (isset($id) && $a_passlist[$id] && $a_passlist[$id] === $p_list) {
         continue;
     }
     if ($p_list['name'] == $_POST['name']) {
         $input_errors[] = gettext("A Pass List file name with this name already exists.");
         break;
     }
 }
 if ($_POST['address']) {
     if (!is_alias($_POST['address'])) {
         $input_errors[] = gettext("A valid alias must be provided");
     }
     if (is_alias($_POST['address']) && trim(filter_expand_alias($_POST['address'])) == "") {
         $input_errors[] = gettext("FQDN aliases are not supported in Suricata.");
     }
 }
 if (!$input_errors) {
     $p_list = array();
     /* post user input */
     $p_list['name'] = $_POST['name'];
     $p_list['uuid'] = $passlist_uuid;
     $p_list['localnets'] = $_POST['localnets'] ? 'yes' : 'no';
     $p_list['wanips'] = $_POST['wanips'] ? 'yes' : 'no';
     $p_list['wangateips'] = $_POST['wangateips'] ? 'yes' : 'no';
     $p_list['wandnsips'] = $_POST['wandnsips'] ? 'yes' : 'no';
     $p_list['vips'] = $_POST['vips'] ? 'yes' : 'no';
     $p_list['vpnips'] = $_POST['vpnips'] ? 'yes' : 'no';
     $p_list['address'] = $_POST['address'];
开发者ID:LFCavalcanti,项目名称:pfsense-packages,代码行数:31,代码来源:suricata_passlist_edit.php


示例14: list

        ?>
"><i class="fa fa-list"></i> </a>
<?php 
    }
    ?>
                      </td>

                      <td>
<?php 
    $localport = $natent['local-port'];
    if (strpos($natent['destination']['port'], '-') !== false) {
        list($dstbeginport, $dstendport) = explode("-", $natent['destination']['port']);
        $localendport = $natent['local-port'] + $dstendport - $dstbeginport;
        $localport .= '-' . $localendport;
    }
    if (isset($natent['destination']['port']) && is_alias($natent['destination']['port'])) {
        ?>
                          <span title="<?php 
        echo htmlspecialchars(get_alias_description($localport));
        ?>
" data-toggle="tooltip">
                            <?php 
        echo htmlspecialchars(pprint_port($localport));
        ?>
&nbsp;
                          </span>
                          <a href="/firewall_aliases_edit.php?name=<?php 
        echo htmlspecialchars($localport);
        ?>
"
                              title="<?php 
开发者ID:oparoz,项目名称:core-1,代码行数:31,代码来源:firewall_nat.php


示例15: session_start

    }
}
if ($_POST['save']) {
    // Clear and close out any session variable we created
    session_start();
    unset($_SESSION['http_inspect_import']);
    session_write_close();
    // Grab all the POST values and save in new temp array
    $engine = array();
    if ($_POST['httpinspect_name']) {
        $engine['name'] = trim($_POST['httpinspect_name']);
    } else {
        $engine['name'] = "default";
    }
    if ($_POST['httpinspect_bind_to']) {
        if (is_alias($_POST['httpinspect_bind_to'])) {
            $engine['bind_to'] = $_POST['httpinspect_bind_to'];
        } elseif (strtolower(trim($_POST['httpinspect_bind_to'])) == "all") {
            $engine['bind_to'] = "all";
        } else {
            $input_errors[] = gettext("You must provide a valid Alias or the reserved keyword 'all' for the 'Bind-To IP Address' value.");
        }
    } else {
        $input_errors[] = gettext("The 'Bind-To IP Address' value cannot be blank.  Provide a valid Alias or the reserved keyword 'all'.");
    }
    if ($_POST['httpinspect_ports']) {
        $engine['ports'] = trim($_POST['httpinspect_ports']);
    } else {
        $engine['ports'] = "default";
    }
    // Validate the text input fields before saving
开发者ID:LFCavalcanti,项目名称:pfsense-packages,代码行数:31,代码来源:snort_httpinspect_engine.php


示例16: ksort

ksort($snort_servers);
ksort($snort_ports);
$pconfig = $a_nat[$id];
/* convert fake interfaces to real */
$if_real = get_real_interface($pconfig['interface']);
$snort_uuid = $config['installedpackages']['snortglobal']['rule'][$id]['uuid'];
if ($_POST['save']) {
    $natent = array();
    $natent = $pconfig;
    foreach ($snort_servers as $key => $server) {
        if ($_POST["def_{$key}"] && !is_alias($_POST["def_{$key}"])) {
            $input_errors[] = "Only aliases are allowed";
        }
    }
    foreach ($snort_ports as $key => $server) {
        if ($_POST["def_{$key}"] && !is_alias($_POST["def_{$key}"])) {
            $input_errors[] = "Only aliases are allowed";
        }
    }
    /* if no errors write to conf */
    if (!$input_errors) {
        /* post new options */
        foreach ($snort_servers as $key => $server) {
            if ($_POST["def_{$key}"]) {
                $natent["def_{$key}"] = $_POST["def_{$key}"];
            } else {
                unset($natent["def_{$key}"]);
            }
        }
        foreach ($snort_ports as $key => $server) {
            if ($_POST["def_{$key}"]) {
开发者ID:schinken,项目名称:pfsense-packages,代码行数:31,代码来源:snort_define_servers.php


示例17: gen_subnet

 } else {
     if ($_POST['source_type'] == "(self)") {
         $osn = "(self)";
     } else {
         if (is_alias($_POST['source'])) {
             $osn = $_POST['source'];
         } else {
             $osn = gen_subnet($_POST['source'], $_POST['source_subnet']) . "/" . $_POST['source_subnet'];
         }
     }
 }
 /* check for existing entries */
 if ($_POST['destination_type'] == "any") {
     $ext = "any";
 } else {
     if (is_alias($_POST['destination'])) {
         $ext = $_POST['destination'];
     } else {
         $ext = gen_subnet($_POST['destination'], $_POST['destination_subnet']) . "/" . $_POST['destination_subnet'];
     }
 }
 foreach ($a_out as $natent) {
     if (isset($id) && $a_out[$id] && $a_out[$id] === $natent) {
         continue;
     }
     if (!$natent['interface']) {
         $natent['interface'] = "wan";
     }
 }
 if (!$input_errors) {
     $natent = array();
开发者ID:curtiszimmerman,项目名称:pfsense,代码行数:31,代码来源:firewall_nat_out_edit.php


示例18: log_error

     } else {
         log_error("[snort] WARNING: unable to resolve IP Address Alias [{$v['bind_to']}] for HTTP_INSPECT server '{$v['name']}' ... skipping this server engine.");
         continue;
     }
 } else {
     log_error("[snort] WARNING: unable to resolve IP Address Alias [{$v['bind_to']}] for HTTP_INSPECT server '{$v['name']}' ... skipping this server engine.");
     continue;
 }
 $http_inspect_servers .= $buffer;
 $http_inspect_servers .= "\tprofile {$v['server_profile']} \\\n";
 if ($v['no_alerts'] == "on") {
     $http_inspect_servers .= "\tno_alerts \\\n";
 }
 if ($v['ports'] == "default" || empty($v['ports'])) {
     $http_inspect_servers .= "\tports { {$http_ports} } \\\n";
 } elseif (is_alias($v['ports'])) {
     $tmp = trim(filter_expand_alias($v['ports']));
     if (!empty($tmp)) {
         $tmp = preg_replace('/\\s+/', ' ', $tmp);
         $tmp = snort_expand_port_range($tmp, ' ');
         $http_inspect_servers .= "\tports { {$tmp} } \\\n";
     } else {
         log_error("[snort] WARNING: unable to resolve Ports Alias [{$v['ports']}] for HTTP_INSPECT server '{$v['name']}' ... using safe default instead.");
         $http_inspect_servers .= "\tports { {$http_ports} } \\\n";
     }
 } else {
     log_error("[snort] WARNING: unable to resolve Ports Alias [{$v['ports']}] for HTTP_INSPECT server '{$v['name']}' ... using safe default instead.");
     $http_inspect_servers .= "\tports { {$http_ports} } \\\n";
 }
 $http_inspect_servers .= "\tserver_flow_depth {$v['server_flow_depth']} \\\n";
 $http_inspect_servers .= "\tclient_flow_depth {$v['client_flow_depth']} \\\n";
开发者ID:randyqx,项目名称:pfsense-packages,代码行数:31,代码来源:snort_generate_conf.php


示例19: count

         if (is_ipaddr($tgt)) {
             $tgt .= "/32";
         }
         if (!is_subnet($tgt)) {
             continue;
         }
         $new_targets[] = $tgt;
     }
 }
 if (!isset($id)) {
     $id = count($a_routes);
 }
 $oroute = $a_routes[$id];
 if (!empty($oroute)) {
     $old_targets = array();
     if (is_alias($oroute['network'])) {
         foreach (filter_expand_alias_array($oroute['network']) as $tgt) {
             if (is_ipaddr($tgt)) {
                 $tgt .= "/32";
             }
             if (!is_subnet($tgt)) {
                 continue;
             }
             $old_targets[] = $tgt;
         }
     } else {
         $old_targets[] = $oroute['network'];
     }
 }
 $overlaps = array_intersect($current_targets, $new_targets);
 $overlaps = array_diff($overlaps, $old_targets);
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:system_routes_edit.php


示例20: sprintf

 if (!empty($pconfig['srcbeginport']) && !is_portoralias($pconfig['srcbeginport']) && $pconfig['srcbeginport'] != 'any') {
     $input_errors[] = sprintf(gettext("%s is not a valid start source port. It must be a port alias or integer between 1 and 65535."), $pconfig['srcbeginport']);
 }
 if (!empty($pconfig['srcendport']) && !is_portoralias($pconfig['srcendport']) && $pconfig['srcendport'] != 'any') {
     $input_errors[] = sprintf(gettext("%s is not a valid end source port. It must be a port alias or integer between 1 and 65535."), $pconfig['srcendport']);
 }
 if (!empty($pconfig['dstbeginport']) && !is_portoralias($pconfig['dstbeginport']) && $pconfig['dstbeginport'] != 'any') {
     $input_errors[] = sprintf(gettext("%s is not a valid start destination port. It must be a port alias or integer between 1 and 65535."), $pconfig['dstbeginport']);
 }
 if (!empty($pconfig['dstendport']) && !is_portoralias($pconfig['dstendport']) && $pconfig['dstendport'] != 'any') {
     $input_errors[] = sprintf(gettext("%s is not a valid end destination port. It must be a port alias or integer between 1 and 65535."), $pconfig['dstendport']);
 }
 if ((is_alias($pconfig['srcbeginport']) || is_alias($pconfig['srcendport'])) && $pconfig['srcbeginport'] != $pconfig['srcendport']) {
     $input_errors[] = gettext('When selecting aliases for source ports, both from and to fields must be the same');
 }
 if ((is_alias($pconfig['dstbeginport']) || is_alias($pconfig['dstendport'])) && $pconfig['dstbeginport'] != $pconfig['dstendport']) {
     $input_errors[] = gettext('When selecting aliases for destination ports, both from and to fields must be the same');
 }
 if (!is_specialnet($pconfig['src'])) {
     if (!is_ipaddroralias($pconfig['src'])) {
         $input_errors[] = sprintf(gettext("%s is not a valid source IP address or alias."), $pconfig['src']);
     }
     if (!is_numericint($pconfig['srcmask'])) {
         $input_errors[] = gettext("A valid source bit count must be specified.");
     }
 }
 if (!is_specialnet($pconfig['dst'])) {
     if (!is_ipaddroralias($pconfig['dst'])) {
         $input_errors[] = sprintf(gettext("%s is not a valid destination IP address or alias."), $pconfig['dst']);
     }
     if (!is_numericint($pconfig['dstmask'])) {
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:firewall_rules_edit.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_allowed函数代码示例发布时间:2022-05-15
下一篇:
PHP is_ajax_request函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap