NULL, 'approved' => match ($_SESSION['type']) { 'approved' => NULL, default => output(403, 'The current account type is not allowed to register in this suffix.'), }, default => output(403, 'This suffix is not open to registration.'), }; $domain = formatAbsoluteDomain($_POST['subdomain'] . '.' . $_POST['suffix']); if (query('select', 'registry', ['domain' => $domain], 'domain') !== []) output(403, _('This domain is already registered.')); if (in_array($_POST['subdomain'], explode(LF, file_get_contents(ROOT_PATH . '/pg-act/reg/reserved.txt')))) output(403, _('This domain is reserved.')); rateLimit(); insert('registry', [ 'domain' => $domain, 'username' => $_SESSION['id'], 'last_renewal' => date('Y-m-d H:i:s'), ]); output(200, _('Domain registered.'));