En/disabling features when changing a vserver plan

I'm currently trying to get WHMCS' automatic deployment features to play nice with Virtualmin. :)

WHMCS has an up-/downgrade feature for customers. In connection with Virtualmin, this is accomplished by assigning another template and plan to the vserver.

Now, if I wish to differentiate my WHMCS products by Virtualmin vserver features (i.e. a "mail only" product vs. "hosting" vs. "hosting with MySQL" etc.), I have a problem. Changing the vserver's plan does not en/disable the required features...

Would it be possible to add an API call, maybe a parameter to "modify-domain --appy-plan", to have the enabled features of the new plan be enabled in the vserver, and the rest disabled?

I think it would be way more feasible to do that here in Virtualmin, than having to send "enable-feature" / "disable-feature" API calls from WHMCS, forcing them to mirror the feature configuration.

Status: 
Closed (fixed)

Comments

So are you using templates to define the initial features, or plans? There is an --apply-plan flag to modify-domain , but it only applies plan limits .. it doesn't enable features. It sounds like what you really want is a --apply-template parameter?

Uuhm... I fear I'm at a loss here.

...How do I use templates again to specify the initially enabled features? :) I can't seem to find any list in there that would allow me to set the features to enable.

I was of the impression that only plans (or the defaults in the "Features and Plugins" page -- depending on a setting in "User interface settings") can be used to do that.

My mistake, it is the plan that specifies the features. I will add a flag to modify-domain to apply features from the new plan ... stay tuned.

Ok, Virtualmin 3.87 will add a --plan-features flag to modify-domain to set features based on those enabled for the current or new plan..

Two thumbs up for awesomeness! :)

I'll inform the WHMCS guys that they can add that switch. Could you maybe email me the files that need to be changed to admin AT tianet DOT de?

Got it, thanks! Will report later when the WHMCS people sent me their fix. :)

Quick feedback: Script works! :)

That's great, thanks for the update!