mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-18 23:33:48 +02:00
Control panel will hide applications if the setting is disabled
This commit is contained in:
parent
22337dc0ba
commit
4cf0d8c5dd
3 changed files with 26 additions and 8 deletions
|
@ -11,7 +11,14 @@ class ApplicationsController extends Controller
|
|||
|
||||
public function listApplications(Request $request, Response $response)
|
||||
{
|
||||
$db = $this->container->get('db');
|
||||
$launch_phases = $db->selectValue("SELECT value FROM settings WHERE name = 'launch_phases'");
|
||||
if ($launch_phases == 'on') {
|
||||
return view($response,'admin/domains/listApplications.twig');
|
||||
} else {
|
||||
$this->container->get('flash')->addMessage('info', 'Applications are disabled.');
|
||||
return $response->withHeader('Location', '/domains')->withStatus(302);
|
||||
}
|
||||
}
|
||||
|
||||
public function createApplication(Request $request, Response $response)
|
||||
|
@ -606,10 +613,16 @@ class ApplicationsController extends Controller
|
|||
}
|
||||
|
||||
// Default view for GET requests or if POST data is not set
|
||||
$launch_phases = $db->selectValue("SELECT value FROM settings WHERE name = 'launch_phases'");
|
||||
if ($launch_phases == 'on') {
|
||||
return view($response,'admin/domains/createApplication.twig', [
|
||||
'registrars' => $registrars,
|
||||
'registrar' => $registrar,
|
||||
]);
|
||||
} else {
|
||||
$this->container->get('flash')->addMessage('info', 'Applications are disabled.');
|
||||
return $response->withHeader('Location', '/domains')->withStatus(302);
|
||||
}
|
||||
}
|
||||
|
||||
public function viewApplication(Request $request, Response $response, $args)
|
||||
|
|
|
@ -105,7 +105,7 @@ class DomainsController extends Controller
|
|||
$contactTech = $data['contactTech'] ?? null;
|
||||
$contactBilling = $data['contactBilling'] ?? null;
|
||||
|
||||
$phaseType = $data['phaseType'] ?? null;
|
||||
$phaseType = $data['phaseType'] ?? 'NONE';
|
||||
$smd = $data['smd'] ?? null;
|
||||
|
||||
$nameservers = !empty($data['nameserver']) ? $data['nameserver'] : null;
|
||||
|
@ -187,7 +187,7 @@ class DomainsController extends Controller
|
|||
);
|
||||
|
||||
if ($phase_details !== 'First-Come-First-Serve') {
|
||||
if ($phaseType !== null && $phaseType !== '') {
|
||||
if ($phaseType == null && $phaseType == '') {
|
||||
return view($response, 'admin/domains/createDomain.twig', [
|
||||
'domainName' => $domainName,
|
||||
'error' => 'The launch phase ' . $phaseType . ' is improperly configured. Please check the settings or contact support.',
|
||||
|
@ -195,7 +195,7 @@ class DomainsController extends Controller
|
|||
'registrar' => $registrar,
|
||||
]);
|
||||
}
|
||||
} else if ($phaseType !== null && $phaseType !== '') {
|
||||
} else if ($phaseType == null && $phaseType == '') {
|
||||
return view($response, 'admin/domains/createDomain.twig', [
|
||||
'domainName' => $domainName,
|
||||
'error' => 'The launch phase ' . $phaseType . ' is improperly configured. Please check the settings or contact support.',
|
||||
|
@ -907,12 +907,15 @@ class DomainsController extends Controller
|
|||
// Determine currency position (before or after)
|
||||
$position = (strpos($pattern, '¤') < strpos($pattern, '#')) ? 'before' : 'after';
|
||||
|
||||
$launch_phases = $db->selectValue("SELECT value FROM settings WHERE name = 'launch_phases'");
|
||||
|
||||
// Default view for GET requests or if POST data is not set
|
||||
return view($response,'admin/domains/createDomain.twig', [
|
||||
'registrars' => $registrars,
|
||||
'currencySymbol' => $symbol,
|
||||
'currencyPosition' => $position,
|
||||
'registrar' => $registrar,
|
||||
'launch_phases' => $launch_phases
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -219,6 +219,7 @@
|
|||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if launch_phases == 'on' %}
|
||||
<div class="mb-3">
|
||||
<label for="phaseType" class="form-label">Phase Type</label>
|
||||
<select class="form-select" id="phaseType" name="phaseType">
|
||||
|
@ -235,6 +236,7 @@
|
|||
<label class="form-label">Signed Mark Information</label>
|
||||
<textarea class="form-control" data-bs-toggle="autosize" name="smd" placeholder="Paste SMD contents…"></textarea>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue