Last required TMCH updates in panel

This commit is contained in:
Pinga 2023-12-20 20:00:42 +02:00
parent e56fa9d034
commit de119b013f
3 changed files with 78 additions and 1 deletions

View file

@ -99,6 +99,29 @@ class ApplicationsController extends Controller
'registrar' => $registrar,
]);
}
$currentDateTime = new \DateTime();
$currentDate = $currentDateTime->format('Y-m-d H:i:s.v'); // Current timestamp
$phase_details = $db->selectValue(
"SELECT phase_category
FROM launch_phases
WHERE tld_id = ?
AND phase_type = ?
AND start_date <= ?
AND (end_date >= ? OR end_date IS NULL OR end_date = '')
",
[$tld_id, $phaseType, $currentDate, $currentDate]
);
if ($phase_details !== 'Application') {
return view($response, 'admin/domains/createApplication.twig', [
'domainName' => $domainName,
'error' => 'The launch phase ' . $phaseType . ' is improperly configured. Please check the settings or contact support.',
'registrars' => $registrars,
'registrar' => $registrar,
]);
}
$domain_already_reserved = $db->selectValue(
'SELECT id FROM reserved_domain_names WHERE name = ? LIMIT 1',