FOSSology  4.4.0
Open Source License Compliance by Open Source Software
UserEditPage Class Reference
Inheritance diagram for UserEditPage:
Inheritance graph
Collaboration diagram for UserEditPage:
Collaboration graph

Public Member Functions

 handle (Request $request)
 Allow user to change their account settings (users db table). More...
 
 UpdateUser ($UserRec, $SessionIsAdmin)
 Validate and update the user data. More...
 
 GetUserRec ($user_pk)
 Get a user record. More...
 
 IsSessionAdmin ($UserRec)
 Determine if the session user is an admin. More...
 
 CreateUserRec (Request $request, $user_pk="")
 Create a user record. More...
 
 getListOfActiveTokens ()
 Get a list of active tokens for current user. More...
 
 getListOfExpiredTokens ()
 
 getMaxExpiredTokenRetentionPeriod ()
 getMaxExpiredTokenRetentionPeriod() get the refresh time from DB. @Returns number of days to retain expired token.
 
- Public Member Functions inherited from Fossology\Lib\Plugin\DefaultPlugin
 __construct ($name, $parameters=array())
 
 getName ()
 
 getVersion ()
 
 getTitle ()
 
 isRequiresLogin ()
 
 getDependency ()
 
 getPluginLevel ()
 
 getDBaccess ()
 
 getState ()
 
 getInitOrder ()
 
 getNoMenu ()
 
 getResponse ()
 
 getObject ($name)
 
 preInstall ()
 
 postInstall ()
 
 unInstall ()
 
 execute ()
 
 isLoggedIn ()
 
 __get ($name)
 
 __toString ()
 

Public Attributes

const NAME = "user_edit"
 
- Public Attributes inherited from Fossology\Lib\Plugin\DefaultPlugin
const PERMISSION = "permission"
 
const REQUIRES_LOGIN = "requiresLogin"
 
const ENABLE_MENU = "ENABLE_MENU"
 
const LEVEL = "level"
 
const DEPENDENCIES = "dependencies"
 
const INIT_ORDER = "initOrder"
 
const MENU_LIST = "menuList"
 
const MENU_ORDER = "menuOrder"
 
const MENU_TARGET = "menuTarget"
 
const TITLE = "title"
 

Private Member Functions

 DisplayForm ($UserRec, $SessionIsAdmin)
 Display the user record edit form. More...
 
 getUserGroupSelect ($userRec)
 
 getListOfActiveClients ()
 Get a list of active clients for current user. More...
 
 getListOfExpiredClients ()
 

Private Attributes

 $dbManager
 
 $authHelper
 
 $userDao
 

Additional Inherited Members

- Protected Member Functions inherited from Fossology\Lib\Plugin\DefaultPlugin
 RegisterMenus ()
 Customize submenus.
 
 render ($templateName, $vars=null, $headers=null)
 
 getDefaultHeaders ()
 
 getDefaultVars ()
 
 mergeWithDefault ($vars)
 
 flushContent ($content)
 
- Protected Attributes inherited from Fossology\Lib\Plugin\DefaultPlugin
 $container
 
 $renderer
 
 $microMenu
 

Detailed Description

Definition at line 23 of file user-edit.php.

Member Function Documentation

◆ CreateUserRec()

UserEditPage::CreateUserRec ( Request  $request,
  $user_pk = "" 
)

Create a user record.

Parameters
integer$user_pk,If empty, use form data
Returns
A user record in the same associated array format that you get from a pg_fetch_assoc(). However, there may be additional fields from the data input form that are not in the users table. These additional fields start with an underscore (_pass1, _pass2, _blank_pass) that come from the edit form.
Exceptions
Exception

Definition at line 399 of file user-edit.php.

◆ DisplayForm()

UserEditPage::DisplayForm (   $UserRec,
  $SessionIsAdmin 
)
private

Display the user record edit form.

Parameters
$UserRec- Database users record for the user to be edited.
$SessionIsAdmin- Boolean: This session is by an admin
Returns
the text of the display form on success, or error on failure.

Definition at line 165 of file user-edit.php.

◆ getListOfActiveClients()

UserEditPage::getListOfActiveClients ( )
private

Get a list of active clients for current user.

Fetches the clients for current user from DB and format it for twig template.

Returns
array

Definition at line 644 of file user-edit.php.

◆ getListOfActiveTokens()

UserEditPage::getListOfActiveTokens ( )

Get a list of active tokens for current user.

Fetches the tokens for current user from DB and format it for twig template. Also check if the token is expired.

Returns
array

Definition at line 523 of file user-edit.php.

◆ getListOfExpiredClients()

UserEditPage::getListOfExpiredClients ( )
private

Get a list of revoked clients for current user.

Returns
array

Definition at line 672 of file user-edit.php.

◆ getListOfExpiredTokens()

UserEditPage::getListOfExpiredTokens ( )

Get a list of expired tokens for current user.

Returns
array

Definition at line 555 of file user-edit.php.

◆ getUserGroupSelect()

UserEditPage::getUserGroupSelect (   $userRec)
private

Generate the HTML option list of groups for the user

Parameters
array$userRecUser record being updated
Returns
string HTML option list

Definition at line 586 of file user-edit.php.

◆ GetUserRec()

UserEditPage::GetUserRec (   $user_pk)

Get a user record.

Parameters
$user_pkfetch this users db record
Returns
users db record
Exceptions
Exception

Definition at line 366 of file user-edit.php.

◆ handle()

UserEditPage::handle ( Request  $request)

Allow user to change their account settings (users db table).

If the user is an Admin, they can change settings for any user.
This is called in the following circumstances:
1) User clicks on Admin > Edit User Account
2) User has chosen a user to edit from the 'userid' select list
3) User hit submit to update user data

Reimplemented from Fossology\Lib\Plugin\DefaultPlugin.

Definition at line 63 of file user-edit.php.

◆ IsSessionAdmin()

UserEditPage::IsSessionAdmin (   $UserRec)

Determine if the session user is an admin.

Returns
TRUE if the session user is an admin. Otherwise, return FALSE

Definition at line 384 of file user-edit.php.

◆ UpdateUser()

UserEditPage::UpdateUser (   $UserRec,
  $SessionIsAdmin 
)

Validate and update the user data.

Parameters
$UserRec- Database record for the user to be edited.
Returns
NULL on success, string (error text) on failure.

Definition at line 234 of file user-edit.php.


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