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.

newftpuser hook

Discussion in 'General Discussion' started by rapidot, Jul 27, 2007.

  1. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    I am trying to run a script upon a new FTP user creation. There are no hooks for this from my understanding.

    Does anyone know what the script is that Cpanel uses to add a new FTP user?

    "/scripts/newftpuser" doesn't work.

    the x3 theme has some weird call to addftp() : &cpanel Ftp=&addftp($FORM{'login'},$FORM{'password'})& amp;& but I can't find addftp()


    I emailed tech support, and they were helpful, but couldn't find a specific file I can edit.

    Any ideas?

    Thanks in Advance!
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Typically hooks start with pre or post.
     
  3. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for your response. Is there a pre or post newftp user hook? And if not, Can you direct me to the perl.pm that creates the ftp user so that I can create my own hook?

    Thanks
     
  4. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    *bump*

    Does anybody know how cPanel creates addon FTP accounts? what perl script? I can't find it for the life of me. Looked in /scripts /usr/local/cpanel/bin /usr/local/cpanel/Cpanel

    Any ideas?
     
  5. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    check /usr/local/cpanel/hooks
     
  6. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    cpanelnick,

    Thanks for replying. I did check the hooks also, but it stated "Hooks only works for Api2 functions, and a few Api1". From my understanding adding new FTP users doesn't have an API2 call (from the list @ cpanel.net).

    Are the hooks a bit more documented elsewhere? Any other ideas?

    Thanks
     
  7. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
  8. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    kenneth,

    I have already been up and down the entire documentation that everyone continues to point me to. I have fgrep the entire cPanel directories looking for every piece of code that adds a new FTP. I have emailed cPanel support (Even though I do consider this outside their scope). I wouldn't come to the forums without due diligence to be redirected to the documentation.

    It is frustrating that I can't find someone who knows how cPanel adds subftp accounts. What file,function, whatever it is it calls so that I can tap into it if there are no hooks available (From the docs, it doesn't look like there is a hook available. PLEASE correct me if I'm wrong).
     
  9. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    I looked at the source for this module today and there are no hooks called.

    I added them for addftp,delftp and passwdftp

    You should be able to use them in 15829+
     
  10. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Awesome! Thank you very much!
     
  11. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    I was able to use the working example for change password off of /usr/local/cpanel/hooks last week.

    Is it giving you errors?
     
  12. dom974

    dom974 Active Member

    Joined:
    Jun 24, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    is there any update on the change password hook ?

    It seems it's not working properly ... If it does now, do you have a working example (not just the example code in /usr/local/cpanel/hooks)

    Thank you

    Dominique
     
  13. dom974

    dom974 Active Member

    Joined:
    Jun 24, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    nothing is happening with the hook example ...

    are you changing the password via cpanel, whm or xml-api ?

    dominique
     
  14. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    I changed it via cPanel. You can actually see the output when cPanel changes it (using x3). the XML-API should technically work too, but I don't think it will work on WHM
     
  15. dom974

    dom974 Active Member

    Joined:
    Jun 24, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    Update: it works nicely with Cpanel but not WHM nor with XML-API (unfortunately).

    Dominique
     
  16. rapidot

    rapidot Active Member

    Joined:
    Nov 15, 2004
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    cpanelnick,

    I created a /scripts/postaddftp but it doesn't seem to run at all?

    Using WHM 11.2.0 cPanel 11.8.0-C15921
     
Loading...

Share This Page