Menu

## SeedDMS_Core_User
in package

inc.ClassUser.php : 27

Class to represent a user in the document management system

##### Tags

category

  DMS

author

  Markus Westphal, Malcolm Cowe, Uwe Steinmann uwe@steinmann.cx

copyright

  Copyright (C) 2002-2005 Markus Westphal, 2006-2008 Malcolm Cowe, 2010-2024 Uwe Steinmann

version

  Release: @package_version@

### Table of Contents

#### Constants

role_admin = '1'
role_guest = '2'
role_user = '0'

#### Properties

$_comment : string
$_dms : SeedDMS_Core_DMS
$_email : string
$_fullName : string
$_groups : array<string|int, mixed>
$_hasImage : bool
$_homeFolder : SeedDMS_Core_Folder
$_id : int
$_isDisabled : bool
$_isHidden : bool
$_language : string
$_login : string
$_loginFailures : int
$_pwd : string
$_pwdExpiration : string
$_quota : int
$_role : string
$_theme : string

#### Methods

__construct() : mixed
  SeedDMS_Core_User constructor.
__toString() : string
  Cast to string
addLoginFailure() : bool|int
clearLoginFailures() : bool
delMandatoryApprovers() : bool
  Deletes all mandatory approvers
delMandatoryReviewers() : bool
  Deletes all mandatory reviewers
delMandatoryWorkflow() : bool
  Deletes the mandatory workflow
getAllInstances() : array<string|int, SeedDMS_Core_User>|bool
  Return all users
getApprovalStatus() : array<string|int, mixed>|bool
  Get a list of approvals
getComment() : string
  Return comment of user
getDMS() : SeedDMS_Core_DMS
getDocumentContents() : array<string|int, SeedDMS_Core_DocumentContent>|bool
  Returns all document contents of a given user
getDocumentFiles() : array<string|int, SeedDMS_Core_DocumentFile>|bool
  Returns all document files of a given user
getDocumentLinks() : array<string|int, SeedDMS_Core_DocumentLink>|bool
  Returns all document links of a given user
getDocuments() : array<string|int, SeedDMS_Core_Document>|bool
  Returns all documents of a given user
getDocumentsLocked() : bool|array<string|int, SeedDMS_Core_Document>
  Returns all documents locked by a given user
getEmail() : string
  Get email address of user
getFolders() : array<string|int, SeedDMS_Core_Folder>|bool
  Returns all folders of a given user
getFullName() : string
  Return full name of user
getGroups() : array<string|int, SeedDMS_Core_Group>|bool
  Get all groups the user is a member of
getHomeFolder() : null|SeedDMS_Core_Folder
getID() : int
  Return internal id of user
getImage() : string|null|bool
  Get the image from the users profile
getInstance() : SeedDMS_Core_User|bool
  Create an instance of a user object
getKeywordCategories() : array<string|int, SeedDMS_Core_KeywordCategory>|bool
  Return list of personal keyword categories
getLanguage() : string
getLogin() : string
  Return login of user
getMandatoryApprovers() : array<string|int, mixed>
  Get a list of mandatory approvers See {link SeedDMS_Core_User::getMandatoryReviewers}
getMandatoryReviewers() : array<string|int, mixed>
  Get a list of mandatory reviewers A user which isn't trusted completely may have assigned mandatory reviewers (both users and groups).
getMandatoryWorkflow() : SeedDMS_Core_Workflow|bool
  Get the mandatory workflow A user which isn't trusted completely may have assigned mandatory workflow Whenever the user inserts a new document the mandatory workflow is filled in as the workflow.
getMandatoryWorkflows() : array<string|int, SeedDMS_Core_Workflow>|bool
  Get the mandatory workflows A user which isn't trusted completely may have assigned mandatory workflow Whenever the user inserts a new document the mandatory workflow is filled in as the workflow.
getNotifications() : array<string|int, SeedDMS_Core_Notification>|bool
  Get all notifications of user
getPwd() : string
  Get encrypted password of user
getPwdExpiration() : string
getQuota() : int
getReviewStatus() : array<string|int, mixed>|bool
  Get a list of reviews
getRole() : string
getTheme() : string
getUsedDiskSpace() : int
  Calculate the disk space for all documents owned by the user
getWorkflowsInvolved() : array<string|int, mixed>|bool
  Get a list of workflows this user is involved as in individual
getWorkflowStatus() : array<string|int, mixed>|bool
  Get a list of documents with a workflow
hasImage() : bool
  Check if user has an image in its profile
isAdmin() : bool
  Check, if user is an administrator
isDisabled() : bool|int
  Check, if user is disabled
isGuest() : bool
  Check, if user is a guest
isHidden() : bool
  Check, if user is hidden
isMandatoryApproverOf() : array<string|int, SeedDMS_Core_User>|bool
  Get a list of users this user is a mandatory approver of
isMandatoryReviewerOf() : array<string|int, SeedDMS_Core_User>|bool
  Get a list of users this user is a mandatory reviewer of
isMemberOfGroup() : bool
  Checks if user is member of a given group
isType() : mixed
  Check if this object is of type 'user'.
isUser() : bool
  Check, if user is a regular user
joinGroup() : bool
  Make the user a member of a group This function uses {@link SeedDMS_Group::addUser} but checks before if the user is already a member of the group.
leaveGroup() : bool
  Removes the user from a group This function uses {@link SeedDMS_Group::removeUser} but checks before if the user is a member of the group at all.
remove() : bool
  Remove the user and also remove all its keywords, notifications, etc.
removeFromProcesses() : bool
  Remove user from all processes
setAdmin() : bool
  Turn user into a admin
setComment() : bool
  Change comment of user
setDisabled() : bool
  Disable user
setDMS() : mixed
setEmail() : bool
  Change email address of user
setFullName() : bool
  Set full name of user
setGuest() : bool
  Turn user into a guest
setHidden() : bool
  Set user hidden
setHomeFolder() : bool
setImage() : bool
setLanguage() : bool
setLogin() : bool
  Change login of user
setMandatoryApprover() : bool
  Set a mandatory approver This function sets a mandatory approver if it isn't already set.
setMandatoryReviewer() : bool
  Set a mandatory reviewer This function sets a mandatory reviewer if it isn't already set.
setMandatoryWorkflow() : bool
  Set a mandatory workflow This function sets a mandatory workflow if it isn't already set.
setMandatoryWorkflows() : bool
  Set a mandatory workflows This function sets a list of mandatory workflows.
setPwd() : bool
  Set password of user
setPwdExpiration() : bool
setQuota() : bool
setRole() : bool
setTheme() : bool
transferDocumentsFolders() : bool
  Transfer documents and folders to another user
transferEvents() : bool
  Transfer events to another user
__removeFromProcesses() : bool
  Remove user from all processes
__transferDocumentsFolders() : bool
  Transfer documents and folders to another user
__transferEvents() : bool
  Transfer events to another user

### Constants

#### role_admin

inc.ClassUser.php : 157
`public mixed role_admin = '1'`

#### role_guest

inc.ClassUser.php : 158
`public mixed role_guest = '2'`

#### role_user

inc.ClassUser.php : 156
`public mixed role_user = '0'`

### Properties

#### $_comment

inc.ClassUser.php : 90
`protected string $_comment`

comment of user

##### Tags

access

  protected

#### $_dms

inc.ClassUser.php : 140
`protected SeedDMS_Core_DMS $_dms`

reference to the dms instance this user belongs to

##### Tags

access

  protected

#### $_email

inc.ClassUser.php : 68
`protected string $_email`

email address of user

##### Tags

access

  protected

#### $_fullName

inc.ClassUser.php : 61
`protected string $_fullName`

full human readable name of user

##### Tags

access

  protected

#### $_groups

inc.ClassUser.php : 133
`protected array<string|int, mixed> $_groups`

list of groups

##### Tags

access

  protected

#### $_hasImage

inc.ClassUser.php : 154
`protected bool $_hasImage`

##### Tags

access

  protected

#### $_homeFolder

inc.ClassUser.php : 126
`protected SeedDMS_Core_Folder $_homeFolder`

home folder

##### Tags

access

  protected

#### $_id

inc.ClassUser.php : 33
`protected int $_id`

id of user

##### Tags

access

  protected

#### $_isDisabled

inc.ClassUser.php : 112
`protected bool $_isDisabled`

true if user is disabled

##### Tags

access

  protected

#### $_isHidden

inc.ClassUser.php : 105
`protected bool $_isHidden`

true if user shall be hidden

##### Tags

access

  protected

#### $_language

inc.ClassUser.php : 76
`protected string $_language`

prefered language of user possible values are subdirectories within the language directory

##### Tags

access

  protected

#### $_login

inc.ClassUser.php : 40
`protected string $_login`

login name of user

##### Tags

access

  protected

#### $_loginFailures

inc.ClassUser.php : 119
`protected int $_loginFailures`

number of login failures

##### Tags

access

  protected

#### $_pwd

inc.ClassUser.php : 47
`protected string $_pwd`

password of user as saved in database (md5)

##### Tags

access

  protected

#### $_pwdExpiration

inc.ClassUser.php : 54
`protected string $_pwdExpiration`

date when password expires

##### Tags

access

  protected

#### $_quota

inc.ClassUser.php : 147
`protected int $_quota`

##### Tags

access

  protected

#### $_role

inc.ClassUser.php : 98
`protected string $_role`

role of user. Can be one of SeedDMS_Core_User::role_user, SeedDMS_Core_User::role_admin, SeedDMS_Core_User::role_guest

##### Tags

access

  protected

#### $_theme

inc.ClassUser.php : 83
`protected string $_theme`

preselected theme of user

##### Tags

access

  protected

### Methods

#### __construct()

inc.ClassUser.php : 178

SeedDMS_Core_User constructor.

`public __construct( $id, $login, $pwd, $fullName, $email, $language, $theme, $comment, $role[, int $isHidden = 0 ][, int $isDisabled = 0 ][, string $pwdExpiration = '' ][, int $loginFailures = 0 ][, int $quota = 0 ][, null $homeFolder = null ]) : mixed`

##### Parameters

$id :
$login :
$pwd :
$fullName :
$email :
$language :
$theme :
$comment :
$role :
$isHidden : int = 0
$isDisabled : int = 0
$pwdExpiration : string = ''
$loginFailures : int = 0
$quota : int = 0
$homeFolder : null = null

#### __toString()

inc.ClassUser.php : 275

Cast to string

`public __toString() : string`

##### Return values

string

#### addLoginFailure()

inc.ClassUser.php : 638
`public addLoginFailure() : bool|int`

##### Return values

bool|int

#### clearLoginFailures()

inc.ClassUser.php : 652
`public clearLoginFailures() : bool`

##### Return values

bool

#### delMandatoryApprovers()

inc.ClassUser.php : 1986

Deletes all mandatory approvers

`public delMandatoryApprovers() : bool`

##### Return values

bool —

true on success, otherwise false

#### delMandatoryReviewers()

inc.ClassUser.php : 1974

Deletes all mandatory reviewers

`public delMandatoryReviewers() : bool`

##### Return values

bool —

true on success, otherwise false

#### delMandatoryWorkflow()

inc.ClassUser.php : 1999

Deletes the mandatory workflow

`public delMandatoryWorkflow() : bool`

##### Return values

bool —

true on success, otherwise false

#### getAllInstances()

inc.ClassUser.php : 244

Return all users

`public static getAllInstances( $orderby, SeedDMS_Core_DMS $dms) : array<string|int, SeedDMS_Core_User>|bool`

##### Parameters

$orderby :

  can be `fullname`

$dms : SeedDMS_Core_DMS

##### Return values

array<string|int, SeedDMS_Core_User>|bool

#### getApprovalStatus()

inc.ClassUser.php : 1578

Get a list of approvals

`public getApprovalStatus([int $documentID = null ][, int $version = null ]) : array<string|int, mixed>|bool`

This function returns a list of all approvals and their latest log entry seperated by individuals and groups. If the document id is passed, then only this document will be checked for approvals. The same is true for the version of a document which limits the list further. If you do not limit on a version it will retrieve the status for each version, that includes even older versions which has been superseded by a new version.

The result array has two elements:

- indstatus: which contains the approvals by individuals (users)
- grpstatus: which contains the approvals by groups

