The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'cPanel Developers' started by cpuden, Jul 19, 2011.

  1. cpuden

    cpuden Member

    Joined:
    Jun 9, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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
     
  3. cpuden

    cpuden Member

    Joined:
    Jun 9, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  4. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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
     
  5. cpuden

    cpuden Member

    Joined:
    Jun 9, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    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*
     
  6. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    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
     
  7. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,472
    Likes Received:
    200
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    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:

    Add in some very smart cPanelDavidN for good measure:

    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
     
  8. cpuden

    cpuden Member

    Joined:
    Jun 9, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
Loading...

Share This Page