Jump to content
  • 0

Module addon on activate hook




I am developing a small module that would create an additional FTP user with a directory dedicated this user. For the creation of the module, everything is fine. By cons, for hooks, I'm sure of nothing! I activated the addon after the creation of my hooks.php. I would like to know if I do the right thing. Here is the code:

add_hook('AddonActivated', 1, function($vars) {

   //Get Product/Service information to get domain and relid

    $command = 'GetClientsProducts';
    $postData = array(
        'serviceid' => $vars['serviceid'],
        'stats' => true,
    $service = localAPI($command, $postData);    

  //create FTP user (is OK this part)

  //Save to custom fields associate to the addon


1- Is this the correct hook to create my FTP when activating the addon?
2- Would there be a way to see what my print_r return?
3- What would be the best way to register the associated customs fields?


For more information, my addon is used to create an FTP user with a directory of his own to be able to deposit certain document without having access to anything else.




Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated