FreenetIS
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | List of all members
Ip_address_Model Class Reference
Inheritance diagram for Ip_address_Model:
ORM

Public Member Functions

 __toString ()
 Gives IP address is string is writted.
 get_all_ip_addresses ($limit_from=0, $limit_results=50, $order_by= 'ip_address', $order_by_direction= 'ASC', $filter_sql= '')
 Function gets all ip addresses.
 count_all_ip_addresses ($filter_sql= '')
 Function counts all ip addresses.
 get_gateway_of_subnet ($subnet_id)
 Function gets gateway of gievn subnet.
 get_dhcp_of_subnet ($subnet_id)
 Function gets gateway of gievn subnet.
 get_allowed_ip_addresses ()
 Gets all allowed IP addresses.
 get_unallowed_ip_addresses ()
 Same as previous method, but return unallowed ip addresses.
 get_unallowed_ip_addresses_by_type ($type)
 Same as previous method, but return unallowed ip addresses for a specific message type.
 get_ip_addresses_of_member ($member_id, $subnet_id=NULL, $cloud_id=NULL, $ignore_member_notif_settings=TRUE)
 Function gets all ip address of interfaces of devices of users of given member.
 get_ip_addresses_of_user ($user_id, $subnet_id=NULL, $cloud_id=NULL, $ignore_member_notif_settings=TRUE)
 Function gets all ip address of interfaces of devices of user.
 get_ip_addresses_of_device ($device_id)
 Gets all ip addresses of device.
 get_ip_addresses_of_subnet ($subnet_id)
 Function gets ip addresses of subnet.
 get_ip_addresses_with_unallowed_connecting_place ()
 Returns all IDs of IP addresses with unallowed connecting place.
 get_ip_addresses_with_expired_connection_test ()
 Returns all IDs of IP addresses with expired connection test.
 get_ip_addresses_with_self_cancel ()
 Returns all ip addresses which can cancel redirect by themselves.
 get_ips_and_redirections_of_member ($member_id, $sql_offset, $limit_results, $order_by, $order_by_direction)
 Gets all ip addresses including their redirections.
 count_ips_and_redirections_of_member ($member_id)
 Gets count of all ip addresses including their redirections.
 count_all_ip_addresses_by_member_and_subnet ($member_id, $subnet_id)
 Counts all ip addresses by member and subnet.
 get_all_ip_addresses_of_iface ($iface_id, $with_children=FALSE)
 Returns all ip addresses of iface (optional: and with its children ifaces)
 delete_ip_addresses_by_subnet_member ($subnet_id, $member_id)
 Deletes all IP addresses by given subnet and member.
 count_all_ip_addresses_without_member_by_subnet ($subnet_id)
 Counts all ip addresses without member by given subnet.
 delete_ip_address_with_member ($ip_address)
 Deletes IP address.
 delete_ip_addresses_of_subnet_with_owner ($subnet_id)
 Deletes all IP addresses of subnet with owner.
 get_ip_addresses_qos_ceil_rate ()
 Returns ip addresses of members with set-up qos ceil or rate.
 select_list_grouped ()
 Gets list of IP addresses ordered by IP address grouped by subnet.
 get_first_ip_address_of_subnet ($subnet_id, $without_owner=FALSE)
 Returns first IP address of subnet.
 get_last_ip_address_of_subnet ($subnet_id, $without_owner=FALSE)
 Returns last IP address of subnet.
 get_free_ip_addresses ($ip_address_like)
 Returns all free IP addresses similar to given IP address.

Static Public Member Functions

static get_whitelist_types ()
 Gets translated whitelist types.

Public Attributes

const NO_WHITELIST = 0
 No whitelist means, that is ip address can be redirected in any time (typical state)
const PERMANENT_WHITELIST = 1
 IP address is in permanent whitelist - it is never redirected (useful for special members), can be redirected only by message which ignores whitelist.
