From 3bf9992e3beaae26fdccb7450e52ba7d41dfb955 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 11 May 2012 00:56:51 +0200 Subject: [PATCH] Add warning message for suspended and terminated containers --- frontend/module.vps.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/module.vps.php b/frontend/module.vps.php index c9dc1c0..167d216 100644 --- a/frontend/module.vps.php +++ b/frontend/module.vps.php @@ -44,7 +44,22 @@ try $router->RouteRequest(); - $sMainContents = Templater::InlineRender("main.vps", $locale->strings, array( + try + { + $sContainer->CheckAllowed(); + } + catch (ContainerSuspendedException $e) + { + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, "This container is suspended", "You cannot change any configuration or perform any actions on this container. If you feel this should not be the case, please contact support."); + $sMainContents .= $err->Render(); + } + catch (ContainerTerminatedException $e) + { + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, "This container has been terminated", "You cannot change any configuration or perform any actions on this container, as it is terminated."); + $sMainContents .= $err->Render(); + } + + $sMainContents .= Templater::InlineRender("main.vps", $locale->strings, array( 'error' => $sError, 'contents' => $sPageContents, 'id' => $sContainer->sId