Jump to content

Approval and notifications for transfers and nameserver updates


JackRabbit

Recommended Posts

Is it possible to approve a domain name transfer before the transfer takes place? Or approve domain unlocks?

Also is it possible to receive notifications when a nameserver is updated?

The problem I'm having is that I offer free domains and a $1 hosting trial as a promotion to sign up. A few people are signing up, transferring their domains and canceling right away to get a free domain which is costing me money. I have a policy that if they use the free domain coupon, in order to move their domain, they need to pay for one full month of hosting or pay for their domain but I have no way of enforcing that at the moment.

 

Link to comment
Share on other sites

4 hours ago, JackRabbit said:

Is it possible to approve a domain name transfer before the transfer takes place?

it might be registrar-dependant and available outside of WHMCS... certainly, OpenSRS has the option (on it's registrar site) to not automatically accept incoming transfers... doubt you can do the same with outgoing (which I assume is your main concern).

4 hours ago, JackRabbit said:

Also is it possible to receive notifications when a nameserver is updated?

not built-in - you'd have to code it... and that's assuming they change it in WHMCS... if they can change it at the registrar's site, that's another matter.

4 hours ago, JackRabbit said:

The problem I'm having is that I offer free domains and a $1 hosting trial as a promotion to sign up. A few people are signing up, transferring their domains and cancelling right away to get a free domain which is costing me money. I have a policy that if they use the free domain coupon, in order to move their domain, they need to pay for one full month of hosting or pay for their domain but I have no way of enforcing that at the moment.

by default, all our non-.uk domains are locked (when applicable) automatically at the time of registration... if you can do that with your registrar, and then alter the client area pages with conditionals... e.g if less than x days after registration, hide the registrar lock / ns children in the sidebar and, as added insurance (in case they use a direct link), do the same in the template... that makes it difficult for the client to unlock and/or change dns.

you're probably looking at hooks for both - certainly one to remove the relevant sidebar children (if they exist in your theme), and the other to calculate the time between today and the registration and/or expiry dates... you could do that in the template if necessary using accessible variables, but I might be tempted to do it in PHP... though I suppose you'd have to edit the template anyway to add the conditional if statement in.

but the exact requirement will depend upon your client area template and what it does, and doesn't show as available features, to the client.

just had to post this while it was fresh in my head... I can now return to my day off... :399_birthday:

Link to comment
Share on other sites

  • 2 years later...

This was such a long time ago and I'm finally going to add this. I'm not a coder, so I'm a little confused.

I want to create a hook that says: 

If  client has less than 2 invoices paid, hide "Registrar Lock" from the sidebar on the domain overview page. 

I'm trying to use this for help:
https://docs.whmcs.com/Client_Area_Sidebars_Cheatsheet

I'll use this code example:

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
    if(!is_null($primarySidebar->getChild('My Account')) && !is_null($primarySidebar->getChild('My Account')->getChild('Billing Information'))){
    $primarySidebar->getChild('My Account')->removeChild('Billing Information');
    }
});

But how can I add  the  variable $clientstats.numpaidinvoices to the php?  I've been  trying several variations without luck.

Link to comment
Share on other sites

36 minutes ago, JackRabbit said:

But how can I add  the  variable $clientstats.numpaidinvoices to the php?

if you're going down the road of using $clientsstats values, then it should be...

	GLOBAL $smarty;
	$paidinvoices = $smarty->getTemplateVars()['clientsstats']['numpaidinvoices'];

but perhaps a cleaner way would be to use the $client context instead of GLOBAL $smarty - which allows you to check that they're logged in (e.g a client) before attempting to get the client variables...

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) {
	
	$client = Menu::context('client');
	if ($client) {
		$paidinvoices = $client->invoices->where('status','Paid')->count();
		if ($paidinvoices < 2 && !is_null($primarySidebar->getChild('Domain Details Management')) && !is_null($primarySidebar->getChild('Domain Details Management')->getChild('Registrar Lock Status'))){
			$primarySidebar->getChild('Domain Details Management')->removeChild('Registrar Lock Status');
		}
	}
});

the count values should be the same between the two methods.... there are other methods, but either of the above two should be the simplest for your situation.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated