ultimix
user_manager_controller_1_0_0 Class Reference

Public Member Functions

 __construct ()
 validate_account_password ($User)
 validate_account_fields ($Options)
 vaidate_non_system ($Options)
 controller ($Options)

Data Fields

 $Database = false
 $PageComposer = false
 $PermitAlgorithms = false
 $Security = false
 $SecurityUtilities = false
 $UserAccess = false
 $UserAlgorithms = false

Detailed Description

Working with user's accounts.

Author
Dodonov A.A.

Definition at line 26 of file user_manager_controller.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 56 of file user_manager_controller.php.

{
try
{
$this->Database = get_package( 'database' , 'last' , __FILE__ );
$this->PageComposer = get_package( 'page::page_composer' , 'last' , __FILE__ );
$this->PermitAlgorithms = get_package( 'permit::permit_algorithms' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->SecurityUtilities = get_package( 'security::security_utilities' , '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

controller (   $Options)

Controller of the component.

Parameters
$Options- Settings.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 239 of file user_manager_controller.php.

{
try
{
$ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
$ContextSet->execute( $Options , $this , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
vaidate_non_system (   $Options)

Function validates deleting accounts.

Parameters
$Options- Settings.
Returns
true if the validation was passed.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 189 of file user_manager_controller.php.

{
try
{
$ids = $this->SecurityUtilities->get_global( '_id_' , 'integer' , CHECKBOX_IDS );
if( isset( $ids[ 0 ] ) )
{
$ids = implode( ',' , $ids );
$Users = $this->UserAccess->unsafe_select( $this->UserAccess->NativeTable.
".id IN( $ids ) AND `system` = 1" );
if( isset( $Users[ 0 ] ) )
{
$PageComposer = get_package( 'page::page_composer' , 'last' , __FILE__ );
$PageComposer->add_error_message( 'cant_delete_system_users' );
return( false );
}
return( true );
}
return( false );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
validate_account_fields (   $Options)

Function validates account's fields.

Parameters
$Options- Settings.
Returns
true if the validation was passed.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 140 of file user_manager_controller.php.

{
try
{
$User = $this->UserAccess->select_list( $this->Security->get_p( 'user_record_id' , 'integer_list' ) );
$User = $User[ 0 ];
$Email = $this->Security->get_p( 'email' , 'email' );
if( $User->email != $Email && $this->UserAlgorithms->email_exists( $Email ) )
{
$this->PageComposer->add_error_message( 'email_exists' );
return( false );
}
if( $this->validate_account_password( $User ) === false )
{
return( false );
}
return( true );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
validate_account_password (   $User)

Function validates account's fields.

Parameters
$User- User.
Returns
true if the validation was passed, otherwise false.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 96 of file user_manager_controller.php.

{
try
{
if( $this->PermitAlgorithms->object_has_permit( false , 'user' , 'user_manager' ) === false )
{
$Password = $this->Security->get_p( 'current_password' , 'string' );
if( $this->UserAlgorithms->validate_auth( $User->login , $Password ) === false )
{
$this->PageComposer->add_error_message( 'illegal_current_password' );
return( false );
}
}
return( true );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

Field Documentation

$Database = false

Cached objects.

Author
Dodonov A.A.

Definition at line 38 of file user_manager_controller.php.

$PageComposer = false

Definition at line 39 of file user_manager_controller.php.

$PermitAlgorithms = false

Definition at line 40 of file user_manager_controller.php.

$Security = false

Definition at line 41 of file user_manager_controller.php.

$SecurityUtilities = false

Definition at line 42 of file user_manager_controller.php.

$UserAccess = false

Definition at line 43 of file user_manager_controller.php.

$UserAlgorithms = false

Definition at line 44 of file user_manager_controller.php.


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