From 0766875cc6f3e7e569a03b821161be8b79cbbcea Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Fri, 11 May 2012 00:29:47 +0200 Subject: [PATCH] Pretty sure we don't need all these files. --- frontend/interface.php | 98 ------------------------------------- frontend/test.destroy.php | 6 --- frontend/test.php | 57 --------------------- frontend/test.reinstall.php | 10 ---- 4 files changed, 171 deletions(-) delete mode 100644 frontend/interface.php delete mode 100644 frontend/test.destroy.php delete mode 100644 frontend/test.php delete mode 100644 frontend/test.reinstall.php diff --git a/frontend/interface.php b/frontend/interface.php deleted file mode 100644 index 8a84aa8..0000000 --- a/frontend/interface.php +++ /dev/null @@ -1,98 +0,0 @@ -GetStatus() != CVM_STATUS_STARTED) - { - try - { - $sContainer->Start(); - $sContainer->sStatus = CVM_STATUS_STARTED; - - $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container started", "Your container was successfully started."); - $sError .= $err->Render(); - } - catch(ContainerStartException $e) - { - $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container failed to start", "Your container could not be started. If this error persists, please file a support ticket."); - $sError .= $err->Render(); - } - } - else - { - $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container can't be started", "Your container cannot be started because it is already running."); - $sError .= $err->Render(); - } -} -elseif($_GET['action'] == "stop") -{ - if($sContainer->GetStatus() != CVM_STATUS_STOPPED) - { - try - { - $sContainer->Stop(); - $sContainer->sStatus = CVM_STATUS_STOPPED; - - $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container stopped", "Your container was successfully stopped."); - $sError .= $err->Render(); - } - catch(ContainerStartException $e) - { - $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container failed to stop", "Your container could not be stopped. If this error persists, please file a support ticket."); - $sError .= $err->Render(); - } - } - else - { - $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container can't be stopped", "Your container cannot be stopped because it is not running."); - $sError .= $err->Render(); - } -} -elseif($_GET['action'] == "restart") -{ - try - { - try - { - $sContainer->Stop(); - } - catch(ContainerStopException $e) - { - // we can make this silently fail, as the only important thing is that it starts again - } - - $sContainer->Start(); - $sContainer->sStatus = CVM_STATUS_STARTED; - - $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container restarted", "Your container was successfully restarted."); - $sError .= $err->Render(); - } - catch(ContainerStartException $e) - { - $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container failed to start", "Your container could not be started. If this error persists, please file a support ticket."); - $sError .= $err->Render(); - } -} - -echo(Templater::InlineRender("main", $locale->strings, array( - 'error' => $sError, - 'server-location' => $sContainer->sNode->sPhysicalLocation, - 'operating-system' => $sContainer->sTemplate->sName, - 'guaranteed-ram' => "{$sContainer->sGuaranteedRam}MB", - 'burstable-ram' => "{$sContainer->sBurstableRam}MB", - 'disk-space' => "{$sContainer->sDiskSpace}MB", - 'total-traffic-limit' => "{$sContainer->sTotalTrafficLimit} bytes", - 'bandwidth-limit' => "100mbit", - 'status' => Templater::InlineRender("status.{$sContainer->sStatusText}", $locale->strings) -))); - -?> diff --git a/frontend/test.destroy.php b/frontend/test.destroy.php deleted file mode 100644 index 32cc8eb..0000000 --- a/frontend/test.destroy.php +++ /dev/null @@ -1,6 +0,0 @@ -Suspend()); -?> diff --git a/frontend/test.php b/frontend/test.php deleted file mode 100644 index 8de9a5b..0000000 --- a/frontend/test.php +++ /dev/null @@ -1,57 +0,0 @@ -Deploy(); -} -else -{ - $sContainer = new Container(3); - - if($_GET['action'] == "start") - { - $sContainer->Start(); - } - elseif($_GET['action'] == "stop") - { - $sContainer->Stop(); - } - elseif($_GET['action'] == "bw") - { - $sContainer->UpdateTraffic(); - } - elseif($_GET['action'] == "ip") - { - $sContainer->AddIp($_GET['ip']); - } - elseif($_GET['action'] == "delip") - { - $sContainer->RemoveIp($_GET['ip']); - } - elseif($_GET['action'] == "user") - { - $sUser = new User(1); - - pretty_dump($sUser); - } - else - { - echo("idk"); - } -} - -echo("Done!"); -?> -CVM test -

-Start
-Stop
- diff --git a/frontend/test.reinstall.php b/frontend/test.reinstall.php deleted file mode 100644 index 07e4f8d..0000000 --- a/frontend/test.reinstall.php +++ /dev/null @@ -1,10 +0,0 @@ -sTemplate->sName); - -$sContainer->uTemplateId = 4; -$sContainer->InsertIntoDatabase(); -pretty_dump($sContainer->sTemplate->sName);