Skip to content

Instantly share code, notes, and snippets.

@papakai

papakai/hooks.php

Last active Sep 22, 2020
Embed
What would you like to do?
HEXONET / ISPAPI DNS Templates after Registration or Transfer for WHMCS Registrar Module
<?php
function ispapi_autoUpdateDNS($vars){
$params = $vars["params"];
if (!$params["dnsmanagement"]){
return;
}
$rrs = ispapi_GetDNS($params);
foreach(["@", "mail", "webmail", "www"] as $h){
$rrs[] = [
"hostname" => $h,
"type" => "A",
"address" => "...ip-address here..."
];
}
$params["dnsrecords"] = $params["original"]["dnsrecords"] = $rrs;
ispapi_SaveDNS($params);
}
add_hook('AfterRegistrarRegistration', 1, ispapi_autoUpdateDNS);
add_hook('AfterRegistrarTransfer', 1, ispapi_autoUpdateDNS);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment