Jump to content
  • 0
Sign in to follow this  
mobbdeep

Block certain TLD's?

Question

Hello,

Is there a plugin out that allows certain TLD's from being a supported TLD when purchasing my web hosting service? For example, I want to block .tk TLD's from being supported.

Regards,

Tyler

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 1

i have tested the code now, you can use this regex

 

            'cpanel_domain' => [
                'format' => [
                    'rule' => [[$this, 'validateHostName']],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.format', true)
                ],
                'test' => [
                    'rule' => ['substr_compare', 'test', 0, 4, true],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.test', true)
                ],
                'block' => [
                    // 'if_set' => true,
                    'rule' => ['matches', '/^((?!.ga|.tk|.td|.cf).)*$/'],
                    'message' => 'this domain is not alowded'
                ],
            ],

 

Share this post


Link to post
Share on other sites
  • 0
9 hours ago, mobbdeep said:

Hello,

Is there a plugin out that allows certain TLD's from being a supported TLD when purchasing my web hosting service? For example, I want to block .tk TLD's from being supported. 

Regards,

Tyler

i think you are talking about hosting module not registrar module ?

 

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, mobbdeep said:

I am still needing an answer to this. I have been getting a mass influx of someone using .ga, .tk, and .cf TLD's to purchase my web hosting for fraudulent sites.

if you are using cpanel module, open the file /components/modules/cpanel/cpanel.php and  change the line from

            'cpanel_domain' => [
                'format' => [
                    'rule' => [[$this, 'validateHostName']],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.format', true)
                ],
                'test' => [
                    'rule' => ['substr_compare', 'test', 0, 4, true],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.test', true)
                ]
            ],

to

            'cpanel_domain' => [
                'format' => [
                    'rule' => [[$this, 'validateHostName']],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.format', true)
                ],
                'test' => [
                    'rule' => ['substr_compare', 'test', 0, 4, true],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.test', true)
                ],
                'block' => [
                    'if_set' => true,
                    'rule' => ['matches', '/(.ga|.tk|.td|.cf)/'],
                    'message' => 'this domain is not alowded'
                ],
            ],

not tested. but it might work

Share this post


Link to post
Share on other sites
  • 0
8 hours ago, Blesta Addons said:

if you are using cpanel module, open the file /components/modules/cpanel/cpanel.php and  change the line from


            'cpanel_domain' => [
                'format' => [
                    'rule' => [[$this, 'validateHostName']],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.format', true)
                ],
                'test' => [
                    'rule' => ['substr_compare', 'test', 0, 4, true],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.test', true)
                ]
            ],

to


            'cpanel_domain' => [
                'format' => [
                    'rule' => [[$this, 'validateHostName']],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.format', true)
                ],
                'test' => [
                    'rule' => ['substr_compare', 'test', 0, 4, true],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.test', true)
                ],
                'block' => [
                    'if_set' => true,
                    'rule' => ['matches', '/(.ga|.tk|.td|.cf)/'],
                    'message' => 'this domain is not alowded'
                ],
            ],

not tested. but it might work

This did not work. I can still choose any of those extensions and proceed onto the order form.

Share this post


Link to post
Share on other sites
  • 0
9 hours ago, Blesta Addons said:

i have tested the code now, you can use this regex

 


            'cpanel_domain' => [
                'format' => [
                    'rule' => [[$this, 'validateHostName']],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.format', true)
                ],
                'test' => [
                    'rule' => ['substr_compare', 'test', 0, 4, true],
                    'message' => Language::_('Cpanel.!error.cpanel_domain.test', true)
                ],
                'block' => [
                    // 'if_set' => true,
                    'rule' => ['matches', '/^((?!.ga|.tk|.td|.cf).)*$/'],
                    'message' => 'this domain is not alowded'
                ],
            ],

 

This worked. Thank you!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×