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


PHP is_unqualified_hostname函数代码示例

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


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

示例1: do_input_validation

 do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
 /* either MAC or Client-ID must be specified */
 if (empty($_POST['mac']) && empty($_POST['cid'])) {
     $input_errors[] = gettext("Either MAC address or Client identifier must be specified");
 }
 /* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
 $_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
 if ($_POST['hostname']) {
     preg_match("/\\-\$/", $_POST['hostname'], $matches);
     if ($matches) {
         $input_errors[] = gettext("The hostname cannot end with a hyphen according to RFC952");
     }
     if (!is_hostname($_POST['hostname'])) {
         $input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'.");
     } else {
         if (!is_unqualified_hostname($_POST['hostname'])) {
             $input_errors[] = gettext("A valid hostname is specified, but the domain name part should be omitted");
         }
     }
 }
 if ($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr'])) {
     $input_errors[] = gettext("A valid IP address must be specified.");
 }
 if ($_POST['mac'] && !is_macaddr($_POST['mac'])) {
     $input_errors[] = gettext("A valid MAC address must be specified.");
 }
 if ($static_arp_enabled && !$_POST['ipaddr']) {
     $input_errors[] = gettext("Static ARP is enabled.  You must specify an IP address.");
 }
 /* check for overlaps */
 foreach ($a_maps as $mapent) {
开发者ID:sjourdois,项目名称:pfsense,代码行数:31,代码来源:services_dhcp_edit.php

示例2: foreach

     }
     if (ctype_digit($entry)) {
         $aliases[$entry][$field] = $value;
     }
 }
 $pconfig['aliases']['item'] = $aliases;
 /* validate aliases */
 foreach ($aliases as $idx => $alias) {
     $aliasreqdfields = array('aliasdomain' . $idx);
     $aliasreqdfieldsn = array(gettext("Alias Domain"));
     do_input_validation($_POST, $aliasreqdfields, $aliasreqdfieldsn, $input_errors);
     if ($alias['host']) {
         if (!is_hostname($alias['host'])) {
             $input_errors[] = gettext("Hostnames in an alias list can only contain the characters A-Z, 0-9 and '-'. They may not start or end with '-'.");
         } else {
             if (!is_unqualified_hostname($alias['host'])) {
                 $input_errors[] = gettext("A valid alias hostname is specified, but the domain name part should be omitted");
             }
         }
     }
     if ($alias['domain'] && !is_domain($alias['domain'])) {
         $input_errors[] = gettext("A valid domain must be specified in alias list.");
     }
 }
 /* check for overlaps */
 foreach ($a_hosts as $hostent) {
     if (isset($id) && $a_hosts[$id] && $a_hosts[$id] === $hostent) {
         continue;
     }
     if ($hostent['host'] == $_POST['host'] && $hostent['domain'] == $_POST['domain'] && (is_ipaddrv4($hostent['ip']) && is_ipaddrv4($_POST['ip']) || is_ipaddrv6($hostent['ip']) && is_ipaddrv6($_POST['ip']))) {
         $input_errors[] = gettext("This host/domain already exists.");
开发者ID:nmccurdy,项目名称:pfsense,代码行数:31,代码来源:services_unbound_host_edit.php


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