yggdrasil Posted February 6, 2018 Share Posted February 6, 2018 In the past, I reported hooks not working for WHMCS and its over a year and it seems they are still not fixed. Like for example the hook AfterRegistrarSaveNameservers which never worked for me. (does not fire) But today I was trying to use the AfterRegistrarRegistration hook and while this hook at least does fire and gets executed I noticed that no parameters work here. I just get blanks !!! In the documentation it says: https://developers.whmcs.com/hooks-reference/registrar-module/#afterregistrarregistration They are available as params in an array and they point to the following link: http://developers.whmcs.com/domain-registrars/module-parameters/ Now, here comes the first strange part. The hooks, all of them use $vars, not $params which is used in modules, maybe this is a typo in the docs and they refer to vars the. Either way I tried both. This does not work: $domain = $vars['domainid']; No $vars work for me at all. So I tried using the params from modules (as per WHMCS docs) and it does not work either: $domain = $params['domainid']; I did tried changing the hook as well to use $params Original: add_hook('AfterRegistrarRegistration', 1, function($vars) I tried as well: add_hook('AfterRegistrarRegistration', 10, function($params) I still get blanks. I searched the forums before posting this and found this (no solution): https://whmcs.community/topic/106849-actionhook-afterregistrarregistration/ https://whmcs.community/topic/183073-params-in-afterregistrarregistration-hook/?tab=comments#comment-893361 https://whmcs.community/topic/185917-afterregistrarregistration-not-working/?tab=comments#comment-903713 Those posts are from 2013 !!! Now I'm worried. Has WHMCS still not fixed this hook either? Or how exactly do I use the parameters to get some basic data like the domain and domain ID. Link to comment Share on other sites More sharing options...
yggdrasil Posted February 6, 2018 Author Share Posted February 6, 2018 (edited) SOLVED after finding this post: It seems these particular hook require a bit different approach for the parameters. For example: $domainid = $vars['params']['domainid']; I hope this helps anyone else looking this Edited February 6, 2018 by yggdrasil Link to comment Share on other sites More sharing options...
alturic Posted February 7, 2018 Share Posted February 7, 2018 Don't feel bad, sometime around 7.2-7.3 ValidateLogin was broke and no longer creates sessions. The best part, the passwordHash that's returned doesn't mean anything and can't be used to set the $_SESSION['upw'] either. Link to comment Share on other sites More sharing options...
Recommended Posts