Jump to content

AddonActivation Hook doesn't working


Recommended Posts

Hello,

 

I'm writing a hook that should be running every Addon Product Active, but seem "AddonActivation" doesn't work.

 

This is the simple code

 

<?php
   function append_file($filename,$newdata) {
     $f=fopen($filename,"a");
      fwrite($f,$newdata);
      fclose($f);  
    }

   function hook_addons_action_ative($vars){
      $addonHID = $vars['id'];
      $usersID = $vars['userid '];
      $serviceID = $vars['serviceid'];
      $addonID = $vars['addonid'];                    

       $files = dirname(__FILE__)."/abc.txt";
        $data = "Addon Actived == $addonHID --  $usersID -- $serviceID --- $addonID\n";
        append_file($files,$data);
    }

add_hook('AddonActivation',1,'hook_addons_action_ative');
?>

 

The abc.txt file alway empty with "AddonActivation" so I think that hook never called, but another hook "AddonEdit", "AddonSuspended", "AddonTerminated", "AddonCancelled", "AddonFraud" are fine.

 

Additional, the $var['id'] and $var['userid'] alway return null whatever hook called, doesn't like WHMCS documents said it must return values.

 

I using WHMCS v5.0.1

PHP 5.2.x

MySQL 5.0.x

 

Is this a bug ?

 

Best regards,

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

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

Guest
Reply to this topic...

×   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