Each element is itself an array of approvals with the following elements (it is a combination of fields from tblDocumentApprovers and tblDocumentApproveLog):

- approveID: unique id of approval
- documentID: id of document, that needs to be approved
- version: version of document, that needs to be approved
- type: 0 for individual approval, 1 for group approval
- required: id of user who is required to do the approval
- status: 0 not approved, ....
- comment: comment given during approval
- date: date of approval
- userID: id of user who has done the approval

##### Parameters

$documentID : int = null

  optional document id for which to retrieve the approvals

$version : int = null

  optional version of the document

##### Return values

array<string|int, mixed>|bool —

list of all approvals

#### getComment()

inc.ClassUser.php : 490

Return comment of user

`public getComment() : string`

##### Return values

string

#### getDMS()

inc.ClassUser.php : 298
`public getDMS() : SeedDMS_Core_DMS`

##### Return values

SeedDMS_Core_DMS —

$dms

#### getDocumentContents()

inc.ClassUser.php : 1407

Returns all document contents of a given user

`public getDocumentContents() : array<string|int, SeedDMS_Core_DocumentContent>|bool`

##### Return values

array<string|int, SeedDMS_Core_DocumentContent>|bool —

list of document contents

#### getDocumentFiles()

inc.ClassUser.php : 1382

Returns all document files of a given user

`public getDocumentFiles() : array<string|int, SeedDMS_Core_DocumentFile>|bool`

##### Return values

array<string|int, SeedDMS_Core_DocumentFile>|bool —

list of document files

#### getDocumentLinks()

inc.ClassUser.php : 1356

Returns all document links of a given user

`public getDocumentLinks() : array<string|int, SeedDMS_Core_DocumentLink>|bool`

##### Return values

array<string|int, SeedDMS_Core_DocumentLink>|bool —

list of document links

#### getDocuments()

inc.ClassUser.php : 1301

Returns all documents of a given user

`public getDocuments() : array<string|int, SeedDMS_Core_Document>|bool`

##### Return values

array<string|int, SeedDMS_Core_Document>|bool —

list of documents

#### getDocumentsLocked()

inc.ClassUser.php : 1329

Returns all documents locked by a given user

`public getDocumentsLocked() : bool|array<string|int, SeedDMS_Core_Document>`

##### Return values

bool|array<string|int, SeedDMS_Core_Document> —

list of documents

#### getEmail()

inc.ClassUser.php : 423

Get email address of user

`public getEmail() : string`

##### Return values

string

#### getFolders()

inc.ClassUser.php : 1431

Returns all folders of a given user

`public getFolders() : array<string|int, SeedDMS_Core_Folder>|bool`

##### Return values

array<string|int, SeedDMS_Core_Folder>|bool —

list of folders

#### getFullName()

inc.ClassUser.php : 343

Return full name of user

`public getFullName() : string`

##### Return values

string

#### getGroups()

inc.ClassUser.php : 1197

Get all groups the user is a member of

`public getGroups() : array<string|int, SeedDMS_Core_Group>|bool`

##### Return values

array<string|int, SeedDMS_Core_Group>|bool —

list of groups

#### getHomeFolder()

inc.ClassUser.php : 711
`public getHomeFolder() : null|SeedDMS_Core_Folder`

##### Return values

null|SeedDMS_Core_Folder

#### getID()

inc.ClassUser.php : 307

Return internal id of user

`public getID() : int`

##### Return values

int

#### getImage()

inc.ClassUser.php : 1257

Get the image from the users profile

`public getImage() : string|null|bool`

##### Return values

string|null|bool —

image data as a string or null if no image is set or false in case of an error

#### getInstance()

inc.ClassUser.php : 210

Create an instance of a user object

`public static getInstance(string|int $id, SeedDMS_Core_DMS $dms[, string $by = '' ][, string $email = '' ]) : SeedDMS_Core_User|bool`

##### Parameters

$id : string|int

  Id, login name, or email of user, depending on the 3rd parameter.

$dms : SeedDMS_Core_DMS

  instance of dms

$by : string = ''

  search by [name|email]. If 'name' is passed, the method will check for the 4th paramater and also filter by email. If this parameter is left empty, the user will be search by its Id.

$email : string = ''

  optional email address if searching for name

