mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-17 10:06:59 +02:00
Fix in CP domain:check
This commit is contained in:
parent
23d7886a85
commit
9a86d52c7c
1 changed files with 33 additions and 36 deletions
|
@ -38,7 +38,12 @@ class DomainsController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$domainName = preg_replace('/[^\p{L}0-9-.]/u', '', $domainName);
|
$invalid_domain = validate_label($domainName, $this->container->get('db'));
|
||||||
|
if ($invalid_domain) {
|
||||||
|
$this->container->get('flash')->addMessage('error', 'Domain ' . $domainName . ' is not available: ' . $invalid_domain);
|
||||||
|
return $response->withHeader('Location', '/domain/check')->withStatus(302);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$parts = extractDomainAndTLD($domainName);
|
$parts = extractDomainAndTLD($domainName);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
@ -53,8 +58,6 @@ class DomainsController extends Controller
|
||||||
// Convert the DB result into a boolean '0' or '1'
|
// Convert the DB result into a boolean '0' or '1'
|
||||||
$availability = $availability ? '0' : '1';
|
$availability = $availability ? '0' : '1';
|
||||||
|
|
||||||
$invalid_label = validate_label($domainName, $this->container->get('db'));
|
|
||||||
|
|
||||||
if (isset($claims)) {
|
if (isset($claims)) {
|
||||||
$claim_key = $this->container->get('db')->selectValue('SELECT claim_key FROM tmch_claims WHERE domain_label = ? LIMIT 1',[$parts['domain']]);
|
$claim_key = $this->container->get('db')->selectValue('SELECT claim_key FROM tmch_claims WHERE domain_label = ? LIMIT 1',[$parts['domain']]);
|
||||||
|
|
||||||
|
@ -67,11 +70,6 @@ class DomainsController extends Controller
|
||||||
$claim = 2;
|
$claim = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the domain is Invalid
|
|
||||||
if ($invalid_label) {
|
|
||||||
$this->container->get('flash')->addMessage('error', 'Domain ' . $domainName . ' is not available: ' . $invalid_label);
|
|
||||||
return $response->withHeader('Location', '/domain/check')->withStatus(302);
|
|
||||||
} else {
|
|
||||||
// If the domain is not taken, check if it's reserved
|
// If the domain is not taken, check if it's reserved
|
||||||
if ($availability === '1') {
|
if ($availability === '1') {
|
||||||
$domain_already_reserved = $this->container->get('db')->selectRow('SELECT id,type FROM reserved_domain_names WHERE name = ? LIMIT 1',[$parts['domain']]);
|
$domain_already_reserved = $this->container->get('db')->selectRow('SELECT id,type FROM reserved_domain_names WHERE name = ? LIMIT 1',[$parts['domain']]);
|
||||||
|
@ -109,7 +107,6 @@ class DomainsController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Default view for GET requests or if POST data is not set
|
// Default view for GET requests or if POST data is not set
|
||||||
return view($response,'admin/domains/checkDomain.twig');
|
return view($response,'admin/domains/checkDomain.twig');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue