$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Reinstallation succeeded!", "Your VPS was successfully reinstalled.");
$sPageContents .= $err->Render();
}
catch (ContainerReinstallException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation failed", "Something went wrong during the reinstallation of your VPS. Please try again. If the reinstallation fails again, please contact support.");
$sPageContents .= $err->Render();
}
catch (ContainerStartException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, "Failed to start", "The VPS was successfully reinstalled, but it could not be started. If the issue persists, please contact support.");
$sPageContents .= $err->Render();
}
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation aborted", "You can not reinstall this VPS, because it is suspended. If you believe this is in error, please contact support.");
$sPageContents .= $err->Render();
}
$sContainer->uTemplateId = $sTemplate->sId;
$sContainer->InsertIntoDatabase();
$sContainer->Reinstall();
$sContainer->Start();
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Reinstallation succeeded!", "Your VPS was successfully reinstalled.");
$sPageContents .= $err->Render();
}
else
{
@ -71,6 +51,26 @@ if(isset($_POST['submit']))
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation aborted", "The template you selected is not available. Please select a different template.");
$sPageContents .= $err->Render();
}
catch (ContainerReinstallException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation failed", "Something went wrong during the reinstallation of your VPS. Please try again. If the reinstallation fails again, please contact support.");
$sPageContents .= $err->Render();
}
catch (ContainerStartException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, "Failed to start", "The VPS was successfully reinstalled, but it could not be started. If the issue persists, please contact support.");
$sPageContents .= $err->Render();
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation aborted", "You can not reinstall this VPS, because it is suspended. If you believe this is in error, please contact support.");
$sPageContents .= $err->Render();
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation aborted", "You can not reinstall this VPS, because it is suspended. If you believe this is in error, please contact support.");