ultimix
security_1_0_0 Class Reference

Public Member Functions

 __construct ()
 set_g ($Field, $Value)
 set_p ($Field, $Value)
 set_c ($Field, $Value)
 set_s ($Field, $Value)
 reset_s ($Field, $Value)
 unset_s ($Field)
 reset_g ($Field, $Value)
 unset_g ($Field)
 reset_c ($Field, $Value, $Expire=0)
 unset_c ($Field)
 reset_p ($Field, $Value)
 unset_p ($Field)
 get_g ($Field, $Type= 'set', $Default= '_throw_exception')
 get_p ($Field, $Type= 'set', $Default= '_throw_exception')
 get_s ($Field, $Type= 'set', $Default= '_throw_exception')
 get_srv ($Field, $Type= 'set', $Default= '_throw_exception')
 get_c ($Field, $Type= 'set', $Default= '_throw_exception')
 get_gp ($Field, $Type= 'set', $DefaultValue= '_throw_exception')
 get ($Data, $Type)

Data Fields

 $SecurityUtilities = false
 $Settings = false
 $String = false
 $SupportedDataTypes = false

Detailed Description

Class for safe data processing.

Author
Dodonov A.A.

Definition at line 26 of file security.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 53 of file security.php.

{
try
{
if( session_id() == '' )
{
@session_start();
}
$this->SecurityUtilities = get_package( 'security::security_utilities' , '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 (   $Data,
  $Type 
)

Data processing function.

Parameters
$Data- Data to process.
$Type- Type of the processing.
Returns
Processed data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 759 of file security.php.

{
try
{
if( is_array( $Data ) || is_object( $Data ) )
{
return( $this->SupportedDataTypes->dispatch_complex_data( $Data , $Type ) );
}
return( $this->SupportedDataTypes->compile_data( $Data , $Type ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_c (   $Field,
  $Type = 'set',
  $Default = '_throw_exception' 
)

Selecting data from $_COOKIE.

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

Definition at line 679 of file security.php.

{
try
{
return( $this->SecurityUtilities->get_value( $_COOKIE , $Field , $Type , $Default ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_g (   $Field,
  $Type = 'set',
  $Default = '_throw_exception' 
)

Selecting data from $_GET.

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

Definition at line 511 of file security.php.

{
try
{
return( $this->SecurityUtilities->get_value( $_GET , $Field , $Type , $Default ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_gp (   $Field,
  $Type = 'set',
  $DefaultValue = '_throw_exception' 
)

Selecting data from $_POST or $_GET.

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

Definition at line 721 of file security.php.

{
try
{
return( $this->SecurityUtilities->get_global( $Field , $Type , GET | POST , $DefaultValue ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_p (   $Field,
  $Type = 'set',
  $Default = '_throw_exception' 
)

Selecting data from $_POST.

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

Definition at line 553 of file security.php.

{
try
{
return( $this->SecurityUtilities->get_value( $_POST , $Field , $Type , $Default ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_s (   $Field,
  $Type = 'set',
  $Default = '_throw_exception' 
)

Selecting data from $_SESSION.

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

Definition at line 595 of file security.php.

{
try
{
return( $this->SecurityUtilities->get_value( $_SESSION , $Field , $Type , $Default ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
get_srv (   $Field,
  $Type = 'set',
  $Default = '_throw_exception' 
)

Selecting data from $_SERVER.

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

Definition at line 637 of file security.php.

{
try
{
return( $this->SecurityUtilities->get_value( $_SERVER , $Field , $Type , $Default ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
reset_c (   $Field,
  $Value,
  $Expire = 0 
)

Function sets value in array $_COOKIE.

Parameters
$Field- Field to set.
$Value- Data.
$Expire- Expiration date (in seconds).
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 374 of file security.php.

{
try
{
setcookie( $Field , $Value , $Expire === 0 ? 0 : time() + $Expire );
$_COOKIE[ $Field ] = $Value;
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
reset_g (   $Field,
  $Value 
)

Function sets value in array $_GET.

Parameters
$Field- Field to set.
$Value- Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 306 of file security.php.

{
try
{
$_SESSION[ $Field ] = $Value;
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
reset_p (   $Field,
  $Value 
)

Function sets value in array $_POST.

Parameters
$Field- Field to set.
$Value- Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 439 of file security.php.

{
try
{
$_POST[ $Field ] = $Value;
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
reset_s (   $Field,
  $Value 
)

Function sets value in array $_SESSION.

Parameters
$Field- Field to set.
$Value- Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 242 of file security.php.

{
try
{
$_SESSION[ $Field ] = $Value;
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
set_c (   $Field,
  $Value 
)

Function sets value in array $_COOKIE.

Parameters
$Field- Field to set.
$Value- Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 168 of file security.php.

{
try
{
if( isset( $_COOKIE[ $Field ] ) === false )
{
$_COOKIE[ $Field ] = $Value;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
set_g (   $Field,
  $Value 
)

Function sets value in array $_GET.

Parameters
$Field- Field to set.
$Value- Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 94 of file security.php.

{
try
{
if( isset( $_GET[ $Field ] ) === false )
{
$_GET[ $Field ] = $Value;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
set_p (   $Field,
  $Value 
)

Function sets value in array $_POST.

Parameters
$Field- Field to set.
$Value- Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 131 of file security.php.

{
try
{
if( isset( $_POST[ $Field ] ) === false )
{
$_POST[ $Field ] = $Value;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
set_s (   $Field,
  $Value 
)

Function sets value in array $_SESSION.

Parameters
$Field- Field to set.
$Value- Data.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 205 of file security.php.

{
try
{
if( isset( $_SESSION[ $Field ] ) === false )
{
$_SESSION[ $Field ] = $Value;
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
unset_c (   $Field)

Function deletes value in array $_COOKIE.

Parameters
$Field- Field to set.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 405 of file security.php.

{
try
{
unset( $_COOKIE[ $Field ] );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
unset_g (   $Field)

Function deletes value in array $_GET.

Parameters
$Field- Field to set.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 336 of file security.php.

{
try
{
unset( $_GET[ $Field ] );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
unset_p (   $Field)

Function deletes value in array $_POST.

Parameters
$Field- Field to set.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 469 of file security.php.

{
try
{
unset( $_POST[ $Field ] );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
unset_s (   $Field)

Function deletes value in array $_SESSION.

Parameters
$Field- Field to set.
Exceptions
ExceptionAn exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 272 of file security.php.

{
try
{
unset( $_SESSION[ $Field ] );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$SecurityUtilities = false

Cached objects.

Author
Dodonov A.A.

Definition at line 38 of file security.php.

$Settings = false

Definition at line 39 of file security.php.

$String = false

Definition at line 40 of file security.php.

$SupportedDataTypes = false

Definition at line 41 of file security.php.


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