##### Return values

SeedDMS_Core_User|bool —

instance of class SeedDMS_Core_User if user was found, null if user was not found, false in case of error

#### getKeywordCategories()

inc.ClassUser.php : 2039

Return list of personal keyword categories

`public getKeywordCategories() : array<string|int, SeedDMS_Core_KeywordCategory>|bool`

##### Return values

array<string|int, SeedDMS_Core_KeywordCategory>|bool —

list of categories or false in case of an error

#### getLanguage()

inc.ClassUser.php : 446
`public getLanguage() : string`

##### Return values

string

#### getLogin()

inc.ClassUser.php : 314

Return login of user

`public getLogin() : string`

##### Return values

string

#### getMandatoryApprovers()

inc.ClassUser.php : 1748

Get a list of mandatory approvers See {link SeedDMS_Core_User::getMandatoryReviewers}

`public getMandatoryApprovers() : array<string|int, mixed>`

##### Return values

array<string|int, mixed> —

list of arrays with two elements containing the user id (approverUserID) and group id (approverGroupID) of the approver.

#### getMandatoryReviewers()

inc.ClassUser.php : 1732

Get a list of mandatory reviewers A user which isn't trusted completely may have assigned mandatory reviewers (both users and groups).

`public getMandatoryReviewers() : array<string|int, mixed>`

Whenever the user inserts a new document the mandatory reviewers are filled in as reviewers.

##### Return values

array<string|int, mixed> —

list of arrays with two elements containing the user id (reviewerUserID) and group id (reviewerGroupID) of the reviewer.

#### getMandatoryWorkflow()

inc.ClassUser.php : 1812

Get the mandatory workflow A user which isn't trusted completely may have assigned mandatory workflow Whenever the user inserts a new document the mandatory workflow is filled in as the workflow.

`public getMandatoryWorkflow() : SeedDMS_Core_Workflow|bool`

##### Return values

SeedDMS_Core_Workflow|bool —

workflow

#### getMandatoryWorkflows()

inc.ClassUser.php : 1835

Get the mandatory workflows A user which isn't trusted completely may have assigned mandatory workflow Whenever the user inserts a new document the mandatory workflow is filled in as the workflow.

`public getMandatoryWorkflows() : array<string|int, SeedDMS_Core_Workflow>|bool`

##### Return values

array<string|int, SeedDMS_Core_Workflow>|bool —

workflow

#### getNotifications()

inc.ClassUser.php : 2012

Get all notifications of user

`public getNotifications([int $type = 0 ]) : array<string|int, SeedDMS_Core_Notification>|bool`

##### Parameters

$type : int = 0

  type of item (T_DOCUMENT or T_FOLDER)

##### Return values

array<string|int, SeedDMS_Core_Notification>|bool —

array of notifications

#### getPwd()

inc.ClassUser.php : 368

Get encrypted password of user

`public getPwd() : string`

##### Return values

string

#### getPwdExpiration()

inc.ClassUser.php : 393
`public getPwdExpiration() : string`

##### Return values

string

#### getQuota()

inc.ClassUser.php : 685
`public getQuota() : int`

##### Return values

int

#### getReviewStatus()

inc.ClassUser.php : 1472

Get a list of reviews

`public getReviewStatus([int $documentID = null ][, int $version = null ]) : array<string|int, mixed>|bool`

This function returns a list of all reviews and their latest log entry seperated by individuals and groups. If the document id is passed, then only this document will be checked for reviews. The same is true for the version of a document which limits the list further. If you do not limit on a version it will retrieve the status for each version, that includes even older versions which has been superseded by a new version.

For a detailed description of the result array see {link SeedDMS_Core_User::getApprovalStatus} which does the same for approvals.

##### Parameters

$documentID : int = null

  optional document id for which to retrieve the reviews

$version : int = null

  optional version of the document

##### Return values

array<string|int, mixed>|bool —

list of all reviews

#### getRole()

inc.ClassUser.php : 513
`public getRole() : string`

##### Return values

string

#### getTheme()

inc.ClassUser.php : 467
`public getTheme() : string`

##### Return values

string

#### getUsedDiskSpace()

inc.ClassUser.php : 671

