ultimix
security_utilities_1_0_0 Class Reference

Public Member Functions

 __construct ()
 get_fields_from_array ($Prefix, $Mode, &$Array)
 get_fields ($Prefix, $Mode)
 get_value (&$Array, $Field, $Type= 'set', $DefaultValue= '_throw_exception')
 get_global ($Field, $Type, $Mode, $DefaultValue= '_throw_exception')
 get_all_posted_data ()

Data Fields

 $Security = false
 $SecurityParser = false
 $Settings = false
 $String = false
 $SupportedDataTypes = false

Detailed Description

Class with additional algorithms.

Author
Dodonov A.A.

Definition at line 26 of file security_utilities.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 54 of file security_utilities.php.

{
try
{
$this->SecurityParser = get_package( 'security::security_parser' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$this->SupportedDataTypes = get_package( 'security::supported_data_types' , 'last' , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Member Function Documentation

get_all_posted_data ( )

Function returns all data from $_POST.

Returns
Secure $_POST.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 540 of file security_utilities.php.

{
try
{
if( $this->Security === false )
{
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
return( $this->Security->get( $_POST , 'string' ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_fields (   $Prefix,
  $Mode 
)

Selecting fields.

Parameters
$Prefix- Search string.
$Mode- Data resource.
Returns
- Array with fields names.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 146 of file security_utilities.php.

{
try
{
$Fields = array();
if( $Mode & POST )
{
$Fields = array_merge( $this->get_fields_from_array( $Prefix , $Mode , $_POST ) , $Fields );
}
if( $Mode & GET )
{
$Fields = array_merge( $this->get_fields_from_array( $Prefix , $Mode , $_GET ) , $Fields );
}
if( $Mode & COOKIE )
{
$Fields = array_merge( $this->get_fields_from_array( $Prefix , $Mode , $_COOKIE ) , $Fields );
}
if( $Mode & SESSION )
{
$Fields = array_merge( $this->get_fields_from_array( $Prefix , $Mode , $_SESSION ) , $Fields );
}
return( $Fields );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_fields_from_array (   $Prefix,
  $Mode,
$Array 
)

Selecting fields from the array.

Parameters
$Prefix- Search string.
$Mode- Data resource.
$Array- Array.
Returns
- Array with fields names.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 98 of file security_utilities.php.

{
try
{
$Fields = array();
foreach( $Array as $k => $v )
{
if( strpos( $k , $Prefix ) !== false )
{
$Fields [] = $k;
}
}
return( $Fields );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_global (   $Field,
  $Type,
  $Mode,
  $DefaultValue = '_throw_exception' 
)

Selecting data.

Parameters
$Field- Field name.
$Type- Data type.
$Mode- Data resource.
$DefaultValue- Default value.
Returns
Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 491 of file security_utilities.php.

{
try
{
if( $this->Security === false )
{
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
if( $Mode & PREFIX_NAME )
{
$Data = $this->merge_globals( $Mode );
$Return = array();
$this->fetch_data( $Field , $Data , $Mode , $Return );
return( $this->Security->get( $Return , $Type ) );
}
if( $Type !== 'set' && ( $Value = $this->handle_get( $Field , $Mode ) ) !== false )
{
return( $this->Security->get( $Value , $Type ) );
}
$Data = $this->merge_globals( $Mode );
return( $this->handle_default_set( $Data , $Field , $Type , $DefaultValue ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_value ( $Array,
  $Field,
  $Type = 'set',
  $DefaultValue = '_throw_exception' 
)

Selecting data from the array.

Parameters
$Array- Data array.
$Field- Field name in array $_GET.
$Type- Data type.
$DefaultValue- Default value.
Returns
Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 211 of file security_utilities.php.

{
try
{
if( isset( $Array[ $Field ] ) && $Type !== 'set' )
{
if( $this->Security === false )
{
$this->Security = get_package( 'security' , 'last' , __FILE__ );
}
return( $this->Security->get( $Array[ $Field ] , $Type ) );
}
return( $this->handle_default_set( $Array , $Field , $Type , $DefaultValue ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$Security = false

Cached objects.

Author
Dodonov A.A.

Definition at line 38 of file security_utilities.php.

$SecurityParser = false

Definition at line 39 of file security_utilities.php.

$Settings = false

Definition at line 40 of file security_utilities.php.

$String = false

Definition at line 41 of file security_utilities.php.

$SupportedDataTypes = false

Definition at line 42 of file security_utilities.php.


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