Skip to content
Stephan Stricker edited this page Apr 22, 2022 · 15 revisions

Table of Contents

Available Versions

There are 4 versions available for the user management sample. Version 1.x uses the ArUser library to handle all activities. It does not require the mappUserX component and therefore no license. Version 2.x uses mappUserX as well as new user widgets. It uses less source code and allows for more detailed configuration but also requires a license. Both versions have an additional variant that supports RFID readers. Here is a list of all versions:

Description

The sample consists of two main components. The sample page is used to display all important settings for users and roles. The task UserManagement drives the user management and uses the ArUser library in the background. The following functions are currently supported.

  • Create, rename and delete user
  • Assign and remove roles from users
  • Change password
  • Import export user information

The sample supports up to 3 concurrent client connections. While the task itself can only execute one command at a time the commands are executed so fast that this should not be an issue. The refresh command may take longer but the response data is distributed to all seesions. The task uses a variable structure to communicate that can also be used to trigger functions external. The structure ArUser looks as follows:

Level 1 Level 2 Level 3 Level Description
CMD Used to trigger commands like create user, change password, ... A command is triggered by setting it to true, when the command is finished the task will reset the command. This indicates that the command is finished. Do not change any parameters or set another command until the previous command is finished.
UserCreate Create a new user
UserDelete Delete an existing user
UserRename Rename an existing user
RoleAssign Assign role to user
RoleRemove Release role from user
Import Import all user data to file
Export Export all user data into a file
ListRefresh Refresh user list
ErrorReset Reset error
PAR Parameters like user name, file path to export data, ...
FilePath This is where import and export files are stored. Note that this is the absolute path and not a file device as it would be used for many other functions. Use "F:/" for the user partition.
UserName The user name affected by a command
UserNameNew The new user name used when renaming a user
UserRole The user role used with the assign and remove command
Password Password used for user create and password change
PasswordRepeat Must match the password in previous variable 'Password'
VisuSlotID This is the session ID for the current command. This is used to identify where to send response messages.
DAT User data and roles as well as some status information
Users A list with all users in the system
Name Name of user
Roles Roles assigned to this user
ErrorReset
Roles A list with all roles in the system
Status Shows the result for the last command
UserActive This is a list of users that are currently logged in
VIS Data specific for the visualization. The structure is an array, one for each client session
ListUsers Data provider of list box for all users
ListUsersIndex Index of user list box for all users
ListUserValue Selected user name
ListUserRole Data provider of list box for selected user roles
ListUserRoleIndex Index of user list box for selected user roles
ListRoles Data provider of list box for all roles
ListRolesIndex Index of role list box for all roles
RoleDeleteEnabled Enables/Disables the button to delete a role
UserDeleteEnabled Enables/Disables the button to delete or rename a user
ShowMessageBoxOK Show a message box when command was successful
ShowMessageBoxError Show a message box when command was not successful
ERR Information about errors
No Error number
State State where the error occurred
Text Error text

Error

The sample generates the following list of error messages. All other error numbers are generated from included libraries that can be found in the Automation Studio help.

No Constant Text
50000 ERR_PASSWORD_MISMATCH The two passwords "Password" and "PasswordRepeat" don't match
50001 ERR_USER_LIST_TOO_SHORT More users found than fit into user list
50002 ERR_ROLE_LIST_TOO_SHORT More roles found than fit into the role list
50003 ERR_DELETE_CURRENT_USER Logged in user cannot be deleted
50004 ERR_RENAME_CURRENT_USER Logged in user cannot be renamed
50005 ERR_USER_ROLE_NAME_SIZE Logged in user cannot be renamed*
50010 ERR_TOO_MANY_CLIENTS More than 3 clients try to connect to user management

Limitations

  • Roles cannot be created or deleted. This is because the permission for roles cannot be changed on the fly.

Revision History

Version 1.1

  • Fixed export path not connected to ArUser.PAR.FilePath in mappView

Version 1.0

  • Fixed password is not created

Version 0.8

  • Add destroy user list to free up memory
  • Code cleanup

Version 0.7

  • Clear password field when user is created, password is changed, login or logout
  • Removed user anonymous from user list
  • Increased length of status message

Version 0.6

  • Added message box before deleting user
  • Changed constant to avoid conflict with other samples
  • Fixed user selection after create and rename
  • Updated mappView to 5.7.1
  • Code optimizations

Version 0.5

  • Multi client support
  • Changed error structure

Version 0.4

  • Software structure change to work with future expansion
  • Make sure passwords match before user is created

Version 0.3

  • Automatically set password when new user is created
  • Erase password field when user logs out
  • New command to rename user

Version 0.2

  • Make sure last user cannot be deleted
  • Make sure last user cannot delete himself
  • Make sure last user cannot be deleted
  • Added group box with login
  • Added message boxes for success and failed commands
  • Visual tweaks and bug fixes

Version 0.1

First public release