Detailed Description
Working with user's accounts.
- Author
- Dodonov A.A.
Definition at line 26 of file user_controller_utilities.php.
Constructor & Destructor Documentation
Constructor.
- Author
- Dodonov A.A.
Definition at line 53 of file user_controller_utilities.php.
{
try
{
$this->Messages =
get_package(
'page::messages' ,
'last' , __FILE__ );
$this->Security =
get_package(
'security' ,
'last' , __FILE__ );
$this->UserAccess =
get_package(
'user::user_access' ,
'last' , __FILE__ );
$this->UserAlgorithms =
get_package(
'user::user_algorithms' ,
'last' , __FILE__ );
}
catch( Exception $e )
{
}
}
Member Function Documentation
| add_default_permits |
( |
|
$id | ) |
|
Function adds default permits.
- Parameters
-
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 224 of file user_controller_utilities.php.
{
try
{
$id = $this->Security->get( $id , 'integer' );
$PermitAccess =
get_package(
'permit::permit_access' ,
'last' , __FILE__ );
$PermitAccess->add_permit_for_object( 'public' , $id , 'user' );
$PermitAccess->add_permit_for_object( 'registered' , $id , 'user' );
}
catch( Exception $e )
{
}
}
Function returns a list of configs.
- Returns
- List of configs.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 258 of file user_controller_utilities.php.
{
try
{
return(
array(
'cfcx_update_user' , 'cfcx_activate_user' , 'cfcx_admin_activate_user' ,
'cfcx_admin_deactivate_user' , 'cfcx_restore_password' , 'cfcx_registration' ,
'cfcx_user_set_avatar' , 'cfcx_login' , 'cfcx_logout'
)
);
}
catch( Exception $e )
{
}
}
| handle_login_errors |
( |
|
$UserExists, |
|
|
|
$UserActive, |
|
|
|
$AuthValid |
|
) |
| |
Errors processing.
- Parameters
-
| $UserExists | - Does user exist. |
| $UserActive | - Is user active. |
| $AuthValid | - Correct login/password. |
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 94 of file user_controller_utilities.php.
{
try
{
if( $UserExists == false )
{
$this->Messages->add_error_message( 'user_does_not_exists' );
}
elseif( $UserActive == false )
{
$this->Messages->add_error_message( 'registration_was_not_confirmed' );
}
elseif( $AuthValid == false )
{
$this->Messages->add_error_message( 'authentification_error' );
}
}
catch( Exception $e )
{
}
}
| handle_register_errors |
( |
| ) |
|
Function process registration erroros.
- Returns
- true/false.
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 135 of file user_controller_utilities.php.
{
try
{
if( $this->UserAlgorithms->user_exists( $this->Security->get_gp( 'login' , 'string' ) ) )
{
$this->Messages->add_error_message( 'user_already_exists' );
return( true );
}
if( $this->UserAlgorithms->email_exists( $this->Security->get_gp( 'email' , 'string' ) ) )
{
$this->Messages->add_error_message( 'email_already_exists' );
return( true );
}
return( false );
}
catch( Exception $e )
{
}
}
| send_email |
( |
|
$SystemEmail, |
|
|
|
$EmailSender, |
|
|
|
$Message, |
|
|
|
$Subject, |
|
|
|
$Email = false |
|
) |
| |
Function sends email.
- Parameters
-
| $SystemEmail | - System email. |
| $EmailSender | - System sender. |
| $Message | - Message. |
| $Email | - Email. |
- Exceptions
-
| Exception | - An exception of this type is thrown. |
- Author
- Dodonov A.A.
Definition at line 189 of file user_controller_utilities.php.
{
try
{
$Email = $Email === false ? $this->Security->get_gp( 'email' , 'string' ) : $Email;
$Mail->send_email(
$SystemEmail , $Email , $Subject , $Message , $EmailSender
);
}
catch( Exception $e )
{
}
}
Field Documentation
The documentation for this class was generated from the following file: