Constants

role_user

role_user

role_admin

role_admin

role_guest

role_guest

Properties

$_id

$_id : integer

Type

integer — id of user

$_login

$_login : string

Type

string — login name of user

$_pwd

$_pwd : string

Type

string — password of user as saved in database (md5)

$_pwdExpiration

$_pwdExpiration : string

Type

string — date when password expires

$_fullName

$_fullName : string

Type

string — full human readable name of user

$_email

$_email : string

Type

string — email address of user

$_language

$_language : string

Type

string — prefered language of user possible values are 'English', 'German', 'Chinese_ZH_TW', 'Czech' 'Francais', 'Hungarian', 'Italian', 'Portuguese_BR', 'Slovak', 'Spanish'

$_theme

$_theme : string

Type

string — preselected theme of user

$_comment

$_comment : string

Type

string — comment of user

$_role

$_role : string

Type

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

$_isHidden

$_isHidden : boolean

Type

boolean — true if user shall be hidden

$_isDisabled

$_isDisabled : boolean

Type

boolean — true if user is disabled

$_loginFailures

$_loginFailures : int

Type

int — number of login failures

$_dms

$_dms : object

Type

object — reference to the dms instance this user belongs to

Methods

SeedDMS_Core_User()

SeedDMS_Core_User( $id,  $login,  $pwd,  $fullName,  $email,  $language,  $theme,  $comment,  $role,  $isHidden,  $isDisabled,  $pwdExpiration,  $loginFailures,  $quota)

Parameters

$id
$login
$pwd
$fullName
$email
$language
$theme
$comment
$role
$isHidden
$isDisabled
$pwdExpiration
$loginFailures
$quota

setDMS()

setDMS( $dms)

Parameters

$dms

getID()

getID()

getLogin()

getLogin()

setLogin()

setLogin( $newLogin)

Parameters

$newLogin

getFullName()

getFullName()

setFullName()

setFullName( $newFullName)

Parameters

$newFullName

getPwd()

getPwd()

setPwd()

setPwd( $newPwd)

Parameters

$newPwd

getPwdExpiration()

getPwdExpiration()

setPwdExpiration()

setPwdExpiration( $newPwdExpiration)

Parameters

$newPwdExpiration

getEmail()

getEmail()

setEmail()

setEmail( $newEmail)

Parameters

$newEmail

getLanguage()

getLanguage()

setLanguage()

setLanguage( $newLanguage)

Parameters

$newLanguage

getTheme()

getTheme()

setTheme()

setTheme( $newTheme)

Parameters

$newTheme

getComment()

getComment()

setComment()

setComment( $newComment)

Parameters

$newComment

getRole()

getRole()

setRole()

setRole( $newrole)

Parameters

$newrole

isAdmin()

isAdmin()

setAdmin()

setAdmin( $isAdmin)

Parameters

$isAdmin

isGuest()

isGuest()

setGuest()

setGuest( $isGuest)

Parameters

$isGuest

isHidden()

isHidden()

setHidden()

setHidden( $isHidden)

Parameters

$isHidden

isDisabled()

isDisabled()

setDisabled()

setDisabled( $isDisabled)

Parameters

$isDisabled

addLoginFailure()

addLoginFailure()

clearLoginFailures()

clearLoginFailures()

getUsedDiskSpace()

getUsedDiskSpace() : integer

Calculate the disk space for all documents owned by the user

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

Returns

integer —

total disk space in Bytes

getQuota()

getQuota()

setQuota()

setQuota( $quota)

Parameters

$quota

remove()

remove(object $user, object $assignToUser) : boolean

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

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

Parameters

object $user

the user doing the removal (needed for entry in

   review and approve log).
object $assignToUser

the user who is new owner of folders and

   documents which previously were owned by the delete user.

Returns

boolean —

true on success or false in case of an error

joinGroup()

joinGroup(object $group) : boolean

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.

Parameters

object $group

group to be the member of

Returns

boolean —

true on success or false in case of an error or the user

   is already a member of the group

leaveGroup()

leaveGroup(object $group) : boolean

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.

Parameters

object $group

group to leave

Returns

boolean —

true on success or false in case of an error or the user

   is not a member of the group

getGroups()

getGroups() : array

Get all groups the user is a member of

Returns

array —

list of groups

isMemberOfGroup()

isMemberOfGroup(object $group) : boolean

Checks if user is member of a given group

Parameters

object $group

Returns

boolean —

true if user is member of the given group otherwise false

hasImage()

hasImage() : boolean

Check if user has an image in its profile

Returns

boolean —

true if user has a picture of itself

getImage()

getImage() : array

Get the image from the users profile

Returns

array —

image data

setImage()

setImage( $tmpfile,  $mimeType)

Parameters

$tmpfile
$mimeType

getDocuments()

getDocuments() : array

Returns all documents of a given user

Returns

array —

list of documents

getDocumentsLocked()

getDocumentsLocked() : array

Returns all documents locked by a given user FIXME: Not full implemented. Do not use, because it still requires the temporary tables!

Returns

array —

list of documents

getReviewStatus()

getReviewStatus(int $documentID, int $version) : array

Get a list of reviews This function returns a list of all reviews seperated by individual and group reviews. 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.

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

Parameters

int $documentID

optional document id for which to retrieve the

   reviews
int $version

optional version of the document

Returns

array —

list of all reviews

getApprovalStatus()

getApprovalStatus(int $documentID, int $version) : array

Get a list of approvals This function returns a list of all approvals seperated by individual and group approvals. 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.

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:

  • 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

int $documentID

optional document id for which to retrieve the

   approvals
int $version

optional version of the document

Returns

array —

list of all approvals

getWorkflowStatus()

getWorkflowStatus(int $documentID, int $version) : array

Get a list of documents with a workflow

Parameters

int $documentID

optional document id for which to retrieve the

   reviews
int $version

optional version of the document

Returns

array —

list of all workflows

getMandatoryReviewers()

getMandatoryReviewers() : array

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

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

Returns

array —

list of arrays with two elements containing the user id

    (reviewerUserID) and group id (reviewerGroupID) of the reviewer.

getMandatoryApprovers()

getMandatoryApprovers() : array

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

Returns

array —

list of arrays with two elements containing the user id

    (approverUserID) and group id (approverGroupID) of the approver.

getMandatoryWorkflow()

getMandatoryWorkflow() : object

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.

Returns

object —

workflow

setMandatoryReviewer()

setMandatoryReviewer(integer $id, boolean $isgroup) : boolean

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

Parameters

integer $id

id of reviewer

boolean $isgroup

true if $id is a group

Returns

boolean —

true on success, otherwise false

setMandatoryApprover()

setMandatoryApprover(integer $id, boolean $isgroup) : boolean

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

Parameters

integer $id

id of approver

boolean $isgroup

true if $id is a group

Returns

boolean —

true on success, otherwise false

setMandatoryWorkflow()

setMandatoryWorkflow(object $workflow) : boolean

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

Parameters

object $workflow

workflow

Returns

boolean —

true on success, otherwise false

delMandatoryReviewers()

delMandatoryReviewers() : boolean

Deletes all mandatory reviewers

Returns

boolean —

true on success, otherwise false

delMandatoryApprovers()

delMandatoryApprovers() : boolean

Deletes all mandatory approvers

Returns

boolean —

true on success, otherwise false

delMandatoryWorkflow()

delMandatoryWorkflow() : boolean

Deletes the mandatory workflow

Returns

boolean —

true on success, otherwise false