mirror of
https://github.com/getnamingo/registry.git
synced 2025-08-02 07:41:49 +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)
|
||||
{
|
||||
return view($response,'admin/domains/listApplications.twig');
|
||||
$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
|
||||
return view($response,'admin/domains/createApplication.twig', [
|
||||
'registrars' => $registrars,
|
||||
'registrar' => $registrar,
|
||||
]);
|
||||
$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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue