SeedDMS_Core_User
in package
Class to represent a user in the document management system
Tags
Table of Contents
Properties
- $_rev_substitutes : array<string|int, mixed>
- $_secret : string
- $_substitutes : array<string|int, mixed>
- $_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 : object
- $_theme : string
Methods
- __construct() : mixed
- SeedDMS_Core_User constructor.
- addLoginFailure() : bool|int
- addSubstitute() : bool
- Add a substitute to the user
- 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
- getDocumentsCheckOut() : array<string|int, mixed>
- Returns all documents check out by 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
- getReceiptStatus() : array<string|int, mixed>
- Get a list of receipts This function returns a list of all receipts seperated by individual and group receipts. If the document id is passed, then only this document will be checked for receipts. The same is true for the version of a document which limits the list further.
- getReverseSubstitutes() : array<string|int, mixed>
- Get all users this user is a substitute of
- getReviewStatus() : array<string|int, mixed>|bool
- Get a list of reviews
- getRevisionStatus() : array<string|int, mixed>
- Get a list of revisions This function returns a list of all revisions seperated by individual and group revisions. If the document id is passed, then only this document will be checked for revisions. The same is true for the version of a document which limits the list further.
- getRole() : string
- getSecret() : string
- getSubstitutes() : array<string|int, mixed>
- Get all substitutes of the user
- 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
- isSubstitute() : bool
- Check if user is a substitute of the current user
- isType() : mixed
- Check if this object is of type '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.
- maySwitchToUser() : bool
- Check if user may switch to the given user
- remove() : bool
- Remove the user and also remove all its keywords, notifications, etc.
- removeFromProcesses() : bool
- Remove user from all processes
- removeSubstitute() : bool
- Remove a substitute from the user
- 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
- 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
- setSecret() : mixed
- 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
Properties
$_rev_substitutes
public
array<string|int, mixed>
$_rev_substitutes
reverse list of users this user can substitute
Tags
$_secret
public
string
$_secret
secret of user for 2-factor authentication
Tags
$_substitutes
public
array<string|int, mixed>
$_substitutes
list of users this user can substitute
Tags
$_comment
protected
string
$_comment
comment of user
Tags
$_dms
protected
SeedDMS_Core_DMS
$_dms
reference to the dms instance this user belongs to
Tags
$_email
protected
string
$_email
email address of user
Tags
$_fullName
protected
string
$_fullName
full human readable name of user
Tags
$_groups
protected
array<string|int, mixed>
$_groups
list of groups
Tags
$_hasImage
protected
bool
$_hasImage
Tags
$_homeFolder
protected
SeedDMS_Core_Folder
$_homeFolder
home folder
Tags
$_id
protected
int
$_id
id of user
Tags
$_isDisabled
protected
bool
$_isDisabled
true if user is disabled
Tags
$_isHidden
protected
bool
$_isHidden
true if user shall be hidden
Tags
$_language
protected
string
$_language
prefered language of user possible values are subdirectories within the language directory
Tags
$_login
protected
string
$_login
login name of user
Tags
$_loginFailures
protected
int
$_loginFailures
number of login failures
Tags
$_pwd
protected
string
$_pwd
password of user as saved in database (md5)
Tags
$_pwdExpiration
protected
string
$_pwdExpiration
date when password expires
Tags
$_quota
protected
int
$_quota
Tags
$_role
protected
object
$_role
SeedDMS_Core_Role
Tags
$_theme
protected
string
$_theme
preselected theme of user
Tags
Methods
__construct()
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 ][, string $secret = '' ]) : mixed
Parameters
addLoginFailure()
public
addLoginFailure() : bool|int
Return values
bool|intaddSubstitute()
Add a substitute to the user
public
addSubstitute(mixed $substitute) : bool
Parameters
- $substitute : mixed
Return values
bool —true if successful otherwise false
clearLoginFailures()
public
clearLoginFailures() : bool
Return values
booldelMandatoryApprovers()
Deletes all mandatory approvers
public
delMandatoryApprovers() : bool
Return values
bool —true on success, otherwise false
delMandatoryReviewers()
Deletes all mandatory reviewers
public
delMandatoryReviewers() : bool
Return values
bool —true on success, otherwise false
delMandatoryWorkflow()
Deletes the mandatory workflow
public
delMandatoryWorkflow() : bool
Return values
bool —true on success, otherwise false
getAllInstances()
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>|boolgetApprovalStatus()
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()
Return comment of user
public
getComment() : string
Return values
stringgetDMS()
public
getDMS() : SeedDMS_Core_DMS
Return values
SeedDMS_Core_DMS —$dms
getDocumentContents()
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()
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()
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()
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
getDocumentsCheckOut()
Returns all documents check out by a given user
public
getDocumentsCheckOut() : array<string|int, mixed>
Return values
array<string|int, mixed> —list of documents
getDocumentsLocked()
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()
Get email address of user
public
getEmail() : string
Return values
stringgetFolders()
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()
Return full name of user
public
getFullName() : string
Return values
stringgetGroups()
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()
public
getHomeFolder() : null|SeedDMS_Core_Folder
Return values
null|SeedDMS_Core_FoldergetID()
Return internal id of user
public
getID() : int
Return values
intgetImage()
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()
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()
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()
public
getLanguage() : string
Return values
stringgetLogin()
Return login of user
public
getLogin() : string
Return values
stringgetMandatoryApprovers()
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()
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()
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()
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()
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()
Get encrypted password of user
public
getPwd() : string
Return values
stringgetPwdExpiration()
public
getPwdExpiration() : string
Return values
stringgetQuota()
public
getQuota() : int
Return values
intgetReceiptStatus()
Get a list of receipts This function returns a list of all receipts seperated by individual and group receipts. If the document id is passed, then only this document will be checked for receipts. The same is true for the version of a document which limits the list further.
public
getReceiptStatus([int $documentID = null ][, int $version = null ]) : array<string|int, mixed>
For a detaile 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 receipt
- $version : int = null
-
optional version of the document
Return values
array<string|int, mixed> —list of all receipts
getReverseSubstitutes()
Get all users this user is a substitute of
public
getReverseSubstitutes() : array<string|int, mixed>
Return values
array<string|int, mixed> —list of users
getReviewStatus()
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
getRevisionStatus()
Get a list of revisions This function returns a list of all revisions seperated by individual and group revisions. If the document id is passed, then only this document will be checked for revisions. The same is true for the version of a document which limits the list further.
public
getRevisionStatus([int $documentID = null ][, int $version = null ]) : array<string|int, mixed>
For a detaile 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 revisions
- $version : int = null
-
optional version of the document
Return values
array<string|int, mixed> —list of all revisions. If the result array has no elements, then the user was not a revisor. If there elements for 'indstatus' or 'grpstatus' then the revision hasn't been started.
getRole()
public
getRole() : string
Return values
stringgetSecret()
public
getSecret() : string
Return values
stringgetSubstitutes()
Get all substitutes of the user
public
getSubstitutes() : array<string|int, mixed>
These users are substitutes of the current user
Return values
array<string|int, mixed> —list of users
getTheme()
public
getTheme() : string
Return values
stringgetUsedDiskSpace()
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()
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()
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()
Check if user has an image in its profile
public
hasImage() : bool
Return values
bool —true if user has a picture of itself
isAdmin()
Check, if user is an administrator
public
isAdmin() : bool
Return values
boolisDisabled()
Check, if user is disabled
public
isDisabled() : bool|int
Return values
bool|intisGuest()
Check, if user is a guest
public
isGuest() : bool
Return values
boolisHidden()
Check, if user is hidden
public
isHidden() : bool
Return values
boolisMandatoryApproverOf()
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()
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()
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
isSubstitute()
Check if user is a substitute of the current user
public
isSubstitute(mixed $substitute) : bool
Parameters
- $substitute : mixed
Return values
bool —true if successful otherwise false
isType()
Check if this object is of type 'user'.
public
isType(string $type) : mixed
Parameters
- $type : string
-
type of object
joinGroup()
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()
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
maySwitchToUser()
Check if user may switch to the given user
public
maySwitchToUser(mixed $touser) : bool
Switching to the given user is only allowed if the given user is a substitute for the current user.
Parameters
- $touser : mixed
Return values
bool —true if successful otherwise false
remove()
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()
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
removeSubstitute()
Remove a substitute from the user
public
removeSubstitute(mixed $substitute) : bool
Parameters
- $substitute : mixed
Return values
bool —true if successful otherwise false
setComment()
Change comment of user
public
setComment( $newComment) : bool
Parameters
Return values
boolsetDisabled()
Disable user
public
setDisabled( $isDisabled) : bool
Parameters
Return values
boolsetDMS()
public
setDMS(SeedDMS_Core_DMS $dms) : mixed
Parameters
- $dms : SeedDMS_Core_DMS
setEmail()
Change email address of user
public
setEmail( $newEmail) : bool
Parameters
Return values
boolsetFullName()
Set full name of user
public
setFullName( $newFullName) : bool
Parameters
Return values
boolsetHidden()
Set user hidden
public
setHidden( $isHidden) : bool
Parameters
Return values
boolsetHomeFolder()
public
setHomeFolder(int $homefolder) : bool
Parameters
- $homefolder : int
Return values
boolsetImage()
public
setImage( $tmpfile, $mimeType) : bool
Parameters
Return values
boolsetLanguage()
public
setLanguage( $newLanguage) : bool
Parameters
Return values
boolsetLogin()
Change login of user
public
setLogin( $newLogin) : bool
Parameters
Return values
boolsetMandatoryApprover()
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()
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()
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()
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()
Set password of user
public
setPwd( $newPwd) : bool
The password must be encrypted before calling this method.
Parameters
Return values
boolsetPwdExpiration()
public
setPwdExpiration( $newPwdExpiration) : bool
Parameters
Return values
boolsetQuota()
public
setQuota(int $quota) : bool
Parameters
- $quota : int
Return values
boolsetRole()
public
setRole(int $newrole) : bool
Parameters
- $newrole : int
Return values
boolsetSecret()
public
setSecret(string $newSecret) : mixed
Parameters
- $newSecret : string
setTheme()
public
setTheme(string $newTheme) : bool
Parameters
- $newTheme : string
Return values
booltransferDocumentsFolders()
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()
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()
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, approvals, receptions, revisions, which indicates that the user has been deleted from the process. By default it will do so for each review/approval/reception/revision regardless of its current state unless the user has been removed already (status=-2). So even reviews/approvals/receptions/revisions 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 behaviour can be changed by passing a list of states in the optional argument $states. Only reviews, etc. in the given state will be affected. This allows to remove the user only if the review, etc. has not been done (state = 0).
The last optional parameter $newuser is for replacing the user currently in charge by another user. If this parameter is passed, the old user will be deleted first (like described above) and afterwards the new user will be addded. The deletion of the old user and adding the new user will only happen if the new user has at least read access on the document. If not, the document will be skipped and remained unchanged.
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()
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()
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