Calculate the disk space for all documents owned by the user

`public getUsedDiskSpace() : int`

This is done by using the internal database field storing the filesize of a document version.

##### Return values

int —

total disk space in Bytes

#### getWorkflowsInvolved()

inc.ClassUser.php : 1705

Get a list of workflows this user is involved as in individual

`public getWorkflowsInvolved() : array<string|int, mixed>|bool`

##### Return values

array<string|int, mixed>|bool —

list of all workflows

#### getWorkflowStatus()

inc.ClassUser.php : 1663

Get a list of documents with a workflow

`public getWorkflowStatus([int $documentID = null ][, int $version = null ]) : array<string|int, mixed>|bool`

##### Parameters

$documentID : int = null

  optional document id for which to retrieve the reviews

$version : int = null

  optional version of the document

##### Return values

array<string|int, mixed>|bool —

list of all workflows

#### hasImage()

inc.ClassUser.php : 1235

Check if user has an image in its profile

`public hasImage() : bool`

##### Return values

bool —

true if user has a picture of itself

#### isAdmin()

inc.ClassUser.php : 537

Check, if user is an administrator

`public isAdmin() : bool`

##### Return values

bool

#### isDisabled()

inc.ClassUser.php : 615

Check, if user is disabled

`public isDisabled() : bool|int`

##### Return values

bool|int

#### isGuest()

inc.ClassUser.php : 560

Check, if user is a guest

`public isGuest() : bool`

##### Return values

bool

#### isHidden()

inc.ClassUser.php : 590

Check, if user is hidden

`public isHidden() : bool`

##### Return values

bool

#### isMandatoryApproverOf()

inc.ClassUser.php : 1788

Get a list of users this user is a mandatory approver of

`public isMandatoryApproverOf() : array<string|int, SeedDMS_Core_User>|bool`

This method is the reverse function of getMandatoryApprovers(). It returns those user where the current user is a mandatory approver.

##### Return values

array<string|int, SeedDMS_Core_User>|bool —

list of users where this user is a mandatory approver.

#### isMandatoryReviewerOf()

inc.ClassUser.php : 1765

Get a list of users this user is a mandatory reviewer of

`public isMandatoryReviewerOf() : array<string|int, SeedDMS_Core_User>|bool`

This method is the reverse function of getMandatoryReviewers(). It returns those user where the current user is a mandatory reviewer.

##### Return values

array<string|int, SeedDMS_Core_User>|bool —

list of users where this user is a mandatory reviewer.

#### isMemberOfGroup()

inc.ClassUser.php : 1226

Checks if user is member of a given group

`public isMemberOfGroup(SeedDMS_Core_Group $group) : bool`

##### Parameters

$group : SeedDMS_Core_Group

##### Return values

bool —

true if user is member of the given group otherwise false

#### isType()

inc.ClassUser.php : 284

Check if this object is of type 'user'.

`public isType(string $type) : mixed`

##### Parameters

$type : string

  type of object

#### isUser()

inc.ClassUser.php : 583

Check, if user is a regular user

`public isUser() : bool`

##### Return values

bool

#### joinGroup()

inc.ClassUser.php : 1161

Make the user a member of a group This function uses {@link SeedDMS_Group::addUser} but checks before if the user is already a member of the group.

`public joinGroup(SeedDMS_Core_Group $group) : bool`

##### Parameters

$group : SeedDMS_Core_Group

  group to be the member of

##### Return values

bool —

true on success or false in case of an error or the user is already a member of the group

#### leaveGroup()

inc.ClassUser.php : 1181

Removes the user from a group This function uses {@link SeedDMS_Group::removeUser} but checks before if the user is a member of the group at all.

`public leaveGroup(SeedDMS_Core_Group $group) : bool`

##### Parameters

$group : SeedDMS_Core_Group

  group to leave

##### Return values

bool —

true on success or false in case of an error or the user is not a member of the group

#### remove()

inc.ClassUser.php : 990

Remove the user and also remove all its keywords, notifications, etc.

`public remove(SeedDMS_Core_User $user[, SeedDMS_Core_User $assignToUser = null ]) : bool`

Do not remove folders and documents of the user, but assign them to a different user.

##### Parameters

