FOSSology  3.2.0rc1
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

 UpdateUser ($UserRec, $SessionIsAdmin)
 Validate and update the user data. More...
 
 GetUserRec ($user_pk)
 Get a user record. More...
 
 CreateUserRec (Request $request, $user_pk="")
 Create a user record. More...
 
- 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"
 

Protected Member Functions

 handle (Request $request)
 Allow user to change their account settings (users db table). More...
 
- Protected Member Functions inherited from Fossology\Lib\Plugin\DefaultPlugin
 RegisterMenus ()
 Customize submenus.
 
 handle (Request $request)
 
 render ($templateName, $vars=null, $headers=null)
 
 getDefaultHeaders ()
 
 getDefaultVars ()
 
 mergeWithDefault ($vars)
 
 flushContent ($content)
 

Private Member Functions

 DisplayForm ($UserRec, $SessionIsAdmin)
 Display the user record edit form. More...
 
 IsSessionAdmin ($UserRec)
 Determine if the session user is an admin. More...
 
 generateNewToken (Request $request)
 
 getListOfActiveTokens ()
 Get a list of active tokens for current user. More...
 
 getListOfExpiredTokens ()
 
 getUserGroupSelect ($userRec)
 

Private Attributes

 $dbManager
 
 $authHelper
 
 $userDao
 

Additional Inherited Members

- Protected Attributes inherited from Fossology\Lib\Plugin\DefaultPlugin
 $container
 
 $renderer
 
 $microMenu
 

Detailed Description

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

Member Function Documentation

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.

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

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 139 of file user-edit.php.

UserEditPage::generateNewToken ( Request  $request)
private

Generate new token based on the request sent by user.

Parameters
Request$request
Exceptions

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

UserEditPage::getListOfActiveTokens ( )
private

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 428 of file user-edit.php.

UserEditPage::getListOfExpiredTokens ( )
private

Get a list of expired tokens for current user.

Returns
array

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

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 489 of file user-edit.php.

UserEditPage::GetUserRec (   $user_pk)

Get a user record.

Parameters
$user_pkfetch this users db record
Returns
users db record

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

UserEditPage::handle ( Request  $request)
protected

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

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

UserEditPage::IsSessionAdmin (   $UserRec)
private

Determine if the session user is an admin.

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

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

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 194 of file user-edit.php.


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