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

PHP is_ipaddr_configured函数代码示例

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

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



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

示例1: gettext

             if (isset($a_vip[$id]['uniqid'])) {
                 $ignore_uniqid = $a_vip[$id]['uniqid'];
             }
         } else {
             $ignore_if = $_POST['interface'];
             $ignore_mode = $_POST['mode'];
         }
         if (!isset($ignore_uniqid)) {
             $ignore_uniqid = $_POST['uniqid'];
         }
         if ($ignore_mode == 'carp') {
             $ignore_if = "_vip{$ignore_uniqid}";
         } else {
             $ignore_if .= "_virtualip{$id}";
         }
         if (is_ipaddr_configured($_POST['subnet'], $ignore_if)) {
             $input_errors[] = gettext("This IP address is being used by another interface or VIP.");
         }
         unset($ignore_if, $ignore_mode);
     }
 }
 $natiflist = get_configured_interface_with_descr();
 foreach ($natiflist as $natif => $natdescr) {
     if ($_POST['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6']))) {
         $input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP.");
     }
 }
 /* ipalias and carp should not use network or broadcast address */
 if ($_POST['mode'] == "ipalias" || $_POST['mode'] == "carp") {
     if (is_ipaddrv4($_POST['subnet']) && $_POST['subnet_bits'] != "32") {
         $network_addr = gen_subnet($_POST['subnet'], $_POST['subnet_bits']);
开发者ID:toshisam,项目名称:pfsense,代码行数:31,代码来源:firewall_virtual_ip_edit.php


示例2: gettext

     if ($_POST['rollbits'] && (!is_numeric($_POST['rollbits']) || $_POST['rollbits'] < 1 || $_POST['rollbits'] > 31)) {
         $input_errors[] = gettext("# of Bits to store Roll Id needs to be between 1..31.");
     }
     if ($_POST['ticketbits'] && (!is_numeric($_POST['ticketbits']) || $_POST['ticketbits'] < 1 || $_POST['ticketbits'] > 16)) {
         $input_errors[] = gettext("# of Bits to store Ticket Id needs to be between 1..16.");
     }
     if ($_POST['checksumbits'] && (!is_numeric($_POST['checksumbits']) || $_POST['checksumbits'] < 1 || $_POST['checksumbits'] > 31)) {
         $input_errors[] = gettext("# of Bits to store checksum needs to be between 1..31.");
     }
     if ($_POST['publickey'] && !strstr($_POST['publickey'], "BEGIN PUBLIC KEY")) {
         $input_errors[] = gettext("This doesn't look like an RSA Public key.");
     }
     if ($_POST['privatekey'] && !strstr($_POST['privatekey'], "BEGIN RSA PRIVATE KEY")) {
         $input_errors[] = gettext("This doesn't look like an RSA Private key.");
     }
     if ($_POST['vouchersyncdbip'] && is_ipaddr_configured($_POST['vouchersyncdbip'])) {
         $input_errors[] = gettext("You cannot sync the voucher database to this host (itself).");
     }
 }
 if (!$input_errors) {
     if (empty($config['voucher'][$cpzone])) {
         $newvoucher = array();
     } else {
         $newvoucher = $config['voucher'][$cpzone];
     }
     if ($_POST['enable'] == "yes") {
         $newvoucher['enable'] = true;
     } else {
         unset($newvoucher['enable']);
     }
     if (empty($_POST['vouchersyncusername'])) {
开发者ID:mtisza,项目名称:pfsense,代码行数:31,代码来源:services_captiveportal_vouchers.php


示例3: unset

if ($_POST) {
    unset($input_errors);
    $pconfig = $_POST;
    /* input validation */
    if ($_POST['mode'] == "server") {
        $reqdfields = explode(" ", "localip remoteip");
        $reqdfieldsn = array(gettext("Server address"), gettext("Remote start address"));
        if ($_POST['radiusenable']) {
            $reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret"));
            $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("RADIUS server address"), gettext("RADIUS shared secret")));
        }
        do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
        if ($_POST['localip'] && !is_ipaddr($_POST['localip'])) {
            $input_errors[] = gettext("A valid server address must be specified.");
        }
        if (is_ipaddr_configured($_POST['localip'])) {
            $input_errors[] = gettext("'Server address' parameter should NOT be set to any IP address currently in use on this firewall.");
        }
        if ($_POST['l2tp_subnet'] && !is_ipaddr($_POST['remoteip'])) {
            $input_errors[] = gettext("A valid remote start address must be specified.");
        }
        if ($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver'])) {
            $input_errors[] = gettext("A valid RADIUS server address must be specified.");
        }
        if ($_POST['secret'] != $_POST['secret_confirm']) {
            $input_errors[] = gettext("Secret and confirmation must match");
        }
        if ($_POST['radiussecret'] != $_POST['radiussecret_confirm']) {
            $input_errors[] = gettext("Secret and confirmation must match");
        }
        if (!is_numericint($_POST['n_l2tp_units']) || $_POST['n_l2tp_units'] > 255) {
开发者ID:z0x010,项目名称:pfsense,代码行数:31,代码来源:vpn_l2tp.php


示例4: foreach

         }
         foreach ($staticroutes as $route_subnet) {
             list($network, $subnet) = explode("/", $route_subnet);
             if ($pconfig['subnet'] == $subnet && $network == gen_subnet($pconfig['ipaddr'], $pconfig['subnet'])) {
                 $input_errors[] = gettext("This IPv4 address conflicts with a Static Route.");
                 break;
             }
             unset($network, $subnet);
         }
     }
 }
 if (!empty($pconfig['ipaddrv6'])) {
     if (!is_ipaddrv6($pconfig['ipaddrv6'])) {
         $input_errors[] = gettext("A valid IPv6 address must be specified.");
     } else {
         if (is_ipaddr_configured($pconfig['ipaddrv6'], $if, true)) {
             $input_errors[] = gettext("This IPv6 address is being used by another interface or VIP.");
         }
         foreach ($staticroutes as $route_subnet) {
             list($network, $subnet) = explode("/", $route_subnet);
             if ($pconfig['subnetv6'] == $subnet && $network == gen_subnetv6($pconfig['ipaddrv6'], $pconfig['subnetv6'])) {
                 $input_errors[] = gettext("This IPv6 address conflicts with a Static Route.");
                 break;
             }
             unset($network, $subnet);
         }
     }
 }
 if (!empty($pconfig['subnet']) && !is_numeric($pconfig['subnet'])) {
     $input_errors[] = gettext("A valid subnet bit count must be specified.");
 }
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:interfaces.php


示例5: foreach

         }
         foreach ($staticroutes as $route_subnet) {
             list($network, $subnet) = explode("/", $route_subnet);
             if ($_POST['subnet'] == $subnet && $network == gen_subnet($_POST['ipaddr'], $_POST['subnet'])) {
                 $input_errors[] = gettext("This IPv4 address conflicts with a Static Route.");
                 break;
             }
             unset($network, $subnet);
         }
     }
 }
 if ($_POST['ipaddrv6']) {
     if (!is_ipaddrv6($_POST['ipaddrv6'])) {
         $input_errors[] = gettext("A valid IPv6 address must be specified.");
     } else {
         if (is_ipaddr_configured($_POST['ipaddrv6'], $if, true)) {
             $input_errors[] = gettext("This IPv6 address is being used by another interface or VIP.");
         }
         foreach ($staticroutes as $route_subnet) {
             list($network, $subnet) = explode("/", $route_subnet);
             if ($_POST['subnetv6'] == $subnet && $network == gen_subnetv6($_POST['ipaddrv6'], $_POST['subnetv6'])) {
                 $input_errors[] = gettext("This IPv6 address conflicts with a Static Route.");
                 break;
             }
             unset($network, $subnet);
         }
     }
 }
 if ($_POST['subnet'] && !is_numeric($_POST['subnet'])) {
     $input_errors[] = gettext("A valid subnet bit count must be specified.");
 }
