addUser()
The method adds a user to the user administration.
Synopsis
public bool addUser(shared_ptr<UserManagementUser> user) synchronized (instance);
Parameter | Description |
---|---|
user | The user to be added to the WinCC OA user management. |
Return Value
The method returns TRUE if the user could be added.
Errors
Errors are shown in the log viewer.
EXAMPLE
#uses "classes/userManagement/UserManagement"
main(mapping event)
{
shared_ptr<UserManagement> userMgm = UserManagement::getInstance();
shared_ptr<UserManagementUser> usr = new UserManagementUser("JohnDoe","");
DebugN("Added user:", userMgm.addUser(usr)); /*Adds the user JohnDoe to the user management */
DebugN("Save changes:",userMgm.saveChanges());
DebugN("Users:",userMgm.getAllSavedUsers());
}
Assignment
See also