Progress
Language Reference
SETUSERID Function
Returns a TRUE value and assigns the user ID to the user if the user ID and password supplied to the SETUSERID function are in the _User table. If the user ID is not in the _User table or the password is incorrect, SETUSERID returns a FALSE value and does not assign the user ID to the user.
SYNTAX
userid
A constant, field name, variable name, or expression that results in a character value that represents the user’s user ID. If you use a constant, you must enclose it in quotation marks (" ").
password
A constant, field name, variable name, or expression that results in a character value that represents the user’s password. If you use a constant, you must enclose it in quotation marks.
logical-dbname
The logical name of the database where you want to check and set your user ID. The logical database name must be a character string enclosed in quotes, or a character expression. If you do not specify this argument, the Compiler inserts the name of the database that is connected when the procedure is compiled. If you omit this argument and more than one database is connected, it results in a Compiler error.
EXAMPLETo use the
login.p
procedure that is provided with Progress, you must define user IDs and passwords for those users who are authorized to access the database.
The
login.p
procedure uses the SETUSERID function to check the value of the user ID and password that a user enters. If the value of the function is FALSE, the procedure allows the user another try. The user has three tries to log in. The first time, the tries variable is 0; tries is 1 the second time, and 2 the third. The third time, tries is greater than 1 and the procedure exits from Progress with the QUIT statement.NOTES
- Use the Userid (-U) parameter together with the Password (-P) parameter. Progress checks the _User table for the userid supplied with the -U parameter. When it finds that userid, it compares the password supplied with the -P parameter with the password in the _User table. If the two passwords match, Progress assigns that userid to the Progress session.
- Under the following conditions, the SETUSERID function returns a value of FALSE and does not assign a user ID to the user:
- When using the SETUSERID function, Progress returns a compiler error under the following conditions:
- When specifying the logical-dbname argument, you must provide the name of the logical database, not the physical database.
- SETUSERID encodes the password argument and then compares the result with the value stored in the _User._password field of the _User table.
- After SETUSERID returns a value of TRUE and assigns a user ID to a user:
- If the root user ID does not exist in the _User table, SETUSERID returns a value of FALSE when supplied with a userid of root. If the _User table does have a root entry, the user who assumes that user ID has all the privileges associated with the root user ID on UNIX.
- You must create a blank user ID (
""
) if you want to set the user ID to a null value.- Table 41 shows how Progress determines a user ID on UNIX.
- Table 42 shows how Progress determines a user ID on Windows.
- See the Progress Programming Handbook and the Progress Database Administration Guide and Reference for more information on user privileges.
SEE ALSO
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |