hazardpro Posted August 27, 2017 Share Posted August 27, 2017 Hi, Im having a issue where the following does not seem to have any effect in my configuration.php file: $DomainRenewalGracePeriods = array(".com"=>"89",".net"=>"89",".biz"=>"89",".info"=>"89",".name"=>"89",".eu"=>"89",".org"=>"89"); $DomainRenewalGracePeriods = array(".co.uk"=>"89",".me.uk"=>"89",".org.uk"=>"89",".uk"=>"89"); $DomainRenewalMinimums = array(".co.uk"=>"364",".me.uk"=>"364",".org.uk"=>"364",".uk"=>"864"); $DomainRenewalMinimums = array(".com"=>"364",".net"=>"364",".biz"=>"364",".info"=>"364",".name"=>"364",".eu"=>"364",".org"=>"364"); running version 7.2 H 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 27, 2017 Share Posted August 27, 2017 it's always been a flaky function that sometimes works depending on which version you're using... as I think i've said previously, i'm not convinced it's working in v7.2.3 0 Quote Link to comment Share on other sites More sharing options...
hazardpro Posted August 27, 2017 Author Share Posted August 27, 2017 Thats disappointing, hopefully someone at WHMCS can clarify? H 0 Quote Link to comment Share on other sites More sharing options...
hazardpro Posted September 3, 2017 Author Share Posted September 3, 2017 Any WHMCS people reading this? Can I have some clarification please? H 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 3, 2017 Share Posted September 3, 2017 Any WHMCS people reading this? Can I have some clarification please? best guarantee to get a response from WHMCS would be by a support ticket... you might strike lucky and get a reply here, but it's been a week already. https://forum.whmcs.com/showthread.php?110754-Domain-renewal-grace-periods-not-working https://forums.whmcs.com/showthread.php?115882-DomainMinLengthRestrictions-not-working-with-newgtld if you open a ticket and they admit there is a problem, then it may get fixed in the next v7.3 beta... but frankly, it's not a feature I would ever trust to work and you might find it easier to use alternative solutions... certainly with the renewal page you could use a hook/template code to limit the renewal periods for TLDs. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted September 4, 2017 WHMCS Developer Share Posted September 4, 2017 If you have all of these lines in your configuration.php file, only 1/2 of them are going to apply as you are redefining the same variable twice. 1. $DomainRenewalGracePeriods = array(".com"=>"89",".net"=>"89",".biz"=>"89",".inf o"=>"89",".name"=>"89",".eu"=>"89",".org"=>"89" ); 2. $DomainRenewalGracePeriods = array(".co.uk"=>"89",".me.uk"=>"89",".org.uk"=>"89 ",".uk"=>"89"); 3. $DomainRenewalMinimums = array(".co.uk"=>"364",".me.uk"=>"364",".org.uk"=>" 364",".uk"=>"864"); 4. $DomainRenewalMinimums = array(".com"=>"364",".net"=>"364",".biz"=>"364",". info"=>"364",".name"=>"364",".eu"=>"364",".org"=>" 364"); So, in the above example, line 1 will be replaced by line 2 so only the options in line 2 would work. The same thing with lines 3 and 4. If you want to separate the options for easy reading, then add them separately: $DomainRenewalGracePeriods = []; $DomainRenewalGracePeriods['.com'] = 89; $DomainRenewalGracePeriods['.net'] = 89; $DomainRenewalGracePeriods['.biz'] = 89; $DomainRenewalGracePeriods['.info'] = 89; $DomainRenewalGracePeriods['.eu'] = 89; $DomainRenewalGracePeriods['.org'] = 89; $DomainRenewalGracePeriods['.co.uk'] = 89; $DomainRenewalGracePeriods['.me.uk'] = 89; $DomainRenewalGracePeriods['.org.uk'] = 89; $DomainRenewalGracePeriods['.uk'] = 89; The same thing could be done for $DomainRenewalMinimums I have tested this on my own installation of WHMCS and the options are working as expected. 0 Quote Link to comment Share on other sites More sharing options...
hazardpro Posted September 4, 2017 Author Share Posted September 4, 2017 Excellent thanks - so this should work? $DomainRenewalGracePeriods = []; $DomainRenewalGracePeriods['.com'] = 89; $DomainRenewalGracePeriods['.net'] = 89; $DomainRenewalGracePeriods['.biz'] = 89; $DomainRenewalGracePeriods['.info'] = 89; $DomainRenewalGracePeriods['.eu'] = 89; $DomainRenewalGracePeriods['.org'] = 89; $DomainRenewalGracePeriods['.co.uk'] = 89; $DomainRenewalGracePeriods['.me.uk'] = 89; $DomainRenewalGracePeriods['.org.uk'] = 89; $DomainRenewalGracePeriods['.uk'] = 89; $DomainRenewalMinimums ['.co.uk'] = 364; $DomainRenewalMinimums ['.org.uk'] = 364; $DomainRenewalMinimums ['.uk'] = 364; $DomainRenewalMinimums ['.com'] = 364; $DomainRenewalMinimums ['.net'] = 364; $DomainRenewalMinimums ['.biz'] = 364; $DomainRenewalMinimums ['.info'] = 364; $DomainRenewalMinimums ['.name'] = 364; $DomainRenewalMinimums ['.eu'] = 364; $DomainRenewalMinimums ['.org'] = 364; My file doesnt seem to like the first line: $DomainRenewalGracePeriods = []; Or should that be removed? Ill give this a try now. H 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted September 4, 2017 WHMCS Developer Share Posted September 4, 2017 You can change the line $DomainRenewalGracePeriods = []; to $DomainRenewalGracePeriods = array(); You also need to define $DomainRenewalMinimums = array(); before using them for the first time: $DomainRenewalGracePeriods = array(); $DomainRenewalGracePeriods['.com'] = 89; $DomainRenewalGracePeriods['.net'] = 89; $DomainRenewalGracePeriods['.biz'] = 89; $DomainRenewalGracePeriods['.info'] = 89; $DomainRenewalGracePeriods['.eu'] = 89; $DomainRenewalGracePeriods['.org'] = 89; $DomainRenewalGracePeriods['.co.uk'] = 89; $DomainRenewalGracePeriods['.me.uk'] = 89; $DomainRenewalGracePeriods['.org.uk'] = 89; $DomainRenewalGracePeriods['.uk'] = 89; $DomainRenewalMinimums = array(); $DomainRenewalMinimums ['.co.uk'] = 364; $DomainRenewalMinimums ['.org.uk'] = 364; $DomainRenewalMinimums ['.uk'] = 364; $DomainRenewalMinimums ['.com'] = 364; $DomainRenewalMinimums ['.net'] = 364; $DomainRenewalMinimums ['.biz'] = 364; $DomainRenewalMinimums ['.info'] = 364; $DomainRenewalMinimums ['.name'] = 364; $DomainRenewalMinimums ['.eu'] = 364; $DomainRenewalMinimums ['.org'] = 364; 0 Quote Link to comment Share on other sites More sharing options...
hazardpro Posted September 4, 2017 Author Share Posted September 4, 2017 Works like a charm - thank you very much for you help 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 4, 2017 Share Posted September 4, 2017 i'm still not convinced that this works... so in my v7.2.3 configuration file, i've got... $DomainRenewalMinimums = array(); $DomainRenewalMinimums ['.com'] = 364; so logically, that should prevent the user from renewing a .com until at least 1 year before expiry... yet in the client area, they still can... now I could change that figure of 364 to 100 or 1000 and it wouldn't make any difference - the client can still renew the domain regardless of these settings. am I missing something here, or misinterpreting what the feature is for ?? 0 Quote Link to comment Share on other sites More sharing options...
hazardpro Posted September 4, 2017 Author Share Posted September 4, 2017 I has worked just like that for me - if I adjust the figure in the config file I can see it adjust for the customer. Ive only tested it for DomainRenewalMinimums, but it seems to work ok for me. 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Developer WHMCS Andrew Posted September 4, 2017 WHMCS Developer Share Posted September 4, 2017 The DomainRenewalMinimums setting is the number of days before renewal that a renewal is allowed. If you set 364, then you are allowing a renewal 364 days before the next renewal. So, I have a test domain with an expiry dates of 15th August 2018. This is 345 days in the future. With the following the configuration.php file: $DomainRenewalMinimums['.com'] = 364; I then update this to: $DomainRenewalMinimums['.com'] = 344; 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted September 4, 2017 Share Posted September 4, 2017 jeez - it might have helped if I had changed the file permissions on the configuration file from 400 first ! $DomainRenewalMinimums ['.com'] = 200; using this format, even $DomainMinLengthRestrictions works... up to a point! $DomainMinLengthRestrictions = array(); $DomainMinLengthRestrictions[".actor"] = 15; it prevents the ordering, but shows an unhelpful error message - "Domains must begin with a letter or a number"... even though it does start with a letter. if you specify both custom minimums AND maximums (or it uses a default for one), then you can get a semi-appropriate error message... .. i'd be inclined to call that output a bug (or in WHMCS jargon - the output needs clarifying based on the error that causes it) - I could probably tweak it in the language strings, js and/or template - but I think it needs looking at by WHMCS... it's starting with a letter or number, it's just breaking the length requirements and only needs to say "{$tld} domains must be between <span class="min-length"></span> and <span class="max-length"></span> characters in length" or something along those lines... 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.