OP Get user list

4D - Documentation   Français   English   German   4D Open for 4D, Command Theme List   4D Open for 4D, Command Alphabetical List   Back   Previous   Next

version 1.5


OP Get user list (connectionID; listSelect; userNames; userConnections; userLastLogin) Longint

ParameterTypeDescription
connectionIDLongintConnection ID with target server
listSelectLongintSelects the Administrator (1) or Designer (0) user list
userNamesArrayArray of user names
userConnectionsArrayArray of number of connections per user
userLastLoginArrayArray of 'last user login' dates
Function resultLongintError 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

OP Get users and groups.


4D - Documentation   Français   English   German   4D Open for 4D, Command Theme List   4D Open for 4D, Command Alphabetical List   Back   Previous   Next