ultimix

- Main Page
- Data Structures
- Files
- Examples

- Data Structures
- Data Structure Index
- Data Fields

Public Member Functions | Data Fields
user_view_1_0_0 Class Reference

## Public Member Functions
| load_settings ()
| __construct ()
| pre_generation (&$Options)
| login_form (&$Options)
| show_registration_form (&$Options)
| short_profile (&$Options)
| full_profile (&$Options)
| update_user_form (&$Options)
| selec_users_for_list_view ($Start=false, $Limit=false, $Field=false, $Order=false, $Condition= '1=1')
| view (&$Options)

## Data Fields
| $CachedMultyFS = false
| $ContextSet = false
| $Security = false
| $String = false
| $UserAccess = false
| $UserAlgorithms = false
| $Output = false
| $EnableRegistration = 1
| $RegistrationConfirm = 1
| $EmailAsLogin = 0

## Detailed Description

Working with user's accounts.

Author
  Dodonov A.A.

Definition at line 26 of file user_view.php.

## Constructor & Destructor Documentation

__construct | ( |  | ) |

Constructor.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 137 of file user_view.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->Security = get_package( 'security' , 'last' , __FILE__ );
$this->String = get_package( 'string' , 'last' , __FILE__ );
$this->UserAccess = get_package( 'user::user_access' , 'last' , __FILE__ );
$this->UserAlgorithms = get_package( 'user::user_algorithms' , 'last' , __FILE__ );
$this->load_settings();
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Member Function Documentation

full_profile | ( | & | $Options | ) |

Method draws component.

Parameters

  $Options | - Settings.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 395 of file user_view.php.

{
try
{
if( $this->Security->get_gp( 'login' , 'set' ) )
{
$UserLogin = $this->Security->get_gp( 'login' , 'string' );
$User = $this->UserAccess->get_user( $UserLogin );
}
else
{
$UserId = $this->Security->get_gp( 'user_id' , 'integer' , 0 );
if( $UserId == 0 )
{
$UserId = $this->UserAlgorithms->get_id();
}
$User = $this->UserAlgorithms->get_by_id( $UserId );
}
$this->Output = $this->CachedMultyFS->get_template( __FILE__ , 'full_profile.tpl' );
$this->Output = $this->String->print_record( $this->Output , $User );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

load_settings | ( |  | ) |

Function loads settings.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 107 of file user_view.php.

{
try
{
$Settings = get_package_object( 'settings::settings' , 'last' , __FILE__ );
$Settings->load_package_settings( 'user::user_controller' , 'last' , 'cf_user' );
$this->EnableRegistration = intval( $Settings->get_setting( 'enable_registration' , 1 ) );
$this->RegistrationConfirm = intval( $Settings->get_setting( 'registration_confirm' , 1 ) );
$this->EmailAsLogin = intval( $Settings->get_setting( 'email_as_login' , 0 ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

login_form | ( | & | $Options | ) |

Method draws login form.

Parameters

  $Options | - Settings.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 210 of file user_view.php.

{
try
{
$this->Output = $this->CachedMultyFS->get_template(
__FILE__ , $this->EmailAsLogin ? 'email_as_login_form.tpl' : 'login_form.tpl'
);
if( $this->EnableRegistration === 1 )
{
$Code = '&nbsp;{href:page=registration.html;text=registration}';
$this->Output = str_replace( '{registration_link}' , $Code , $this->Output );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

pre_generation | ( | & | $Options | ) |

Method executes before any page generating actions took place.

Parameters

  $Options | - Settings.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 173 of file user_view.php.

{
try
{
$PageJS = get_package( 'page::page_js' , 'last' , __FILE__ );
$PackagePath = _get_package_relative_path_ex( 'user::user_view' , '1.0.0::1.0.0' );
$PageJS->add_javascript( "{http_host}/$PackagePath/include/js/user_view.js" );
$Lang = get_package( 'lang' , 'last' , __FILE__ );
$Lang->include_strings_js( 'user::user_view' );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

selec_users_for_list_view | ( |  | $Start = `false`,
|  |  | $Limit = `false`,
|  |  | $Field = `false`,
|  |  | $Order = `false`,
|  |  | $Condition = `'1 = 1'`
| ) |  |

Function returns list of records.

Parameters

  $Start | - Number of the first record.
  $Limit | - Count of records limitation.
  $Field | - Field to sort by.
  $Order | - Sorting order.
  $Condition | - Additional conditions.

Returns
  List of records.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 532 of file user_view.php.

{
try
{
$Condition = '( NOT ( '.$this->UserAccess->NativeTable.".id IN ( 1 , 2 , 3 ) ) ) AND $Condition";
return( $this->UserAccess->select( $Start , $Limit , $Field , $Order , $Condition ) );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

short_profile | ( | & | $Options | ) |

Method draws component.

Parameters

  $Options | - Settings.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 359 of file user_view.php.

{
try
{
$UserId = $Options->get_setting( 'user_id' , false );
$User = $this->UserAlgorithms->get_by_id( $UserId );
$this->Output = $this->CachedMultyFS->get_template( __FILE__ , 'short_profile.tpl' );
$this->Output = $this->String->print_record( $this->Output , $User );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

show_registration_form | ( | & | $Options | ) |

Method draws component.

Parameters

  $Options | - Settings.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 313 of file user_view.php.

{
try
{
$PermitAlgorithms = get_package( 'permit::permit_algorithms' , 'last' , __FILE__ );
$HasUserManagerPermit = $PermitAlgorithms->object_has_permit( false , 'user' , 'user_manager' );
if( $this->EnableRegistration != 1 && $HasUserManagerPermit == false )
{
$this->Output = '{lang:registration_is_disabled}';
return;
}
$UserController = get_package( 'user::user_controller' , 'last' , __FILE__ );
if( $this->Security->get_gp( 'user_action' ) && $UserController->RegistrationWasPassed )
{
$this->show_registration_confirm_form();
}
else
{
$this->compile_registration_form();
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

update_user_form | ( | & | $Options | ) |

Method draws component.

Parameters

  $Options | - Settings.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 475 of file user_view.php.

{
try
{
$Path = _get_package_relative_path_ex( 'user::user_manager' , 'last' );
$Template = $this->CachedMultyFS->get_template( "$Path/unexisting.php" , 'update_user_form.tpl' );
$User = $this->UserAlgorithms->get_user();
$this->Output = $this->String->print_record( $Template , $User );
$this->Output = str_replace( '{prefix}' , 'user' , $this->Output );
$this->compile_update_user_form();
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

view | ( | & | $Options | ) |

Method draws component.

Parameters

  $Options | - Settings.

Returns
  HTML code of the component.

Exceptions

  Exception | An exception of this type is thrown.

Author
  Dodonov A.A.

Definition at line 606 of file user_view.php.

{
try
{
if( $this->ContextSet === false )
{
$this->ContextSet = get_package( 'gui::context_set' , 'last' , __FILE__ );
}
$this->ContextSet->add_contexts( $Options , dirname( __FILE__ ) , $this->get_contexts() );
$this->ContextSet->execute( $Options , $this , __FILE__ );
return( $this->Output );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}

## Field Documentation

$CachedMultyFS = false

Cached packages.

Author
  Dodonov A.A.

Definition at line 38 of file user_view.php.

$ContextSet = false

Definition at line 39 of file user_view.php.

$EmailAsLogin = 0

Use email as login.

Author
  Dodonov A.A.

Definition at line 91 of file user_view.php.

$EnableRegistration = 1

If the registration exists.

Author
  Dodonov A.A.

Definition at line 67 of file user_view.php.

$Output = false

Display method's result.

Author
  Dodonov A.A.

Definition at line 55 of file user_view.php.

$RegistrationConfirm = 1

Registration confirm.

Author
  Dodonov A.A.

Definition at line 79 of file user_view.php.

$Security = false

Definition at line 40 of file user_view.php.

$String = false

Definition at line 41 of file user_view.php.

$UserAccess = false

Definition at line 42 of file user_view.php.

$UserAlgorithms = false

Definition at line 43 of file user_view.php.

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

- packages/user/packages/user_view/user_view.php