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.

Custom POST variables in scripts/standardized WHM Hooks

Discussion in 'cPanel Developers' started by pijulius, Jan 10, 2012.

  1. pijulius

    pijulius Member

    Joined:
    Jan 31, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi Guys,

    I read as much as I could about hooks in whm and specially I would need to add my own hook after an account has been created.

    It was very easy to set up a post script hook by simply creating the
    Code:
    /usr/local/cpanel/scripts/postwwwacct
    file and this works perfectly but now here is the problem I'm facing:

    I have some custom input fields in the
    Code:
    /local/cpanel/whostmgr/docroot/templates/createacct.tmpl
    file and I would need to access those input values from the hook script but unfortunately the only variables that get forwarded to the hook script are:
    cPanel & WHM Script Hooks

    I also saw that there are Standardized Hooks but unfortunately we only have WHM 11.30 and the standardized hooks have been only introduced in 11.32 so I can't test that too so my question would be:

    Can I access custom POST variables from a script or standardized hook and if so what would be the best way to do it.

    Thanks in advance!
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. pijulius

    pijulius Member

    Joined:
    Jan 31, 2009
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Yes, I think it is. The two topics don't really have anything to do with eachother. One is to add custom fields to a template without modifying the template and the other is about using those custom fields from a hook. I managed to do the first by modifying the template (as I haven't found any way to set the custom_fields from outside the template file let say from another hook or API) but now even if I have my fields set into the template file I can't access them from the hooks so I think this is a totally different matter/question.

     
Loading...

Share This Page