Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Condition_User_IP_Edit_Fns Class Reference
Inheritance diagram for Condition_User_IP_Edit_Fns:
Condition_Edit_Fns Asset_Edit_Fns MySource_Object

Public Member Functions

 __construct ()
 
- Public Member Functions inherited from Condition_Edit_Fns
 __construct ()
 
- Public Member Functions inherited from Asset_Edit_Fns
 Asset_Edit_Fns ()
 
 paintPaths (&$asset, &$o, $prefix)
 
 paintEditRemapURLs (&$asset, &$o, $prefix)
 
 processPaths (&$asset, &$o, $prefix)
 
 processEditRemapURLs (&$asset, &$o, $prefix)
 
 paintURLs (&$asset, &$o, $prefix)
 
 paintAddRemapURLs (&$asset, &$o, $prefix)
 
 processAddRemapURLs (&$asset, &$o, $prefix)
 
 isWorkflowComplete (&$asset)
 
 paintNoticeLinkedAsset (&$asset, $link_value, $type_codes=Array(), $field_name='', $multiple=FALSE)
 
 processNoticeLinkedAsset (&$asset, $link_value, $field_name='', $multiple=FALSE)
 
 isSearchInstalled (&$asset, $prefix)
 
 isBeingCreated (&$asset)
 
 isNotBeingCreated (&$asset)
 
 paintAutomaticRemapSetting (&$asset, &$o, $prefix)
 
 paintCreateLink (&$asset, &$o, $prefix)
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

Static Public Member Functions

static paintEditInterface (Array $condition_data, Backend_Outputter $o, $prefix, $write_access)
 
static processEditInterface (Backend_Outputter $o, $prefix)
 
static paintIPAddressField ($prefix, $value=NULL)
 
static processIPAddressField ($octets)
 
static paintSubnetMaskField ($prefix, $value=NULL)
 
static processSubnetMaskField ($octets)
 
static convertSubnetIPtoCIDR ($subnet_ip)
 
static convertCIDRtoSubnetIP ($cidr_value)
 
static isInSubnet ($ip_address, $network_ip, $subnet_ip)
 
static sortByCIDROrder ($ip_ranges)
 
static importRulesFromCSV ($file_name)
 
- Static Public Member Functions inherited from Condition_Edit_Fns
static paintEditInterface (Array &$condition_data, Backend_Outputter $o, $prefix, $write_access)
 
static processEditInterface (Backend_Outputter $o, $prefix)
 

Static Protected Member Functions

static _isValidSubnetMask ($subnet_ip)
 
static _getPossibleSubnetOctets ()
 
static _doesIPBeginSubnet ($ip_address, $subnet_ip)
 

Additional Inherited Members

- Data Fields inherited from Asset_Edit_Fns
 $static_screens
 

Detailed Description

Definition at line 35 of file condition_user_ip_edit_fns.inc.

Constructor & Destructor Documentation

__construct ( )

Constructor

See Also
Asset_Edit_Fns::__construct()

Definition at line 44 of file condition_user_ip_edit_fns.inc.

Member Function Documentation

static _doesIPBeginSubnet (   $ip_address,
  $subnet_ip 
)
staticprotected

Returns TRUE if the IP address given begins the passed subnet mask

If IP & (~Subnet) == '0.0.0.0', the IP address is the first (network) address in the subnet

Parameters
string$ip_addressthe IP address
string$subnet_ipthe subnet mask in IP format
Returns
boolean private

Definition at line 587 of file condition_user_ip_edit_fns.inc.

static _getPossibleSubnetOctets ( )
staticprotected

Returns a list of possible octets

Returns
array private

Definition at line 557 of file condition_user_ip_edit_fns.inc.

static _isValidSubnetMask (   $subnet_ip)
staticprotected

Returns TRUE if the IP address passed is a valid subnet mask

Parameters
string$subnet_ipthe subnet mask to check
Returns
boolean private

Definition at line 496 of file condition_user_ip_edit_fns.inc.

static convertCIDRtoSubnetIP (   $cidr_value)
static

