verifyOSUser()

The function returns TRUE (in the &result parameter) if the user with the defined user name exists, the account of the user is not locked or disabled and the specified password is correct. The default user is the current operating system user.

Synopsis

int verifyOSUser( string password, bool result[, string username[, int level]]);

Parameters

Parameter Meaning
password Password of the user to be verified.
&result TRUE if the user with the defined user name exists, the account of the user is not locked or disabled and the password is correct.
username The name of the user. The default is the current operating system user. The parameter is optional.
level Authorization level. Not used yet.

Return value

int

Error

The function returns -1 in case of errors and otherwise 0.

Description

The function returns TRUE (in the &result parameter) if the user with the defined user name exists, the account of the user is not locked or disabled and the specified password is correct.

The function checks if the user "mDavis" exists and if his account is locked or disabled. Note that you define the right password for the user. The function returns TRUE if the user "mDavis" exists and his account is not locked or disabled and the password is correct.

main()
{
  string passwd = "passwd";
  bool result;
  string username = "mDavis";
  verifyOSUser(passwd, result, username);
  DebugN(result,username);
}

Assignment

User administration, waiting control functions

Availability

CTRL