The main is to verify that the domain name's registrant mailbox is in the user-verified mailbox.
Use the third-party interface.
will be a bit slow, plus one in progress ... Load diagram.
Front Code:
Function Verifydomain (val) {
var ajaxurl = app_root+ "/index.php?ctl=uc_domainapply&act=verify";
var query = new Object ();
Query.flag = 1;
Query.fhash = __hash_key__;
Query.domain = val;
$.ajax ({
Url:ajaxurl,
DataType: "JSON",
Data:query,
Type: "POST",
Beforesend:function () {
$.showsuccess (
' <span> in Progress ......</span> '
);
},
Success:function (ajaxobj) {
if (ajaxobj.status==0)
{
$.showsuccess (Ajaxobj.info,function () {
if (ajaxobj.jump! = ")
Location.href = Ajaxobj.jump;
Else
Location.reload ();
});
}
Else
{
$.showerr (Ajaxobj.info, function () {
if (ajaxobj.jump! = ")
Location.href = Ajaxobj.jump;
Else
Location.reload ();
});
}
},
Error:function (Ajaxobj)
{
Alert ("Error");
}
});
}
</script>
--------
Background code:
function Verify () {
$this->check_hash_key ();
$domain = Strim ($_request[' domain ');
if ($domain = = "") {
$data = Array (' status ' =-2, ' info ' = ' = ' please pass in the domain name! ", ' jump ' =" ");
Ajax_return ($data);
}
Require_once App_root_path. " System/phpwhois/whois.main.php ";
$whois = new Whois ();
$result = $whois->lookup ($domain);
foreach ($result [' RawData '] as $tmp) {
if (Strpos ($tmp, "Egistrant Email")) {
$arr = Explode ("Registrant Email:", $tmp);
}
}
$sql 3 = "SELECT * from". Db_prefix. " C_whois_email where user_id = ". $GLOBALS [' User_info '] [' ID ']." and flag = 1 and email = ' ". Trim ($arr [1])." ' ";
$db _whois = $GLOBALS [' db ']->getrow ($sql 3);
if ($db _whois) {
//
$domain _id = $this->get_domain_id ($domain);
$sql 4 = "Update". Db_prefix. " C_user_domain Set flag = 1 WHERE user_id = ". $GLOBALS [' User_info '] [' ID ']." and domain_id = ". $domain _id;
if ($GLOBALS [' DB ']->query ($sql 4)} {
$data = Array (' status ' = = 2, ' info ' = ' = ' Verify success! ", ' jump ' =" ");
Ajax_return ($data);
}else{
$data = Array (' status ' = + -3, ' info ' = ' = ' validation succeeded but database write failed, please contact customer service! " . $DB _whois[' id ']. "--" . $sql 4, ' jump ' = ' "");
Ajax_return ($data);
}
}else {
$data = Array (' status ' = = 2, ' info ' = ' = ' validation failed! ", ' jump ' =" ");
Ajax_return ($data);
}
}
Verify that the domain name is the domain name of the user