KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Verifying a username and password from a 4D Password system
PRODUCT: 4D | VERSION: | PLATFORM: Mac & Win
Published On: March 14, 2003

Versions: 6.7, 6.8.x and 4th Dimension 2003

Here is a simple method that will verify the validity of the username and password with the 4D Password system.

  ` Project Method: FN_isValidUser
  ` Description: Returns True if the username and password is valid
` or False otherwise.

C_BOOLEAN($0)
C_TEXT($1;$2)

ARRAY TEXT(atUserName;0)
ARRAY LONGINT(alUserID;0)
C_LONGINT($vlElem)

GET USER LIST(atUserName;alUserID)
$vlElem:=Find in array(atUserName;$1)
If ($vlElem>0)
 $0:=Validate password(alUserID{$vlElem};$2)
Else
 $0:=False
End if