Add a new field to account creation page for use with post account creation script

I wanted to be able to add a field during account creation, something like an id so when that account gets created a post_account creation script can be run and that id can be sent along to a remote server.

Staff Member

Re: Add a new field to account creation page for use with post account creation scrip

That's correct. Account creation cannot be extended.

It seems that most people create their own custom account creation script/form (which is served by a billing application/system, or simply an internal webserver) which:
1) gathers all the needed info in a form, from a database, etc.
2) uses cPanel's XML/JSON API to request a new account be created (with the info that cPanel needs)
3) if the API call returns with a successfully status, then prepare and execute requests to the other system (using the rest of the info initially gathered).

Re: Add a new field to account creation page for use with post account creation scrip

So, in the case where reseller creates an account, I would either have to periodically query for the accounts and see which ones I don't have in my system, or when that account is created match up the username that created the account to an account in my billing system. Why is that that the account creation can't be extended?

I also just did a cursory look for the form that the cpanel account creation page seems to post to, but no dice. If this is not a file, where is it then? Will any modifications to these pages I make be overwritten by updates that cpanel does? I was thinking I could run tripwire to keep a track of any files I modify that then get modified by system updates.

Staff Member

Re: Add a new field to account creation page for use with post account creation scrip

cpuden,

You won't find those form pages or functions. They are compiled into the WHM binary, and therefore you can't modify them. And even IF you could, the changes would be overwritten during the update process (and you'd be response for re-applying your changes, as you've alluded to).

The ability to pass through arbitrary variables from Account Creation to the script hook system is a feature that must be implemented at the core of cPanel & WHM.

Staff Member

Re: Add a new field to account creation page for use with post account creation scrip

I wonder if this might well be Feature Request worthy? Granted, I'm not sure I fully understand the OP's needs (I had a few minutes to kill thinking on this) but, if I take his words out of context a bit:

..something like an id so when that account gets created a post_account creation script can be run..

Our script hook is now complete. If we place it in the /scripts directory and name it postwwwacct and set execution bits, it will execute each time an account is created.

Click to expand...

What if for some reason you wanted to have multiple functions in postwwwacct script to choose from?

What if postwwwacct contained multiple functions within and each one had an ID that could be called by itself or all or none?

If that was possible and you had an area to type in an ID variable on account creation that was seen as 'hey, theres a postwwwacct script sitting in here, lets go look and find an ID if we can or just run script'

I'm well out of my realm here, just thinking out loud. Your answer will make me smarter. :p