$user : SeedDMS_Core_User

  the user doing the removal (needed for entry in review and approve log).

$assignToUser : SeedDMS_Core_User = null

  the user who is new owner of folders and documents which previously were owned by the delete user.

##### Return values

bool —

true on success or false in case of an error

#### removeFromProcesses()

inc.ClassUser.php : 859

Remove user from all processes

`public removeFromProcesses(object $user[, array<string|int, mixed> $states = array() ][, object $newuser = null ][, mixed $docs = null ]) : bool`

This includes review, approval and workflow

##### Parameters

$user : object

  the user doing the removal (needed for entry in review and approve log).

$states : array<string|int, mixed> = array()

  remove user only from reviews/approvals in one of the states

$newuser : object = null

  user who takes over the processes

$docs : mixed = null

##### Return values

bool —

true on success or false in case of an error

#### setAdmin()

inc.ClassUser.php : 544

Turn user into a admin

`public setAdmin() : bool`

##### Return values

bool

#### setComment()

inc.ClassUser.php : 498

Change comment of user

`public setComment( $newComment) : bool`

##### Parameters

$newComment :

  new comment

##### Return values

bool

#### setDisabled()

inc.ClassUser.php : 623

Disable user

`public setDisabled( $isDisabled) : bool`

##### Parameters

$isDisabled :

##### Return values

bool

#### setDMS()

inc.ClassUser.php : 291
`public setDMS(SeedDMS_Core_DMS $dms) : mixed`

##### Parameters

$dms : SeedDMS_Core_DMS

#### setEmail()

inc.ClassUser.php : 431

Change email address of user

`public setEmail( $newEmail) : bool`

##### Parameters

$newEmail :

  new email address

##### Return values

bool

#### setFullName()

inc.ClassUser.php : 351

Set full name of user

`public setFullName( $newFullName) : bool`

##### Parameters

$newFullName :

##### Return values

bool

#### setGuest()

inc.ClassUser.php : 567

Turn user into a guest

`public setGuest() : bool`

##### Return values

bool

#### setHidden()

inc.ClassUser.php : 598

Set user hidden

`public setHidden( $isHidden) : bool`

##### Parameters

$isHidden :

##### Return values

bool

#### setHomeFolder()

inc.ClassUser.php : 717
`public setHomeFolder(int $homefolder) : bool`

##### Parameters

$homefolder : int

##### Return values

bool

#### setImage()

inc.ClassUser.php : 1276
`public setImage( $tmpfile, $mimeType) : bool`

##### Parameters

$tmpfile :
$mimeType :

##### Return values

bool

#### setLanguage()

inc.ClassUser.php : 452
`public setLanguage( $newLanguage) : bool`

##### Parameters

$newLanguage :

##### Return values

bool

#### setLogin()

inc.ClassUser.php : 322

Change login of user

`public setLogin( $newLogin) : bool`

##### Parameters

$newLogin :

  new login

##### Return values

bool

#### setMandatoryApprover()

inc.ClassUser.php : 1893

Set a mandatory approver This function sets a mandatory approver if it isn't already set.

`public setMandatoryApprover(int $id[, bool $isgroup = false ]) : bool`

##### Parameters

$id : int

  id of approver

$isgroup : bool = false

  true if $id is a group

##### Return values

bool —

true on success, otherwise false

#### setMandatoryReviewer()

inc.ClassUser.php : 1860

Set a mandatory reviewer This function sets a mandatory reviewer if it isn't already set.

`public setMandatoryReviewer(int $id[, bool $isgroup = false ]) : bool`

##### Parameters

$id : int

  id of reviewer

$isgroup : bool = false

  true if $id is a group

##### Return values

bool —

true on success, otherwise false

#### setMandatoryWorkflow()

inc.ClassUser.php : 1925

Set a mandatory workflow This function sets a mandatory workflow if it isn't already set.

`public setMandatoryWorkflow(object $workflow) : bool`

##### Parameters

$workflow : object

  workflow

##### Return values

bool —

true on success, otherwise false

#### setMandatoryWorkflows()

inc.ClassUser.php : 1946

Set a mandatory workflows This function sets a list of mandatory workflows.

