cPanel & WHM Version 94 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Enable hook (checkbox or radio button) via the Create a New Account menu

Pavel Nikolaev shared this idea 4 years ago
Open Discussion

Hello,

My idea is to have the option/possibility to enable given hooks via the menu where you create new accounts in the WHM (Home >> Account Functions >> Create A New Account). For example you can choose a given hook related to the Accounts Creation process (--category Whostmgr --event Accounts::Create --stage post). The idea is that a given hook may not be usable for all the time and all the cases.

Thank you.

Comments (2)

photo
1

Thanks for submitting this! To clarify for anyone else reading this request: If the hook in the example were to be registered on the server in our currently supported way, the hook would be run for every account created.


Currently most admins I've encountered write their hooks such that they exit without making any changes in the event that certain conditions are met. Most often this means that the logic in the script is something like: if the account's package is one, two, or three, then do this action. Else if it's four, five, or other, exit.


For this reason, and because of the way the hook system is built, it's unlikely that we'd add this feature without significant support from the community. I'd definitely be interested in hearing any other solutions or ideas.

photo
1

Hello,

Thank you for the comment above. I totally agree that in a certain scenarios you can link the main logic of the hook with the package as you said (for example: if the account package is preinstalled_wordpress install custom wordpress, otherwise do nothing). I thought that giving the option to enable a post account creation hook could simplify the process and the idea. In that case you will not be forced to link the main hook logic with a certain condition during the process of creating an account.

Considering this now I realize that most probably this idea will create a mess in the Create a New Account menu. One will have to deal with a lot of hooks in the menu which will be exactly opposite to the idea of Standardized Hook System - system for experienced administrators or developers.

Thank you.

Leave a Comment
 
Attach a file