Class: User

Class:User
Description:The User-class
File:/include/user.php
CVS Version:1.2
CVS Modification:2004-02-17 13:27
Variables:
NameTypeDefaultDescription
iIdInteger0Users id in database
sLoginStringUsers login
sPasswordStringUsers password [chould not be used, will be removed]
sFirstNameStringUsers first name
sSurNameStringUsers last name
sNickNameStringNickName
sEmailString
iLastActiveInteger0Last the user accessed a php-document (unix-time)
sThemeFolderStringCurrent theme-folder (themed)
iLanguageIdInteger0Language ID (see languages-table)
sCachePasswordCryptStringCrypted password using crypt-function
bIsAdminBooleanfalse
bIsGuestBooleanfalse
bUseExternalLoginBooleanfalse
iSingleUserGroupIdInteger0Users own group-id (all users hav there own signleuser-group)
aChildStructArrayfalse
bIsGroupAdminBoolean0Used when User-objects are listed in the Group-class aUsers-array

User

Description:Constructor
Returns: [Undefined]
Arguments:
NameTypeOptionalDescription
uInput1Undefined YES [false]

sCryptPassword

Description:Encrypts a user-password
Returns: [String] Crypted password
Arguments:
NameTypeOptionalDescription
sPasswordStringPassword to crypt

bGetById

Description:Get object from database
Returns: [Boolean] True if the user exists in the database
Arguments:
NameTypeOptionalDescription
iIdIntegerid to get

bGetByLogin

Description:Get the user with specified login and password
Returns: [Boolean] true if the object is succesfully found and fetched
Arguments:
NameTypeOptionalDescription
sLoginStringlogin to verify
sPasswordStringpassword to verify
bUpdateLastActiveBoolean YES [true] [optional] default true Update the iLastActive-variable?
bCheckCryptPasswordBoolean YES [true] [optional] default true Check $sPassword against crypted $sCachePasswordCrypt instead of $sPassword
bAllowGuestBoolean YES [false]

bFetchObject

Description:Fetches the database-array to the current object
Returns: [Boolean] true on succes
Arguments:
NameTypeOptionalDescription
aUserArray referenceArray to fetch

bUpdate

Description:Save/Update current user-object
Returns: [Boolean] true on success
Arguments:
NameTypeOptionalDescription

iGetChildStruct

Description:Get the users own home-structure Populates the objects aChildStruct-array
Returns: [Integer] NOF Child-structures on next level
Arguments:
NameTypeOptionalDescription

sGetDHTMLMenu

Description:Get the user-struct menu Requires iGetChildStruct to run first
Returns: [String] The Javascript-code for the DHTML-menu
Arguments:
NameTypeOptionalDescription
sJSObjectStringthe javascript-object
oCurrentLangObject YES [false] Language-object for translation-purpose

bJoinWorkspace

Description:Add the user to a workspace
Returns: [Boolean] True on success
Arguments:
NameTypeOptionalDescription
iWorkspaceIdIntegerAdd the user to a workspace
bIsAdminBoolean YES [false] As admin?

bAddToGroup

Description:Add the user to a group
Returns: [Boolean]
Arguments:
NameTypeOptionalDescription
iGroupIdIntegerthe group
bAdministratorBoolean YES [false] As admin or not?