Add a new field to account creation page for use with post account creation script
Hi,
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.
Thanks,
Dennis O.
Re: Add a new field to account creation page for use with post account creation scrip
Hi Dennis,
At this time, there is not a way to pass custom variables (via CLI, XML/JSON API, or WHM's Create Account) during account creation.
If you like, I can move this thread to the Feature Requests forum so it can be cataloged and other's can vote on it?
Regards,
-DavidN
Re: Add a new field to account creation page for use with post account creation scrip
So I can't even pass new variables or create new text boxes on the account creation page in the gui so I can pass it to a post account creation script?
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).
Regards,
-DavidN
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.
root@cpanel03 [~]# find / -type f -name *wwwacctform*
root@cpanel03 [~]#
root@cpanel03 [~]# find / -type f -name *scripts5*
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.
Regards,
-DavidN
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:
Quote:
..something like an id so when that account gets created a post_account creation script can be run..
Add in some very smart cPanelDavidN for good measure:
Quote:
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.
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
Re: Add a new field to account creation page for use with post account creation scrip
Thanks for the answers and the thinking out loud you guys. Let me mull this response over before we close this thread during working hours.