コード例 #1
0
ファイル: address-modify.php プロジェクト: mwodz/phpipam
        <input type="checkbox" name="unique" value="1" <?php 
    print $delete;
    ?>
><?php 
    print _('Unique hostname');
    ?>
        </div>
        </td>
    </tr>
    <?php 
}
?>

	<?php 
#get type
$type = $Addresses->identify_address($subnet['subnet']);
if ($subnet['mask'] < 31 && ($action == 'add' || substr($action, 0, 4) == "all-") && $type == "IPv4") {
    ?>
	 <!-- ignore NW /BC checks -->
	 <tr>
		<td><?php 
    print _('Not strict');
    ?>
</td>
		<td>
		<div class='checkbox info2'>
			<input type="checkbox" name="nostrict" value="yes"><?php 
    print _('Permit adding network/broadcast as IP');
    ?>
		</div>
		</td>
コード例 #2
0
$search_term = $_REQUEST['search_term'];
//initialize Pear IPv6 object
require_once dirname(__FILE__) . '/../../../functions/PEAR/Net/IPv6.php';
$Net_IPv6 = new Net_IPv6();
// ipv6 ?
if ($Net_IPv6->checkIPv6($search_term) != false) {
    $type = "IPv6";
} elseif (strlen($search_term) == 17 && substr_count($search_term, ":") == 5) {
    $type = "mac";
    //count : -> must be 5
} else {
    if (strlen($search_term) == 12 && substr_count($search_term, ":") == 0 && substr_count($search_term, ".") == 0) {
        $type = "mac";
        //no dots or : -> mac without :
    } else {
        $type = $Addresses->identify_address($search_term);
        //identify address type
    }
}
# reformat if IP address for search
if ($type == "IPv4") {
    $search_term_edited = $Tools->reformat_IPv4_for_search($search_term);
} elseif ($type == "IPv6") {
    $search_term_edited = $Tools->reformat_IPv6_for_search($search_term);
}
//reformat the IPv4 address!
# get all custom fields
$custom_address_fields = $Tools->fetch_custom_fields("ipaddresses");
$custom_subnet_fields = $Tools->fetch_custom_fields("subnets");
$custom_vlan_fields = $Tools->fetch_custom_fields("vlans");
# set selected address fields array
コード例 #3
0
ファイル: class.Tools.php プロジェクト: jonashauge/phpipam
 /**
  * Calculates IP calculator result per IP type
  *
  * @access public
  * @param mixed $cidr
  * @return void
  */
 public function calculate_ip_calc_results($cidr)
 {
     # addresses class
     $Addresses = new Addresses($this->Database);
     # detect address and calculate
     return $Addresses->identify_address($cidr) == "IPv6" ? $this->calculate_IPv6_calc_results($cidr) : $this->calculate_IPv4_calc_results($cidr);
 }