ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
user_controller_utilities_1_0_0 Class Reference

## Public Member Functions
| __construct ()
| handle_login_errors ($UserExists, $UserActive, $AuthValid)
| handle_register_errors ()
| send_email ($SystemEmail, $EmailSender, $Message, $Subject, $Email=false)
| add_default_permits ($id)
| get_configs ()

## Data Fields
| $Messages = false
| $Security = false
| $UserAccess = false
| $UserAlgorithms = false

## Detailed Description

Working with user's accounts.

Author
  Dodonov A.A.

Definition at line 26 of file user_controller_utilities.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

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 )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Member Function Documentation

add_default_permits | ( |  | $id | ) |

Function adds default permits.

Parameters

  $id | - User id.

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 )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

get_configs | ( |  | ) |

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 )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $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 )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $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 )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $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 = get_package( 'mail' , 'last' , __FILE__ );
$Mail->send_email(
$SystemEmail , $Email , $Subject , $Message , $EmailSender
);
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$Messages = false

Cached packages.

Author
  Dodonov A.A.

Definition at line 38 of file user_controller_utilities.php.

$Security = false

Definition at line 39 of file user_controller_utilities.php.

$UserAccess = false

Definition at line 40 of file user_controller_utilities.php.

$UserAlgorithms = false

Definition at line 41 of file user_controller_utilities.php.

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

- packages/user/packages/user_controller/packages/user_controller_utilities/user_controller_utilities.php