Change password of a user since Vision Client

Hi, is there any form to change the password with my actual password in vision client?
Something like this ?

userSource = "default"  
username = system.security.getUsername()
oldPassword = event.source.parent.getComponent("txtOldPassword").text
newPassword = event.source.parent.getComponent("txtNewPassword").text


try:
    system.user.changePassword(userSource, username, oldPassword, newPassword)
    system.gui.messageBox("Contraseña cambiada exitosamente.")
except Exception as e:
    system.gui.errorBox("Error al cambiar la contraseña: " + str(e))

You might be looking for system.user.editUser(). The User object it takes has a password property that can be changed.

2 Likes

Personally, I would just use the built-in user management.

  1. Put it on it's own window.
  2. Force user log out when the window first opens.
  3. Require user to be logged in with permissions to change user credentials.
  4. Use an inactivity script on the window to log the user out.
  5. Force user log out when the window is closed.

Essentially splitting the "old password" and "new password" into two processes.

2 Likes