Post account creation script only

1 post / 0 new
#1 Sat, 12/06/2014 - 08:09
nibb

Post account creation script only

Hi, I have a script that runs after an account was created with the function to run it after account creation with

CREATE_DOMAIN

https://www.virtualmin.com/documentation/developer/prepost

The problem I run with is that this action is also executed when the user ads an alias, extra domain, etc. Its basically not related to a new virtual account creation but any domain added to the user account.

This is giving me troubles since I only want the script to be executed on a new account creation, not when other domains are added. I have for example set Virtualmin to also create an alias domain on account creation, so the result is that Virtualmin is now executing this script twice on account creation as well. It executes it once the account domain is created and then immediately for the domain alias as well.

Is there another variable that can be used instead like CREATE_ACCOUNT which would only apply for account creation or new virtual account creations and not domains?

In the documentation it says this is used for new account creations but this is not actually true. Its also executed after accounts where created, when domains are added.