Make new password available under DBPASS_DOMAIN action

We use the following code in post installation script to update client applications' passwords in case if the password was changed on Edit Virtual Server page (virtual-server/edit_domain.cgi):

if [ "$VIRTUALSERVER_ACTION" = "MODIFY_DOMAIN" ]; then
  if [ $VIRTUALSERVER_PASS != $VIRTUALSERVER_OLDSERVER_PASS ]; then
    custom_script_that_updates_client_applications_passwords_here
  fi
fi

and it works like a charm.

However, if client decides to change password on Edit Databases > Passwords (virtual-server/list_databases.cgi) page instead, then unfortunately the following code fails:

if [ "$VIRTUALSERVER_ACTION" = "DBPASS_DOMAIN" ]; then
  if [ $VIRTUALSERVER_PASS != $VIRTUALSERVER_OLDSERVER_PASS ]; then
    custom_script_that_updates_client_applications_passwords_here
  fi
fi

because both $VIRTUALSERVER_PASS and $VIRTUALSERVER_OLDSERVER_PASS are equal to the old password. I believe the variable $VIRTUALSERVER_PASS should contain the new custom password set and to me this is a bug.

Thanks for consideration to correct this.

Status: 
Closed (works as designed)

Comments

Assigned: Unassigned »

Try VIRTUALSERVER_MYSQL_PASS instead of VIRTUALSERVER_PASS. That's what will change if you just update the database password.

Try VIRTUALSERVER_MYSQL_PASS instead of VIRTUALSERVER_PASS. That's what will change if you just update the database password.

Works like a charm, thanks!