const TEMPORARY_WHITELIST = 2
 IP address is in temporary whitelist - for limited period of time it is not redirected, for example when someone should be redirected, but he has to pay using internet banking.

Static Public Attributes

static $whitelist_types

Protected Attributes

 $belongs_to = array('iface', 'subnet', 'member')

Member Function Documentation

Ip_address_Model::__toString ( )

Gives IP address is string is writted.

Returns
string
Ip_address_Model::count_all_ip_addresses (   $filter_sql = '')

Function counts all ip addresses.

Parameters
array$filter_values
Returns
integer
Ip_address_Model::count_all_ip_addresses_by_member_and_subnet (   $member_id,
  $subnet_id 
)

Counts all ip addresses by member and subnet.

Author
Michal Kliment
Parameters
integer$member_id
integer$subnet_id
Returns
integer
Ip_address_Model::count_all_ip_addresses_without_member_by_subnet (   $subnet_id)

Counts all ip addresses without member by given subnet.

Author
Michal Kliment
Parameters
integer$subnet_id
Returns
integer
Ip_address_Model::count_ips_and_redirections_of_member (   $member_id)

Gets count of all ip addresses including their redirections.

Used in member's profile screen.

Author
Ondřej Fibich
Parameters
integer$member_id
Returns
integer
Ip_address_Model::delete_ip_address_with_member (   $ip_address)

Deletes IP address.

Author
Michal Kliment
Parameters
string$ip_address
Ip_address_Model::delete_ip_addresses_by_subnet_member (   $subnet_id,
  $member_id 
)

Deletes all IP addresses by given subnet and member.

Author
Michal Kliment
Parameters
integer$subnet_id
integer$member_id
Ip_address_Model::delete_ip_addresses_of_subnet_with_owner (   $subnet_id)

Deletes all IP addresses of subnet with owner.

Author
Michal Kliment klime.nosp@m.nt@f.nosp@m.reene.nosp@m.tis..nosp@m.org
Parameters
type$subnet_id
Ip_address_Model::get_all_ip_addresses (   $limit_from = 0,
  $limit_results = 50,
  $order_by = 'ip_address',
  $order_by_direction = 'ASC',
  $filter_sql = '' 
)

Function gets all ip addresses.

!!!!!! SECURITY WARNING !!!!!! Be careful when you using this method, param $filter_sql is unprotected for SQL injections, security should be made at controller site using Filter_form class. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Parameters
integer$limit_from
integer$limit_results
string$order_by
string$order_by_direction
array$filter_values
Returns
Mysql_Result
Ip_address_Model::get_all_ip_addresses_of_iface (   $iface_id,
  $with_children = FALSE 
)

Returns all ip addresses of iface (optional: and with its children ifaces)

Author
Michal Kliment
Parameters
integer$iface_id
type$with_child
Returns
Mysql_Result
Ip_address_Model::get_allowed_ip_addresses ( )

Gets all allowed IP addresses.

These are registered IP addresses, which have no redirection set. Unknown IP addresses (not present in system) and IP addresses with a redirection set are not exported.

See Also
Web_interface_Controller::allowed_ip_addresses
Returns
Mysql_Result
Ip_address_Model::get_dhcp_of_subnet (   $subnet_id)

Function gets gateway of gievn subnet.

Parameters
string$network_address
Returns
Ip_address_Model
Ip_address_Model::get_first_ip_address_of_subnet (   $subnet_id,
  $without_owner = FALSE 
)

Returns first IP address of subnet.

Author
Michal Kliment klime.nosp@m.nt@f.nosp@m.reene.nosp@m.tis..nosp@m.org
Parameters
type$subnet_id
Returns
type
Ip_address_Model::get_free_ip_addresses (   $ip_address_like)

Returns all free IP addresses similar to given IP address.

Author
Michal Kliment
Parameters
type$ip_address_like
Returns
type
Ip_address_Model::get_gateway_of_subnet (   $subnet_id)

Function gets gateway of gievn subnet.