`public setMandatoryWorkflows(array<string|int, SeedDMS_Core_Workflow> $workflows) : bool`

##### Parameters

$workflows : array<string|int, SeedDMS_Core_Workflow>

  list of workflow objects

##### Return values

bool —

true on success, otherwise false

#### setPwd()

inc.ClassUser.php : 378

Set password of user

`public setPwd( $newPwd) : bool`

The password must be encrypted before calling this method.

##### Parameters

$newPwd :

  new encrypted password

##### Return values

bool

#### setPwdExpiration()

inc.ClassUser.php : 399
`public setPwdExpiration( $newPwdExpiration) : bool`

##### Parameters

$newPwdExpiration :

##### Return values

bool

#### setQuota()

inc.ClassUser.php : 691
`public setQuota(int $quota) : bool`

##### Parameters

$quota : int

##### Return values

bool

#### setRole()

inc.ClassUser.php : 519
`public setRole(int $newrole) : bool`

##### Parameters

$newrole : int

##### Return values

bool

#### setTheme()

inc.ClassUser.php : 473
`public setTheme(string $newTheme) : bool`

##### Parameters

$newTheme : string

##### Return values

bool

#### transferDocumentsFolders()

inc.ClassUser.php : 922

Transfer documents and folders to another user

`public transferDocumentsFolders(object $assignToUser) : bool`

##### Parameters

$assignToUser : object

  the user who is new owner of folders and documents which previously were owned by the delete user.

##### Return values

bool —

true on success or false in case of an error

#### transferEvents()

inc.ClassUser.php : 964

Transfer events to another user

`public transferEvents(object $assignToUser) : bool`

##### Parameters

$assignToUser : object

  the user who is new owner of events

##### Return values

bool —

true on success or false in case of an error

#### __removeFromProcesses()

inc.ClassUser.php : 768

Remove user from all processes

`private __removeFromProcesses(object $user[, array<string|int, mixed> $states = array() ][, object $newuser = null ][, array<string|int, mixed> $docs = null ]) : bool`

This method adds another log entry to the reviews and approvals which indicates the user has been deleted from the process. By default it will do so for each review/approval regardless of its current state unles the user has been removed already (status=-2). So even reviews/approvals already processed by the user will be added the log entry. Only, if the last log entry was a removal already, it will not be added a second time.

This removal from processes will also take place for older versions of a document.

This methode was initialy added to remove a user (which is going to be deleted afterwards) from all processes he or she is still involved in.

If a new user is passed, then this user will be added as a new reviewer, approver, etc. Hence, this method does not replace the old user but actually deletes the old user and adds a new one. Adding the new reviewer, approver, etc. will also be done for old versions of a document. The same operation could be archieved by first calling SeedDMS_Core_DocumentVersion::delIndReviewer() followed by SeedDMS_Core_DocumentVersion::addIndReviewer() but this would require to do for each version of a document and the operation would not be in a single transaction.

A new user is only added if the process (review, approval, etc.) is still in its initial state (have not been reviewed/approved or rejected). Unlike the removal of the user (see above).

If a new user is given but has no read access on the document the transfer for that particular document will be skipped. Not even the removal of the user will take place.

##### Parameters

$user : object

  the user doing the removal (needed for entry in review and approve log).

$states : array<string|int, mixed> = array()

  remove user only from reviews/approvals in one of the states e.g. if passing array('review'=>array(0)), the method will operate on reviews which has not been touched yet.

$newuser : object = null

  user who takes over the processes

$docs : array<string|int, mixed> = null

  remove only processes from docs with the given document ids

##### Return values

bool —

true on success or false in case of an error

#### __transferDocumentsFolders()

inc.ClassUser.php : 878

Transfer documents and folders to another user

`private __transferDocumentsFolders(object $assignToUser) : bool`

##### Parameters

$assignToUser : object

  the user who is new owner of folders and documents which previously were owned by the delete user.

##### Return values

bool —

true on success or false in case of an error

#### __transferEvents()

inc.ClassUser.php : 943

Transfer events to another user

`private __transferEvents(object $assignToUser) : bool`

##### Parameters

$assignToUser : object

  the user who is new owner of events

##### Return values

bool —

true on success or false in case of an error

## Search results