开发者ID:siloportem,项目名称:core,代码行数:31,代码来源:interfaces.php


示例6: array

     $id = $pconfig['id'];
 }
 // perform form validations
 $reqdfields = array("mode");
 $reqdfieldsn = array(gettext("Type"));
 do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
 if (isset($pconfig['subnet'])) {
     $pconfig['subnet'] = trim($pconfig['subnet']);
     if (!is_ipaddr($pconfig['subnet'])) {
         $input_errors[] = gettext("A valid IP address must be specified.");
     } else {
         $ignore_if = isset($id) ? $a_vip[$id]['interface'] : $pconfig['interface'];
         if ($pconfig['mode'] == 'carp') {
             $ignore_if .= "_vip{$pconfig['vhid']}";
         }
         if (is_ipaddr_configured($pconfig['subnet'], $ignore_if)) {
             $input_errors[] = gettext("This IP address is being used by another interface or VIP.");
         }
     }
 }
 $natiflist = get_configured_interface_with_descr();
 foreach ($natiflist as $natif => $natdescr) {
     if ($pconfig['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6']))) {
         $input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP.");
     }
 }
 /* ipalias and carp should not use network or broadcast address */
 if ($pconfig['mode'] == "ipalias" || $pconfig['mode'] == "carp") {
     if (is_ipaddrv4($pconfig['subnet']) && $pconfig['subnet_bits'] != "32") {
         $network_addr = gen_subnet($pconfig['subnet'], $pconfig['subnet_bits']);
         $broadcast_addr = gen_subnet_max($pconfig['subnet'], $pconfig['subnet_bits']);
开发者ID:8191,项目名称:opnsense-core,代码行数:31,代码来源:firewall_virtual_ip_edit.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP is_ipaddroralias函数代码示例发布时间:2022-05-15
下一篇:
PHP is_ipaddr函数代码示例发布时间: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