I have set up a hook to assign a group to new contacts when they are created. I have set it up the old-fashioned way, ie with a function called joomla_civicrm_post in a file called civicrmHooks.php in the php override directory. But the function is called every time the master cron job fires, whereas I expected/wanted it to be called when a new contact is created. Have I missed something obvious? Should this work? Or do I have to implement the hook as a Joomla plugin in order to get it to trigger correctly? Thanks.
Joomla 3.6.5, CiviCRM 4.7.16, php 5.6.30