Parameters
string$network_address
Returns
Ip_address_Model
Ip_address_Model::get_ip_addresses_of_device (   $device_id)

Gets all ip addresses of device.

Author
Jiri Svitak
Parameters
integer$device_id
Returns
Mysql_Result
Ip_address_Model::get_ip_addresses_of_member (   $member_id,
  $subnet_id = NULL,
  $cloud_id = NULL,
  $ignore_member_notif_settings = TRUE 
)

Function gets all ip address of interfaces of devices of users of given member.

Parameters
integer | array$member_idMember ID or array of member IDs
integer$subnet_id
integer$cloud_id
boolean$ignore_member_notif_settingsShould be member notification setting ignored?
Returns
Mysql_Result
Ip_address_Model::get_ip_addresses_of_subnet (   $subnet_id)

Function gets ip addresses of subnet.

Parameters
integer$subnet_id
Returns
Mysql_Result
Ip_address_Model::get_ip_addresses_of_user (   $user_id,
  $subnet_id = NULL,
  $cloud_id = NULL,
  $ignore_member_notif_settings = TRUE 
)

Function gets all ip address of interfaces of devices of user.

Parameters
integer | array$user_idUser ID or array of user IDs
integer$subnet_id
integer$cloud_id
boolean$ignore_member_notif_settingsShould be member notification setting ignored?
Returns
Mysql_Result
Ip_address_Model::get_ip_addresses_qos_ceil_rate ( )

Returns ip addresses of members with set-up qos ceil or rate.

Author
Michal Kliment
Returns
MySQL Result
Ip_address_Model::get_ip_addresses_with_expired_connection_test ( )

Returns all IDs of IP addresses with expired connection test.

Author
Ondrej Fibich
Returns
Mysql_Result
Ip_address_Model::get_ip_addresses_with_self_cancel ( )

Returns all ip addresses which can cancel redirect by themselves.

Author
Michal Kliment
Returns
Mysql_Result
Ip_address_Model::get_ip_addresses_with_unallowed_connecting_place ( )

Returns all IDs of IP addresses with unallowed connecting place.

Author
Michal Kliment
Returns
Mysql_Result
Ip_address_Model::get_ips_and_redirections_of_member (   $member_id,
  $sql_offset,
  $limit_results,
  $order_by,
  $order_by_direction 
)

Gets all ip addresses including their redirections.

Used in member's profile screen.

Author
Jiri Svitak
Parameters
integer$member_id
integer$sql_offset
integer$limit_results
string$order_by
string$order_by_direction
Returns
Mysql_Result
Ip_address_Model::get_last_ip_address_of_subnet (   $subnet_id,
  $without_owner = FALSE 
)

Returns last IP address of subnet.

Author
Michal Kliment klime.nosp@m.nt@f.nosp@m.reene.nosp@m.tis..nosp@m.org
Parameters
type$subnet_id
Returns
type
Ip_address_Model::get_unallowed_ip_addresses ( )

Same as previous method, but return unallowed ip addresses.

Author
Michal Kliment
See Also
Web_interface_Controller::unallowed_ip_addresses
Returns
type
Ip_address_Model::get_unallowed_ip_addresses_by_type (   $type)

Same as previous method, but return unallowed ip addresses for a specific message type.

Author
Ondrej Fibich
See Also
Web_interface_Controller::unallowed_ip_addresses
Parameters
int$typemessage type constant
Returns
type
static Ip_address_Model::get_whitelist_types ( )
static

Gets translated whitelist types.

Returns
array
Ip_address_Model::select_list_grouped ( )

Gets list of IP addresses ordered by IP address grouped by subnet.

Author
Ondřej Fibich
Returns
array

Member Data Documentation

Ip_address_Model::$whitelist_types
static
Initial value:
array
(
self::NO_WHITELIST => 'No whitelist',
self::PERMANENT_WHITELIST => 'Permanent whitelist',
self::TEMPORARY_WHITELIST => 'Temporary whitelist'
)

The documentation for this class was generated from the following file: