glenn Posted March 11, 2021 Share Posted March 11, 2021 Some domain extensions don't support "registrar locking". When a client tries to enable registrar lock on such domain name, he's greeted with following error message: "An issue was encountered while updating the domain lock status. Please contact support." I would prefer not to show the "registrar lock" option for such domain names. I don't think there is an option in WHMCS to do so. In the config domains page, we can only enable / disable DNS Management, Email Forwarding, ID Protection and EPP Code. If it's not possible to configure this directly in the WHMCS admin, would it be possible to implement the display of "registrar lock" through a hook? 0 Quote Link to comment Share on other sites More sharing options...
Plambee Posted March 11, 2021 Share Posted March 11, 2021 There has long been a feature request for this, which has been ignored until now. https://requests.whmcs.com/topic/option-for-registrar-lock 1 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 11, 2021 Share Posted March 11, 2021 5 hours ago, glenn said: "An issue was encountered while updating the domain lock status. Please contact support." I know not the point of your post, but that error message could be changed using Language Overrides. 5 hours ago, glenn said: I would prefer not to show the "registrar lock" option for such domain names. I don't think there is an option in WHMCS to do so. In the config domains page, we can only enable / disable DNS Management, Email Forwarding, ID Protection and EPP Code. I think it tends to be the registrar module that determines when the lock option is shown (or even if the feature is supported). 5 hours ago, glenn said: If it's not possible to configure this directly in the WHMCS admin, would it be possible to implement the display of "registrar lock" through a hook? I assume you mean the opposite, e.g to disable the display if the TLD is in an excluded list (or not in an included list) - though I think an excluded list would be shorter. that sounds like a ClientAreaPageDomainDetails hook that takes the current domain, splits it into two to get the sld/tld separately and then checks that TLD against a list... if a match, then it falsifies $managementoptions.locking - that should prevent the normal link being shown to the user... additionally, you might need another hook to remove the sidebar option. 1 Quote Link to comment Share on other sites More sharing options...
glenn Posted March 13, 2021 Author Share Posted March 13, 2021 On 3/11/2021 at 1:33 PM, brian! said: I know not the point of your post, but that error message could be changed using Language Overrides. That's probably how we are going to "fix" it indeed. On 3/11/2021 at 1:33 PM, brian! said: I think it tends to be the registrar module that determines when the lock option is shown (or even if the feature is supported). Are you sure? I got the idea the option is ALWAYS shown, for each domain extension. On 3/11/2021 at 1:33 PM, brian! said: that sounds like a ClientAreaPageDomainDetails hook that takes the current domain, splits it into two to get the sld/tld separately and then checks that TLD against a list... if a match, then it falsifies $managementoptions.locking - that should prevent the normal link being shown to the user... additionally, you might need another hook to remove the sidebar option. Thanks, but that sounds quite complicated for something which should be built-in in WHMCS 😞 I really hope WHMCS takes this into consideration as we've got quite a few clients contacting us about it. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 14, 2021 Share Posted March 14, 2021 16 hours ago, glenn said: Are you sure? I wouldn't bet my life on it, but i'm fairly sure... 🙂 https://docs.whmcs.com/Domains_Management#Viewing.2FEditing_Locking_Status Quote Viewing/Editing Locking Status Similarly, if the domain's registrar module supports domain locking and unlocking, a Registrar Lock field will appear along with the nameserver fields on the domains management page. Checking or unchecking the box and saving will submit that change to the domain registrar as well. 16 hours ago, glenn said: I got the idea the option is ALWAYS shown, for each domain extension. that's definitely not the case - for example, it isn't shown for .uk domains for me because the Nominet module doesn't support it... if a domain isn't assigned to any registrar, or the registrar it is assigned to doesn't support registrar locking, then I think the lock option will not be shown. so your issue is that the registrar supports the locking feature, but is assuming that all TLDs are available for locking. 17 hours ago, glenn said: Thanks, but that sounds quite complicated for something which should be built-in in WHMCS 😞 if only this had been posted about five years ago... 🙂 ... which, if you update that hook for recent versions of WHMCS, becomes... <?php # Regitrar Lock Filter Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $domain = Menu::context('domain'); $blockedtlds = array('eu','nl'); if (in_array($domain->tld, $blockedtlds) && !is_null($primarySidebar->getChild('Domain Details Management'))) { $primarySidebar->getChild('Domain Details Management')->removeChild('Registrar Lock Status'); function domain_registrar_lock_link_removal_hook($vars) { $managementoptions = $vars['managementoptions']; $managementoptions['locking'] = false; return array ("managementoptions" => $managementoptions); } add_hook("ClientAreaPageDomainDetails",1,"domain_registrar_lock_link_removal_hook"); } }); this should, for the TLDs listed in the $blocktlds array, remove the two registrar locking links in the red boxes... 17 hours ago, glenn said: I really hope WHMCS takes this into consideration as we've got quite a few clients contacting us about it. you could die of old age waiting for WHMCS to do something. 👴 there is a feature request to add this option to domain pricing - 2 years, 18 votes... as with all FR, they could be added in the next release, or you could wait another 5 years and find that it's still not implemented. 1 Quote Link to comment Share on other sites More sharing options...
glenn Posted March 14, 2021 Author Share Posted March 14, 2021 24 minutes ago, brian! said: I wouldn't bet my life on it, but i'm fairly sure... 🙂 https://docs.whmcs.com/Domains_Management#Viewing.2FEditing_Locking_Status I'm using the Domainbox registrar module, but it hasn't been updated since quite some time. So maybe they didn't implement the locking status in the module. 26 minutes ago, brian! said: ... which, if you update that hook for recent versions of WHMCS, becomes... Oooh nice, that seems do to the trick indeed. The only thing still being shown is the following warning for such domains: Domain Currently Unlocked! You should enable the registrar lock unless you are transferring the domain. Any chance to disable this as well in the hook? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 14, 2021 Share Posted March 14, 2021 1 hour ago, glenn said: The only thing still being shown is the following warning for such domains: Domain Currently Unlocked! You should enable the registrar lock unless you are transferring the domain. Any chance to disable this as well in the hook? that output is defined in the template based on the value of $lockstatus - the tweaked hook below (it's just returning a value for $lockstatus) should prevent it from showing... <?php # Regitrar Lock Filter Hook # Written by brian! use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $domain = Menu::context('domain'); $blockedtlds = array('eu','nl'); if (in_array($domain->tld, $blockedtlds) && !is_null($primarySidebar->getChild('Domain Details Management'))) { $primarySidebar->getChild('Domain Details Management')->removeChild('Registrar Lock Status'); function domain_registrar_lock_link_removal_hook($vars) { $managementoptions = $vars['managementoptions']; $managementoptions['locking'] = false; return array ("managementoptions" => $managementoptions, "lockstatus" => "locked"); } add_hook("ClientAreaPageDomainDetails",1,"domain_registrar_lock_link_removal_hook"); } }); 1 Quote Link to comment Share on other sites More sharing options...
glenn Posted March 15, 2021 Author Share Posted March 15, 2021 17 hours ago, brian! said: that output is defined in the template based on the value of $lockstatus - the tweaked hook below (it's just returning a value for $lockstatus) should prevent it from showing... Thanks man, working perfectly! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.