version 1.5
OP Get user list (connectionID; listSelect; userNames; userConnections; userLastLogin) Longint
Parameter | Type | Description | |
connectionID | Longint | Connection ID with target server | |
listSelect | Longint | Selects the Administrator (1) or Designer (0) user list | |
userNames | Array | Array of user names | |
userConnections | Array | Array of number of connections per user | |
userLastLogin | Array | Array of 'last user login' dates | |
Function result | Longint | Error code result for the function |
Description
OP Get user list retrieves the user list for either the Designer or the Administrator of the database. It also retrieves the number of connections for each user and the date of each user's last connection.
There are two sets of users in a 4th Dimension structure file: the Designer and Administrator maintain their own sets of users. listSelect determines which set of users is retrieved by this command.
UserNames can be an array of type String or Text.
UserConnections can be an array of type String, Text, Real, Integer, or Long Integer.
UserLastLogins can be an array of type String, Text, or Date.
Example
This example uses the OP Get user list function to find login information about the users.
ARRAY TEXT (arUserNames;0) ARRAY DATE (arLastLog;0) ARRAY INTEGER (arUserConns;0) C_LONGINT ($errCode) C_TEXT ($message) ` Gather infor about Administrator-created accounts $errCode := OP Get user list (vConnectID;1;arUserNames;arUserConns;arLastLog) $message:="" For ($i;1;Size of array (arUserNames)) If (asLastLog {$i} < Current date -7) ` If no login for that user has occured ` Alert Administrator $message := $message + arUserNames {$i} + ", " End if End for $message := $message + Char (Carriage return) + " have not logged in for a week" $message := $message + Char (Carriage return) + " you should disable their account until their return" SendMessage ($mess;"admin_4D@acme.com")
See Also