FOSSology  4.4.0
Open Source License Compliance by Open Source Software
Fossology\Lib\Dao\UserDao Class Reference
Collaboration diagram for Fossology\Lib\Dao\UserDao:
Collaboration graph

Public Member Functions

 __construct (DbManager $dbManager, Logger $logger)
 
 getUserChoices ($groupId=null)
 
 getAdminGroupMap ($userId, $userLevel=0)
 get array of groups that this user has admin access to More...
 
 getUserGroupMap ($userId)
 get array of groups that this user has admin access to More...
 
 getDeletableAdminGroupMap ($userId, $userLevel=0)
 get array of groups that this user has admin access to More...
 
 deleteGroup ($groupId)
 Delete a group (for constraint, see http://www.fossology.org/projects/fossology/wiki/GroupsPerms ) More...
 
 updateUserTable ()
 
 getUserByName ($userName)
 
 getUserByPk ($userPk)
 
 getGroupIdByName ($groupName)
 
 setDefaultGroupMembership ($userId, $groupId)
 
 getUserAndDefaultGroupByUserName (&$userName, $oauth=false)
 
 isUserActive ($userName)
 
 isUserIdActive ($userId)
 
 updateUserLastConnection ($userId)
 
 isAdvisorOrAdmin ($userId, $groupId)
 
 addGroup ($groupName)
 
 addGroupMembership ($groupId, $userId, $groupPerm=1)
 
 getUserName ($userId)
 
 getGroupNameById ($groupId)
 
 getUserEmail ($userId)
 
 getAllUsers ()
 

Public Attributes

const USER = 0
 
const ADMIN = 1
 
const ADVISOR = 2
 
const USER_ACTIVE_STATUS = 'active'
 
const SUPER_USER = 'fossy'
 

Private Member Functions

 getUserByPermission ($permission)
 
 fixDefaultGroup ($userId, $groupName)
 

Private Attributes

 $dbManager
 
 $logger
 
 $session
 

Detailed Description

Definition at line 18 of file UserDao.php.

Member Function Documentation

◆ addGroup()

Fossology\Lib\Dao\UserDao::addGroup (   $groupName)
Parameters
string$groupNameraw group name as entered by the user
Returns
int $groupId
Exceptions

Definition at line 370 of file UserDao.php.

◆ deleteGroup()

Fossology\Lib\Dao\UserDao::deleteGroup (   $groupId)

Delete a group (for constraint, see http://www.fossology.org/projects/fossology/wiki/GroupsPerms )

Parameters
$groupId
Exceptions

Definition at line 140 of file UserDao.php.

◆ fixDefaultGroup()

Fossology\Lib\Dao\UserDao::fixDefaultGroup (   $userId,
  $groupName 
)
private
Parameters
int$userId
string$groupName
Returns
array with keys 'group_fk', 'group_name'

Definition at line 340 of file UserDao.php.

◆ getAdminGroupMap()

Fossology\Lib\Dao\UserDao::getAdminGroupMap (   $userId,
  $userLevel = 0 
)

get array of groups that this user has admin access to

Parameters
int$userId
Returns
array in the format {group_pk=>group_name, group_pk=>group_name, ...}

Definition at line 70 of file UserDao.php.

◆ getAllUsers()

Fossology\Lib\Dao\UserDao::getAllUsers ( )

Get all users from users table

Returns
array

Definition at line 442 of file UserDao.php.

◆ getDeletableAdminGroupMap()

Fossology\Lib\Dao\UserDao::getDeletableAdminGroupMap (   $userId,
  $userLevel = 0 
)

get array of groups that this user has admin access to

Parameters
int$userId
Returns
array in the format {group_pk=>group_name, group_pk=>group_name, ...}

Definition at line 111 of file UserDao.php.

◆ getGroupIdByName()

Fossology\Lib\Dao\UserDao::getGroupIdByName (   $groupName)
Parameters
$groupName
Returns
array

Definition at line 251 of file UserDao.php.

◆ getGroupNameById()

Fossology\Lib\Dao\UserDao::getGroupNameById (   $groupId)
Parameters
$groupId
Returns
array

Definition at line 416 of file UserDao.php.

◆ getUserByName()

Fossology\Lib\Dao\UserDao::getUserByName (   $userName)
Parameters
$userName
Returns
array

Definition at line 233 of file UserDao.php.

◆ getUserByPermission()

Fossology\Lib\Dao\UserDao::getUserByPermission (   $permission)
private
Parameters
$permission
Returns
array

Definition at line 261 of file UserDao.php.

◆ getUserByPk()

Fossology\Lib\Dao\UserDao::getUserByPk (   $userPk)
Parameters
$userPk
Returns
array

Definition at line 242 of file UserDao.php.

◆ getUserChoices()

Fossology\Lib\Dao\UserDao::getUserChoices (   $groupId = null)
Returns
array

Definition at line 47 of file UserDao.php.

◆ getUserEmail()

Fossology\Lib\Dao\UserDao::getUserEmail (   $userId)
Parameters
int$userId
Returns
string

Definition at line 429 of file UserDao.php.

◆ getUserGroupMap()

Fossology\Lib\Dao\UserDao::getUserGroupMap (   $userId)

get array of groups that this user has admin access to

Parameters
int$userId
Returns
array in the format {group_pk=>group_name, group_pk=>group_name, ...}

Definition at line 93 of file UserDao.php.

◆ getUserName()

Fossology\Lib\Dao\UserDao::getUserName (   $userId)
Parameters
int$userId
Returns
string

Definition at line 403 of file UserDao.php.

◆ isUserActive()

Fossology\Lib\Dao\UserDao::isUserActive (   $userName)
Parameters
string$userName
Returns
boolean true if user status=active

Definition at line 308 of file UserDao.php.

◆ isUserIdActive()

Fossology\Lib\Dao\UserDao::isUserIdActive (   $userId)
Parameters
int$userId
Returns
boolean true if user status=active

Definition at line 319 of file UserDao.php.

◆ setDefaultGroupMembership()

Fossology\Lib\Dao\UserDao::setDefaultGroupMembership (   $userId,
  $groupId 
)
Parameters
int$userId
int$groupId

Definition at line 270 of file UserDao.php.

◆ updateUserLastConnection()

Fossology\Lib\Dao\UserDao::updateUserLastConnection (   $userId)
Parameters
int$userId

Definition at line 329 of file UserDao.php.


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