mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-15 17:16:59 +02:00
Housekeeping on domain and application registration
This commit is contained in:
parent
3171adc1b2
commit
52f4eab87d
2 changed files with 38 additions and 43 deletions
|
@ -1064,15 +1064,12 @@ class ApplicationsController extends Controller
|
||||||
|
|
||||||
$parts = extractDomainAndTLD($domainName);
|
$parts = extractDomainAndTLD($domainName);
|
||||||
$label = $parts['domain'];
|
$label = $parts['domain'];
|
||||||
$domain_extension = $parts['tld'];
|
$domain_extension = '.' . strtoupper($parts['tld']);
|
||||||
|
|
||||||
$result = $db->select('SELECT id, tld FROM domain_tld');
|
$tld_id = $db->selectValue(
|
||||||
foreach ($result as $row) {
|
"SELECT id FROM domain_tld WHERE UPPER(tld) = ?",
|
||||||
if ('.' . strtoupper($domain_extension) === strtoupper($row['tld'])) {
|
[$domain_extension]
|
||||||
$tld_id = $row['id'];
|
);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $db->selectRow('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
|
$result = $db->selectRow('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
|
||||||
|
|
||||||
|
|
|
@ -181,20 +181,14 @@ class DomainsController extends Controller
|
||||||
return $response->withHeader('Location', '/domain/create')->withStatus(302);
|
return $response->withHeader('Location', '/domain/create')->withStatus(302);
|
||||||
}
|
}
|
||||||
$label = $parts['domain'];
|
$label = $parts['domain'];
|
||||||
$domain_extension = $parts['tld'];
|
$domain_extension = '.' . strtoupper($parts['tld']);
|
||||||
|
|
||||||
$valid_tld = false;
|
$tld_id = $db->selectValue(
|
||||||
$result = $db->select('SELECT id, tld FROM domain_tld');
|
"SELECT id FROM domain_tld WHERE UPPER(tld) = ?",
|
||||||
|
[$domain_extension]
|
||||||
|
);
|
||||||
|
|
||||||
foreach ($result as $row) {
|
if (!$tld_id) {
|
||||||
if ('.' . strtoupper($domain_extension) === strtoupper($row['tld'])) {
|
|
||||||
$valid_tld = true;
|
|
||||||
$tld_id = $row['id'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$valid_tld) {
|
|
||||||
$this->container->get('flash')->addMessage('error', 'Error creating domain: Invalid domain extension');
|
$this->container->get('flash')->addMessage('error', 'Error creating domain: Invalid domain extension');
|
||||||
return $response->withHeader('Location', '/domain/create')->withStatus(302);
|
return $response->withHeader('Location', '/domain/create')->withStatus(302);
|
||||||
}
|
}
|
||||||
|
@ -216,13 +210,18 @@ class DomainsController extends Controller
|
||||||
"SELECT phase_category
|
"SELECT phase_category
|
||||||
FROM launch_phases
|
FROM launch_phases
|
||||||
WHERE tld_id = ?
|
WHERE tld_id = ?
|
||||||
AND phase_type = ?
|
|
||||||
AND start_date <= ?
|
AND start_date <= ?
|
||||||
AND (end_date >= ? OR end_date IS NULL OR end_date = '')
|
AND (end_date >= ? OR end_date IS NULL OR end_date = '')
|
||||||
",
|
",
|
||||||
[$tld_id, $phaseType, $currentDate, $currentDate]
|
[$tld_id, $currentDate, $currentDate]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Check if the phase requires application submission
|
||||||
|
if ($phase_details && $phase_details === 'Application') {
|
||||||
|
$this->container->get('flash')->addMessage('error', 'Domain registration is not allowed for this TLD. You must submit a new application instead.');
|
||||||
|
return $response->withHeader('Location', '/domain/create')->withStatus(302);
|
||||||
|
}
|
||||||
|
|
||||||
if ($phase_details !== 'First-Come-First-Serve') {
|
if ($phase_details !== 'First-Come-First-Serve') {
|
||||||
if ($phaseType !== 'none') {
|
if ($phaseType !== 'none') {
|
||||||
if ($phaseType == null && $phaseType == '') {
|
if ($phaseType == null && $phaseType == '') {
|
||||||
|
@ -1765,14 +1764,16 @@ class DomainsController extends Controller
|
||||||
|
|
||||||
$parts = extractDomainAndTLD($domainName);
|
$parts = extractDomainAndTLD($domainName);
|
||||||
$label = $parts['domain'];
|
$label = $parts['domain'];
|
||||||
$domain_extension = $parts['tld'];
|
$domain_extension = '.' . strtoupper($parts['tld']);
|
||||||
|
|
||||||
$result = $db->select('SELECT id, tld FROM domain_tld');
|
$tld_id = $db->selectValue(
|
||||||
foreach ($result as $row) {
|
"SELECT id FROM domain_tld WHERE UPPER(tld) = ?",
|
||||||
if ('.' . strtoupper($domain_extension) === strtoupper($row['tld'])) {
|
[$domain_extension]
|
||||||
$tld_id = $row['id'];
|
);
|
||||||
break;
|
|
||||||
}
|
if (!$tld_id) {
|
||||||
|
$this->container->get('flash')->addMessage('error', 'Error creating domain: Invalid domain extension');
|
||||||
|
return $response->withHeader('Location', '/domains')->withStatus(302);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->selectRow('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
|
$result = $db->selectRow('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
|
||||||
|
@ -2051,7 +2052,12 @@ class DomainsController extends Controller
|
||||||
|
|
||||||
$parts = extractDomainAndTLD($domainName);
|
$parts = extractDomainAndTLD($domainName);
|
||||||
$label = $parts['domain'];
|
$label = $parts['domain'];
|
||||||
$domain_extension = $parts['tld'];
|
$domain_extension = '.' . strtoupper($parts['tld']);
|
||||||
|
|
||||||
|
$tld_id = $db->selectValue(
|
||||||
|
"SELECT id FROM domain_tld WHERE UPPER(tld) = ?",
|
||||||
|
[$domain_extension]
|
||||||
|
);
|
||||||
|
|
||||||
if ($_SESSION["auth_roles"] != 0) {
|
if ($_SESSION["auth_roles"] != 0) {
|
||||||
$clid = $db->selectValue('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
|
$clid = $db->selectValue('SELECT registrar_id FROM registrar_users WHERE user_id = ?', [$_SESSION['auth_user_id']]);
|
||||||
|
@ -2062,14 +2068,6 @@ class DomainsController extends Controller
|
||||||
$clid = $registrar_id_domain;
|
$clid = $registrar_id_domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->select('SELECT id, tld FROM domain_tld');
|
|
||||||
foreach ($result as $row) {
|
|
||||||
if ('.' . strtoupper($domain_extension) === strtoupper($row['tld'])) {
|
|
||||||
$tld_id = $row['id'];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$results = $db->select(
|
$results = $db->select(
|
||||||
'SELECT status FROM domain_status WHERE domain_id = ?',
|
'SELECT status FROM domain_status WHERE domain_id = ?',
|
||||||
[ $domain_id ]
|
[ $domain_id ]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue