Public Member Functions | |
set_expired_all_subnets ($flag=1) | |
Sets all subnets as (not) expired. | |
set_expired_subnets ($subnets, $flag=1) | |
Sets subnets as (not) expired. | |
set_expired_subnets_of_device ($device_id, $flag=1) | |
Sets subnets of device as (not) expired. | |
is_any_subnet_of_device_expired ($device_id) | |
Check if any of device subnet on that the device is gateway is expired. | |
is_mac_unique_in_subnet ($mac, $ip_address_id=NULL, $subnet_id=NULL) | |
Check if the MAC address is unique in the subnet. | |
get_net_and_mask_of_subnet ($subnet_id=NULL) | |
Gets mask and net of subnet. | |
get_redirected_ranges () | |
Gets redirected ranges. | |
count_all_subnets ($filter_sql= '') | |
Function counts all subnets specified by filter. | |
get_all_subnets ($limit_from=0, $limit_results=NULL, $order_by= 'id', $order_by_direction= 'ASC', $filter_sql= '') | |
Function gets all subnets specified by filter. | |
get_clouds_of_subnet ($subnet_id) | |
Gets clouds of subnet. | |
get_subnet_of_ip_address ($ip_address) | |
Function finds subnet to which given ip address belongs to. | |
get_subnet_of_user ($user_id) | |
Function tries to find subnet of user. | |
get_items_of_subnet ($subnet_id) | |
Function gets items of subnet to export. | |
get_subnet_of_ip_prefix ($ip_prefix) | |
Function gets all subnets of the ip prefix. | |
get_phones_of_subnet ($subnet_id) | |
Function gets phone numbers of users of subnet. | |
get_all_subnets_without_allowed_subnets_of_member ($member_id) | |
Returns all subnets without allowed subnets of member. | |
get_subnet_without_allowed_subnets_of_member_by_ip_address ($member_id, $ip_address) | |
Returns subnet by ip address without member's allowed subnets. | |
select_list_by_net () | |
Gets list of subnets ordered by net for dropdown. | |
check_overlaps_of_subnets ($network_address, $netmask, $subnet_id=NULL) | |
Checks of overlaps of subnets. | |
get_free_ip_addresses () | |
Returns array of free IP addresses of subnet. | |
get_all_subnets_with_owner () | |
Returns all subnets with owner. | |
get_members ($subnet_id=NULL) | |
Returns all members with at least one ip address in subnet. | |
get_all_subnets_by_device ($device_id=NULL, $gateway=FALSE) | |
Returns all subnets by device. | |
get_all_unique_subnets_by_device ($device_id=NULL) | |
Returns all unique subnets by device. | |
get_all_dependent_subnets_by_device ($device_id=NULL, $recursive=TRUE) | |
Returns all dependent subnets of device. | |
get_gateway ($subnet_id=NULL) | |
Get gateway of subnet. | |
has_gateway ($subnet_id=NULL) | |
Check whether subnet has gateway. | |
get_subnet_for_connection_request ($ip_address) | |
This method is used for determining whether the user is connected from registered connection. | |
get_all_subnets_with_gateway () | |
Returns all subnets with existing gateway. | |
get_all_dhcp_subnets_without_gateway () | |
Return all subnets on which DHCP is running and has no gateway. |
Protected Attributes | |
$has_one = array('subnets_owner') | |
$has_many = array('ip_addresses', 'allowed_subnets', 'connection_requests') | |
$has_and_belongs_to_many = array('clouds') |
Subnet_Model::check_overlaps_of_subnets | ( | $network_address, | |
$netmask, | |||
$subnet_id = NULL |
|||
) |
Checks of overlaps of subnets.
string | $network_address | |
string | $netmask | |
type | $subnet_id |
Subnet_Model::count_all_subnets | ( | $filter_sql = '' | ) |
Function counts all subnets specified by filter.
array | $filter_values |
Subnet_Model::get_all_dependent_subnets_by_device | ( | $device_id = NULL , |
|
$recursive = TRUE |
|||
) |
Returns all dependent subnets of device.
type | $device_id |
Subnet_Model::get_all_dhcp_subnets_without_gateway | ( | ) |
Return all subnets on which DHCP is running and has no gateway.
Subnet_Model::get_all_subnets | ( | $limit_from = 0 , |
|
$limit_results = NULL , |
|||
$order_by = 'id' , |
|||
$order_by_direction = 'ASC' , |
|||
$filter_sql = '' |
|||
) |
Function gets all subnets specified by filter.
integer | $limit_from | |
integer | $limit_results | |
string | $order_by | |
string | $order_by_direction | |
array | $filter_values |
Subnet_Model::get_all_subnets_by_device | ( | $device_id = NULL , |
|
$gateway = FALSE |
|||
) |
Returns all subnets by device.
type | $device_id |
Subnet_Model::get_all_subnets_with_gateway | ( | ) |
Returns all subnets with existing gateway.
Subnet_Model::get_all_subnets_with_owner | ( | ) |
Returns all subnets with owner.
Subnet_Model::get_all_subnets_without_allowed_subnets_of_member | ( | $member_id | ) |
Returns all subnets without allowed subnets of member.
integer | $member_id |
Subnet_Model::get_all_unique_subnets_by_device | ( | $device_id = NULL | ) |
Returns all unique subnets by device.
type | $device_id |
Subnet_Model::get_clouds_of_subnet | ( | $subnet_id | ) |
Gets clouds of subnet.
integer | $subnet_id |
Subnet_Model::get_free_ip_addresses | ( | ) |
Returns array of free IP addresses of subnet.
Subnet_Model::get_gateway | ( | $subnet_id = NULL | ) |
Get gateway of subnet.
type | $subnet_id |
Subnet_Model::get_items_of_subnet | ( | $subnet_id | ) |
Function gets items of subnet to export.
integer | $subnet_id |
Subnet_Model::get_members | ( | $subnet_id = NULL | ) |
Returns all members with at least one ip address in subnet.
type | $subnet_id |
Subnet_Model::get_net_and_mask_of_subnet | ( | $subnet_id = NULL | ) |
Gets mask and net of subnet.
integer | $subnet_id |
Subnet_Model::get_phones_of_subnet | ( | $subnet_id | ) |
Function gets phone numbers of users of subnet.
integer | $subnet_id |
Subnet_Model::get_redirected_ranges | ( | ) |
Gets redirected ranges.
Any IP address belonging to these subnet ranges can be redirected.
Subnet_Model::get_subnet_for_connection_request | ( | $ip_address | ) |
This method is used for determining whether the user is connected from registered connection.
If he is the null is returned. If not then subnet from which he is connected is searched. If the user may obtain this IP from the searched subnet the ID of subnet is returned. (but there must not be any connection request on this connection already in tha database)
string | $ip_address | IP address from which the connection request is made |
Subnet_Model::get_subnet_of_ip_address | ( | $ip_address | ) |
Function finds subnet to which given ip address belongs to.
string | $ip_address |
Subnet_Model::get_subnet_of_ip_prefix | ( | $ip_prefix | ) |
Function gets all subnets of the ip prefix.
string | $ip_prefix |
Subnet_Model::get_subnet_of_user | ( | $user_id | ) |
Function tries to find subnet of user.
Used in devices/add.
integer | $user_id |
Subnet_Model::get_subnet_without_allowed_subnets_of_member_by_ip_address | ( | $member_id, | |
$ip_address | |||
) |
Returns subnet by ip address without member's allowed subnets.
integer | $member_id | |
string | $ip_address |
Subnet_Model::has_gateway | ( | $subnet_id = NULL | ) |
Check whether subnet has gateway.
type | $subnet_id |
Subnet_Model::is_any_subnet_of_device_expired | ( | $device_id | ) |
Check if any of device subnet on that the device is gateway is expired.
int | $device_id |
Subnet_Model::is_mac_unique_in_subnet | ( | $mac, | |
$ip_address_id = NULL , |
|||
$subnet_id = NULL |
|||
) |
Check if the MAC address is unique in the subnet.
string | $mac | MAC address |
int | $ip_address_id | Iface ID - for edit purposes |
int | $subnet_id | Subnet id [Optional - deafult self ID] |
Subnet_Model::select_list_by_net | ( | ) |
Gets list of subnets ordered by net for dropdown.
Subnet_Model::set_expired_all_subnets | ( | $flag = 1 | ) |
Sets all subnets as (not) expired.
int | $flag | expired (1) or not (0) [optional] |
Subnet_Model::set_expired_subnets | ( | $subnets, | |
$flag = 1 |
|||
) |
Sets subnets as (not) expired.
array | int | $subnets | Multiple subnet IDs or a single subnet ID |
int | $flag | expired (1) or not (0) [optional] |
Subnet_Model::set_expired_subnets_of_device | ( | $device_id, | |
$flag = 1 |
|||
) |
Sets subnets of device as (not) expired.
type | $device_id | ID of device |
type | $flag | sexpired (1) or not (0) [optional] |