Detailed Description
Class with custom validations.
- Author
- Dodonov A.A.
Definition at line 26 of file custom_validations.php.
Constructor & Destructor Documentation
Constructor.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 56 of file custom_validations.php.
{
try
{
$this->Messages =
get_package(
'page::messages' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
$this->UserAlgorithms =
get_package(
'user::user_algorithms' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| custom_validation |
( |
|
$ValidationScript, |
|
|
|
$Options |
|
) |
| |
Custom validations.
- Parameters
-
| $ValidationScript | - Validation script. |
| $Options | - Execution options. |
- Returns
- True if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 347 of file custom_validations.php.
{
try
{
$ValidationScript = explode( ";" , $ValidationScript );
foreach( $ValidationScript as $vs )
{
$Pair = explode( ':' , $vs );
if( $this->validations( $Pair ) === false )
{
return( false );
}
}
return( true );
}
catch( Exception $e )
{
}
}
| custom_validation_captcha |
( |
|
$Pair | ) |
|
Custom validation.
- Parameters
-
| $Pair | - Validation script. |
- Returns
- True if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 256 of file custom_validations.php.
{
try
{
$Captcha =
get_package(
'captcha' ,
'last' , __FILE__ );
$Result = $Captcha->validate_captcha(
$Security->get_p(
'captcha' ,
'command' , rand() ) , $Options );
if( $Result === false )
{
$this->Messages->add_error_message( 'captcha_error' );
}
return( $Result );
}
catch( Exception $e )
{
}
}
| custom_validation_login_does_not_exist |
( |
|
$Pair | ) |
|
Custom validation.
- Parameters
-
| $Pair | - Validation script. |
- Returns
- True if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 133 of file custom_validations.php.
{
try
{
$Result = $this->UserAlgorithms->user_exists( $this->Security->get_gp( $Pair[ 1 ] , 'string' ) );
if( $Result !== false )
{
$this->Messages->add_error_message( 'user_already_exists' );
}
return( $Result );
}
catch( Exception $e )
{
}
}
| custom_validation_login_exists |
( |
|
$Pair | ) |
|
Custom validation.
- Parameters
-
| $Pair | - Validation script. |
- Returns
- True if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 92 of file custom_validations.php.
{
try
{
$Result = $this->UserAlgorithms->user_exists( $this->Security->get_gp( $Pair[ 1 ] , 'string' ) );
if( $Result === false )
{
$this->Messages->add_error_message( 'user_does_not_exist' );
}
return( $Result );
}
catch( Exception $e )
{
}
}
| custom_validation_page_does_not_exist |
( |
|
$Pair | ) |
|
Custom validation.
- Parameters
-
| $Pair | - Validation script. |
- Returns
- True if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 215 of file custom_validations.php.
{
try
{
$PageAccess =
get_package(
'page::page_access' ,
'last' , __FILE__ );
if( $PageAccess->get_page_description( $this->Security->get_gp( $Pair[ 1 ] , 'string' ) ) === false )
{
return( false );
}
return( true );
}
catch( Exception $e )
{
}
}
| custom_validation_page_exists |
( |
|
$Pair | ) |
|
Custom validation.
- Parameters
-
| $Pair | - Validation script. |
- Returns
- True if the validation was passed, false otherwise.
- Exceptions
-
| Exception | An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 174 of file custom_validations.php.
{
try
{
$PageAccess =
get_package(
'page::page_access' ,
'last' , __FILE__ );
if( $PageAccess->get_page_description( $this->Security->get_gp( $Pair[ 1 ] , 'string' ) ) !== false )
{
return( true );
}
return( false );
}
catch( Exception $e )
{
}
}
Field Documentation
The documentation for this class was generated from the following file: