當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Subnets::validate_hostname方法代碼示例

本文整理匯總了PHP中Subnets::validate_hostname方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subnets::validate_hostname方法的具體用法?PHP Subnets::validate_hostname怎麽用?PHP Subnets::validate_hostname使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subnets的用法示例。


在下文中一共展示了Subnets::validate_hostname方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: sizeof

             $dns_records[] = "<li><i class='icon-gray fa fa-gray fa-angle-right'></i> <span class='badge badge1 badge2 editRecord' data-action='edit' data-id='{$ptr->id}' data-domain_id='{$ptr->domain_id}'>{$ptr->type}</span> {$ptr->name} </li>";
         }
         $dns_records[] = "</ul>";
         // if none ignore
         $dns_records = sizeof($dns_records) == 3 ? "" : implode(" ", $dns_records);
     } else {
         $dns_records = "";
     }
 } else {
     $dns_records = "";
     $button = "";
 }
 // add button
 if ($User->settings->enablePowerDNS == 1) {
     // add new button
     if ($Subnets->validate_hostname($addresses[$n]->dns_name) && ($User->isadmin || @$User->user->pdns == "Yes")) {
         $button = "<i class='fa fa-plus-circle fa-gray fa-href editRecord' data-action='add' data-id='" . $Addresses->transform_address($addresses[$n]->ip_addr, "dotted") . "' data-domain_id='" . $addresses[$n]->dns_name . "'></i>";
     } else {
         $button = "";
     }
 }
 # resolve dns name
 $resolve = $DNS->resolve_address($addresses[$n]->ip_addr, $addresses[$n]->dns_name, false, $subnet['nameserverId']);
 print "<td class='{$resolve['class']} hostname'>{$resolve['name']} {$button} {$dns_records}</td>";
 # print firewall address object - mandatory if enabled
 if (in_array('firewallAddressObject', $selected_ip_fields) && $zone) {
     print "<td class='fwzone'>" . $addresses[$n]->firewallAddressObject . "</td>";
 }
 # print description - mandatory
 print "<td class='description'>" . $addresses[$n]->description . "</td>";
 # Print mac address icon!
開發者ID:dajo,項目名稱:phpipam,代碼行數:31,代碼來源:print-address-table.php

示例2: sizeof

             $dns_records[] = "<li><i class='icon-gray fa fa-gray fa-angle-right'></i> <span class='badge badge1 badge2'>{$ptr->type}</span> {$ptr->name} </li>";
         }
         $dns_records[] = "</ul>";
         // if none ignore
         $dns_records = sizeof($dns_records) == 3 ? "" : implode(" ", $dns_records);
     } else {
         $dns_records = "";
     }
 } else {
     $dns_records = "";
     $button = "";
 }
 // add button
 if ($User->settings->enablePowerDNS == 1) {
     // add new button
     if ($Subnets->validate_hostname($addresses[$n]->dns_name)) {
         $button = "<i class='fa fa-plus-circle fa-gray fa-href editRecord' data-action='add' data-id='" . $Addresses->transform_address($addresses[$n]->ip_addr, "dotted") . "' data-domain_id='" . $addresses[$n]->dns_name . "'></i>";
     } else {
         $button = "";
     }
 }
 # resolve dns name
 $resolve = $DNS->resolve_address($addresses[$n]->ip_addr, $addresses[$n]->dns_name, false, $subnet['nameserverId']);
 print "<td class='{$resolve['class']} hostname'>{$resolve['name']} {$button} {$dns_records}</td>";
 # print description - mandatory
 print "<td class='description'>" . $addresses[$n]->description . "</td>";
 # Print mac address icon!
 if (in_array('mac', $selected_ip_fields)) {
     if (!empty($addresses[$n]->mac)) {
         print "<td class='narrow'><i class='info fa fa-gray fa-sitemap' rel='tooltip' data-container='body' title='" . _('MAC') . ": " . $addresses[$n]->mac . "'></i></td>";
     } else {
開發者ID:seisen,項目名稱:phpipam,代碼行數:31,代碼來源:print-address-table.php


注:本文中的Subnets::validate_hostname方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。