4D v13.4CHANGE CURRENT USER |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v13.4
CHANGE CURRENT USER
CHANGE CURRENT USER
CHANGE CURRENT USER changes the identity of the current user in the database, without needing to quit. The user can change their identity themselves either using the database connection dialog box (when the command is called without parameters) or directly via the command. When a user changes their identity, they abandon any former access privileges in favor of those belonging to the chosen user. If the CHANGE CURRENT USER command is executed without parameters, the database connection dialog box appears. The user must then enter or select a valid name and password in order to enter the database. The contents of the connection dialog box will depend on the options set on the Application/Access page of the database Preferences. You can also pass the two optional user and password parameters to specify by programming the new account to be used.
If the user account does not exist or was deleted, error -9979 is returned. You can intercept this error with the error-handling method installed by the ON ERR CALL command. Otherwise, you can call the function Is user deleted to test the user account before calling this command. Pass the non-encrypted user account password in the password parameter. If the password does not match the user, the command will return error message -9978 and do nothing. The command execution is now delayed to prevent flooding (brute force attack), in other words, attempts of multiple user name/password combinations. As a result, after the 4th call to this command, it is run only after a period of 10 seconds. This delay is throughout the entire work station. The CHANGE CURRENT USER command can be used to set up custom dialog boxes for entering the name and password (with entry and expiration rules) that benefit from the same advantages as the access control system of 4D. 1. The database is entered directly in the “Default user” mode, without a dialog box. 2. The On Startup database method displays a custom dialog box for entering the user name and password. All types of processing are foreseeable in the dialog box: 3. When the entry is validated, the required information (user name and password) are passed to the CHANGE CURRENT USER command in order to open the database with the user account privileges. The following example displays the connection dialog box: CHANGE CURRENT USER |
PROPERTIES
Product: 4D
INDEX HISTORY
Modified: 4D 2004 SEE ALSO |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||