Converts a CIDR bit-count to a subnet IP mask or FALSE if CIDR value is invalid (outside the range 0..32)

For example:

  • given a CIDR value of 24, this function should return '255.255.255.0'
  • given a CIDR value of 33, this function should return FALSE
Parameters
int$cidr_valuethe CIDR bit-count value
Returns
mixed string|boolean public?

Definition at line 424 of file condition_user_ip_edit_fns.inc.

static convertSubnetIPtoCIDR (   $subnet_ip)
static

Converts a Subnet IP mask to a Classless Inter-Domain Routing (CIDR) bit-count or FALSE if IP address is an invalid subnet mask

For example:

  • given the subnet mask '255.255.255.255', this function returns 32
  • given the subnet mask '255.248.0.0', this function returns 13
  • given the subnet mask '255.248.0.255', this function returns FALSE
Parameters
string$subnet_ipThe subnet mask in IP address format
Returns
mixed int|boolean public?

Definition at line 389 of file condition_user_ip_edit_fns.inc.

static importRulesFromCSV (   $file_name)
static

import rules from a CSV file - returns array of condition data or FALSE if CSV file is invalid

Parameters
string$file_namethe (temporary) file name to import the CSV from
Returns
mixed array|boolean public

Definition at line 612 of file condition_user_ip_edit_fns.inc.

static isInSubnet (   $ip_address,
  $network_ip,
  $subnet_ip 
)
static

Returns TRUE if the IP address is a part of the subnet specified

Remote user's IP is in the subnet if you bitwise-AND it with the subnet mask and it comes up with the same IP address as the passed network IP.

Parameters
string$ip_addressthe IP address of the remote user
string$network_ipthe network IP address to test against
string$subnet_ipthe subnet mask to use
Returns
boolean public

Definition at line 470 of file condition_user_ip_edit_fns.inc.

static paintEditInterface ( Array  $condition_data,
Backend_Outputter  $o,
  $prefix,
  $write_access 
)
static

Paint the backend editing interface for this condition

Parameters
array&$condition_dataArray of settings for this condition
Backend_Outputter$oBackend outputter to use
string$prefixPrefix for form elements
boolean$write_accessWhether we have access to edit the field values
Returns
void public

Definition at line 62 of file condition_user_ip_edit_fns.inc.

static paintIPAddressField (   $prefix,
  $value = NULL 
)
static

Paints an IP address field

Parameters
string$prefixthe prefix for form fields
string$valuethe current value of the subnet mask (in dot notation) (default: blank fields)
Returns
void public?

Definition at line 268 of file condition_user_ip_edit_fns.inc.

static paintSubnetMaskField (   $prefix,
  $value = NULL 
)
static

Paints a subnet mask field

Parameters
string$prefixthe prefix for form fields
string$valuethe current value of the subnet mask (in dot notation) (default: '255.255.255.255' - single IP)
Returns
void public?

Definition at line 326 of file condition_user_ip_edit_fns.inc.

static processEditInterface ( Backend_Outputter  $o,
  $prefix 
)
static

Process the backend editing interface for this condition

Parameters
Backend_Outputter$oBackend outputter to use
string$prefixPrefix for form elements
Returns
array public

Definition at line 194 of file condition_user_ip_edit_fns.inc.

static processIPAddressField (   $octets)
static

Processes an IP address field

Parameters
array$octetsthe octets from the form response
Returns
mixed int|boolean public?

Definition at line 292 of file condition_user_ip_edit_fns.inc.

static processSubnetMaskField (   $octets)
static

Processes a subnet mask field

Parameters
array$octetsthe data from the form request
Returns
mixed string|NULL public?

Definition at line 353 of file condition_user_ip_edit_fns.inc.

static sortByCIDROrder (   $ip_ranges)
static

Sort IP range list in order from largest subnet to smallest subnet

Parameters
array$ip_rangesunsorted list of IP addresses
Returns
array public

Definition at line 530 of file condition_user_ip_edit_fns.inc.


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