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

This method is called to authenticate a user. This method can be overriden to provide custom functionality.

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

Creates the User table if it doesn't exist. Called by the Open method.

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.

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.

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.

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

If .T. requires accounts to be validated before they can be accessed.

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

The actual member that holds user data. Filled by the GetUser and NewUser methods.

Requirements

Assembly: wwUserSecurity.prg

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