ultimix
user_permit_manager_1_0_0 Class Reference

Public Member Functions

 __construct ()
 change_permits_controller ($Options)
 change_groups_controller ($Options)
 change_permits_view ($Options)
 change_groups_view ($Options)
 controller ($Options)
 view ($Options)

Data Fields

 $CachedMultyFS = false
 $GroupAccess = false
 $Link = false
 $PermitAccess = false
 $PermitAlgorithms = false
 $Security = false
 $UserAccess = false
 $UserAlgorithms = false

Detailed Description

This class controls component.

Author
Додонов А.А.

Definition at line 26 of file user_permit_manager.php.

Constructor & Destructor Documentation

__construct ( )

Constructor.

Author
Dodonov A.A.

Definition at line 57 of file user_permit_manager.php.

{
try
{
$this->CachedMultyFS = get_package( 'cached_multy_fs' , 'last' , __FILE__ );
$this->GroupAccess = get_package( 'permit::group_access' , 'last' , __FILE__ );
$this->Link = get_package( 'link' , 'last' , __FILE__ );
$this->PermitAccess = get_package( 'permit::permit_access' , 'last' , __FILE__ );
$this->PermitAlgorithms = get_package( 'permit::permit_algorithms' , '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

change_groups_controller (   $Options)

Function controls component.

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

Definition at line 140 of file user_permit_manager.php.

{
try
{
$UserId = $this->Security->get_p( 'record_id' , 'integer' );
$Groups = $this->Security->get_p( 'groups' , 'command' , array() );
$HasGroups = $this->GroupAccess->get_groups_for_object( $UserId , 'user' );
foreach( $HasGroups as $g )
{
if( in_array( $g , $Groups ) === false )
{
$g = $this->GroupAccess->get_group_by_name( $g );
$this->Link->delete_link( $UserId , $g->id , 'user' , 'group' );
}
}
foreach( $Groups as $p )
{
$this->GroupAccess->add_group_for_object( $p , $UserId , 'user' );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
change_groups_view (   $Options)

Function draws component.

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

Definition at line 221 of file user_permit_manager.php.

{
try
{
$User = $this->UserAlgorithms->get_by_id(
$this->Security->get_p( 'user_permit_record_id' , 'integer' )
);
$this->Output = $this->CachedMultyFS->get_template( __FILE__ , 'groups_view.tpl' );
$this->Output = str_replace( '{path}' , dirname( __FILE__ ) , $this->Output );
$this->Output = str_replace( '{login}' , $User->login , $this->Output );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
change_permits_controller (   $Options)

Function controls component.

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

Definition at line 94 of file user_permit_manager.php.

{
try
{
$UserId = $this->Security->get_p( 'record_id' , 'integer' );
$Permits = $this->Security->get_p( 'permits' , 'command' , array() );
$HasPermits = $this->PermitAlgorithms->get_permits_for_object( $UserId , 'user' , false );
foreach( $HasPermits as $p )
{
if( in_array( $p , $Permits ) === false )
{
$p = $this->PermitAccess->get_permit_by_name( $p );
$this->Link->delete_link( $UserId , $p->id , 'user' , 'permit' );
}
}
foreach( $Permits as $p )
{
$this->PermitAccess->add_permit_for_object( $p , $UserId , 'user' );
}
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
change_permits_view (   $Options)

Function draws component.

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

Definition at line 186 of file user_permit_manager.php.

{
try
{
$User = $this->UserAlgorithms->get_by_id(
$this->Security->get_p( 'user_permit_record_id' , 'integer' )
);
$this->Output = $this->CachedMultyFS->get_template( __FILE__ , 'permits_view.tpl' );
$this->Output = str_replace( '{path}' , dirname( __FILE__ ) , $this->Output );
$this->Output = str_replace( '{login}' , $User->login , $this->Output );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
controller (   $Options)

Function draws component.

Parameters
$Options- Settings.
Returns
HTML code of the компонента.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 260 of file user_permit_manager.php.

{
try
{
$ContextSet = get_package_object( 'gui::context_set' , 'last' , __FILE__ );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_change_permits_controller' );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_change_groups_controller' );
$ContextSet->execute( $Options , $this , __FILE__ );
}
catch( Exception $e )
{
$a = func_get_args();_throw_exception_object( __METHOD__ , $a , $e );
}
}
view (   $Options)

Function draws component.

Parameters
$Options- Settings.
Returns
HTML code of the компонента.
Exceptions
Exception- An exception of this type is thrown.
Author
Dodonov A.A.

Definition at line 298 of file user_permit_manager.php.

{
try
{
$ContextSet = get_package_object( 'gui::context_set' , 'last' , __FILE__ );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_change_permits_view' );
$ContextSet->add_context( dirname( __FILE__ ).'/conf/cfcx_change_groups_view' );
$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 objects.

Author
Dodonov A.A.

Definition at line 38 of file user_permit_manager.php.

$GroupAccess = false

Definition at line 39 of file user_permit_manager.php.

$Link = false

Definition at line 40 of file user_permit_manager.php.

$PermitAccess = false

Definition at line 41 of file user_permit_manager.php.

$PermitAlgorithms = false

Definition at line 42 of file user_permit_manager.php.

$Security = false

Definition at line 43 of file user_permit_manager.php.

$UserAccess = false

Definition at line 44 of file user_permit_manager.php.

$UserAlgorithms = false

Definition at line 45 of file user_permit_manager.php.


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