Class wwUserSecurity

The wwUserSecurity class provides a base interface for implementing FoxPro table and Windows Auth user authentication. The class includes user retrieval and non-visual management features like adding deleting etc.

Custom
  wwUserSecurity

Class Members

MemberDescription

Authenticate

o.Authenticate(lcUsername, lcPassword)

AuthenticateNt

Authenticates username and password against Windows System accounts.

o.AuthenticateNt(lcUsername,lcPassword)

Close

Closes the user file.

o.Close()

CreateTable

o.CreateTable(lcFileName)

DeleteUser

Deletes the currently selected user.

o.DeleteUser()

FixupTable

Method used to fix up the wwUserSecurity table by stripping trailing spaces from text fields and encoding all passwords if cPasswordEncryptionKey is set.

o.FixupTable()

GetPasswordHash

Retrieves a password hash from an unenrypted string/password value.

This method is used internally to encrypt passwords during Save operations. By default this method looks for a ~~ postfix and if it finds it uses that value as a hash. The llForce parameter forces the password to be rehashed explicitly.

o.GetPasswordHash(lcPassword,llForce)

GetUser

Retrieves a user into the oUser member based on a PK or Username and Password lookup.

o.GetUser(lcPK, lcPassword)

GetUserByUsername

Like the GetUser() method but retrieves a user by username rather than by PK.

o.GetUserByUsername(lcUsername)

GetUserByValidationKey

Retrieves a user by the Validate field value. Use this when validating a user account or for password recovery.

o.GetUserByValidationKey(lcValidate)

IsEmpty

Determines whether a user has been loaded into the .oUser instance.

Checks whether the pk or username fields are blank.

o.IsEmpty()

NewUser

Creates a new user record and stores it in the `.oUser` member data and returns the `.oUser` as a result.

o.NewUser()

Open

Opens the user file and/or selects it into cAlias. If the table is already open this method only selects the Alias.

o.Open(lcFileName, llReOpen, llSilent)

Reindex

Reindexes and compacts the user table.

o.Reindex()

SaveUser

Saves the currently active user to file. Saves the oUser member to the database.

o.SaveUser()

calias

Alias of the user file.

cdomain

Domain name when using NT Authentication for request.

cerrormsg

Holds error messages when lError = .T. or when any methods return False.

cfilename

Filename for the user file.

cPasswordEncryptionKey

Encryption key string that's used to hash the password stored in the usersecurity file's password field.

The value is hashed when a user is saved via the SaveUser(). Hashed passwords end in a postfix of ~~.

lcasesensitive

Determines wheter usernames and passwords are case sensitive. The default is .F.

lerror

Error Flag. True when an error occurs during any operation. Set but not required as most methods return True or False.

lRequireValidation

ndefaultaccounttimeout

The default value when the account should time out in days. Leave this value at 0 to force the account to never timeout.

nminpasswordlength

Minimum length of the password.

oUser

Requirements

Assembly: wwUserSecurity.prg

© West Wind Technologies, 1996-2019 • Updated: 01/31/17
Comment or report problem with topic