芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/portal.pulsehost.co.uk/admin/whois.php
title = $aInt->lang('whois','title'); $aInt->sidebar = "utilities"; $aInt->icon = "domains"; $aInt->requiredFiles(array("domainfunctions")); $action = App::getFromRequest('action'); if ($action=="checkavailability") { check_token('WHMCS.admin.default'); $whois = new WHOIS(); $result = $whois->lookup(array('sld' => $sld, 'tld' => $tld)); $whois->logLookup(); echo $result['result']; exit; } $code = ''; if ($domain = $whmcs->get_req_var('domain')) { check_token('WHMCS.admin.default'); $domains = new Domains(); /** * A space in a domain name is always invalid. Strip whitespace to * be sure the following method does not throw if a space is present. * * @see https://jira.whmcs.com/browse/CORE-16013 */ $domain = str_replace(' ', '', $domain); $domainparts = $domains->splitAndCleanDomainInput($domain); $isValid = $domains->checkDomainisValid($domainparts); if ($isValid) { $whois = new WHOIS(); if ($whois->canLookup($domainparts['tld'])) { $result = $whois->lookup($domainparts); $whois->logLookup(); if ($result['result'] == "available") { $code .= '
' . sprintf($aInt->lang('whois', 'available'), $domain) . '
'; } elseif ($result['result'] == "unavailable") { $code .= '
' . sprintf($aInt->lang('whois', 'unavailable'), $domain) . '
'; } else { $code .= '
' . $aInt->lang('whois', 'error') . '
' . '
' . $result['errordetail'] . '
'; } } else { $code .= '
' . sprintf($aInt->lang('whois', 'invalidtld'), $domainparts['tld']) . '
'; } } else { $code .= '
' . $aInt->lang('whois', 'invaliddomain') . '
'; } } $code = '
' . $code; $code .= '
'; $isUnavailable = false; if ($domain && $isValid && $result['result'] == 'unavailable') { $isUnavailable = true; $code .= '
' . $aInt->lang('whois', 'whois') . '
' . $result['whois'] . '
'; } $checker = new Checker(); if (!empty($domain)) { $suggestions = $checker->getLookupProvider()->getSuggestions((new Domain($domain))); if ($suggestions->count()) { $outputCount = 0; $class = 'col-md-12'; $columns = 4; $suggestionLimit = 52; if ($isUnavailable) { $class = 'col-md-6 col-sm-12'; $columns = 2; $suggestionLimit = 30; } $code .= '
' . AdminLang::trans('whois.suggestions') . '
' . '
'; /** @var Domains\DomainLookup\SearchResult $suggestion */ $count = 1; foreach ($suggestions as $suggestion) { if ($outputCount >= $suggestionLimit) { break; } if ($count > $columns) { $count = 1; $code .= '
'; } $label = $suggestion->getDomain(); if ($suggestion->group()) { $label .= ' ' . Helper::getDomainGroupLabel($suggestion->group()); } $code .= '
' . $label . '
'; $count++; $outputCount++; } $code .= '
'; } } $code .= '
'; $aInt->content = $code; $aInt->display();