mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-02 00:53:22 +02:00
Fixed #63
This commit is contained in:
parent
c8c8cc3c07
commit
aaa2971c4b
2 changed files with 26 additions and 14 deletions
|
@ -971,16 +971,25 @@ class SystemController extends Controller
|
|||
}
|
||||
|
||||
$db = $this->container->get('db');
|
||||
$types = $db->select("SELECT DISTINCT type FROM reserved_domain_names");
|
||||
// Get the current URI
|
||||
$uri = $request->getUri()->getPath();
|
||||
$typesResult = $db->select("SELECT DISTINCT type FROM reserved_domain_names");
|
||||
|
||||
// Set default types if $types is empty
|
||||
if (empty($types)) {
|
||||
$types = [
|
||||
['type' => 'reserved'],
|
||||
['type' => 'restricted']
|
||||
];
|
||||
// Initialize $types as an empty array if the query result is null
|
||||
$types = $typesResult ?: [];
|
||||
|
||||
// Ensure all default types are represented
|
||||
$defaultTypes = ['reserved', 'restricted'];
|
||||
foreach ($defaultTypes as $defaultType) {
|
||||
$found = false;
|
||||
foreach ($types as $type) {
|
||||
if ($type['type'] === $defaultType) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
$types[] = ['type' => $defaultType];
|
||||
}
|
||||
}
|
||||
|
||||
$categories = [];
|
||||
|
@ -990,7 +999,6 @@ class SystemController extends Controller
|
|||
[ $type['type'] ]
|
||||
);
|
||||
|
||||
// Initialize the type with an empty array if no names are found
|
||||
$categories[$type['type']] = $typeNames ? array_column($typeNames, 'name') : [];
|
||||
}
|
||||
|
||||
|
|
|
@ -36,11 +36,15 @@
|
|||
<div class="card mb-3">
|
||||
<div class="card-header">{{ type|capitalize }} Names</div>
|
||||
<div class="card-body">
|
||||
<textarea class="form-control" name="domains_{{ type }}" rows="4" placeholder="Enter domain names, one per line" required>{{ names|join('\n') }}</textarea>
|
||||
{% if names is not empty %}
|
||||
<textarea class="form-control" name="domains_{{ type }}" rows="4" placeholder="Enter domain names, one per line" required>{{ names|join('\n') }}</textarea>
|
||||
{% else %}
|
||||
<textarea class="form-control" name="domains_{{ type }}" rows="4" placeholder="No {{ type|lower }} names. Enter new names, one per line" required></textarea>
|
||||
{% endif %}
|
||||
<small class="form-hint">
|
||||
<strong>{{ type|capitalize }} Names:</strong> These domain names are subject to special regulations or registration requirements. They might be available for registration but under specific conditions, such as proof of eligibility or additional documentation.
|
||||
<br><em>Enter each {{ type }} name on a new line, without the extension. For instance, use "example" in place of "example.com".</em>
|
||||
</small>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue