Moved all error messages to locale file

feature/node-rewrite
Sven Slootweg 12 years ago
parent 3cffa42c0d
commit c605752f66

@ -139,3 +139,78 @@ vps-admin-terminate; Terminate
vps-admin-suspend-text; Are you sure you wish to suspend this container? The owner will no longer be able to use it, until it is unsuspended!
vps-admin-unsuspend-text; Are you sure you wish to unsuspend this container? The owner will be able to use it again.
error-logout-success-title; Successfully logged out
error-logout-success-text; You have been successfully logged out. You can now close this page.
error-logout-notloggedin-title; You are not logged in
error-logout-notloggedin-text; You can only logout when you are already logged in.
error-suspend-success-title; Container suspended
error-suspend-success-text; The container has been suspended and can no longer be used by the owner.
error-unsuspend-success-title; Container unsuspended
error-unsuspend-success-text; The container has been unsuspended and can now be used by the owner again.
error-suspend-error-title; Failed to suspend container
error-suspend-error-text; The container could not be suspended.
error-unsuspend-error-title; Failed to unsuspend container
error-unsuspend-error-text; The container could not be unsuspended.
error-unauthorized-title; You are not authorized to view this page
error-unauthorized-text; Your access level is not sufficient.
error-notfound-title; Container not found
error-notfound-text; The container you selected was not found.
warning-suspended-title; This container is suspended
warning-suspended-text; You cannot change any configuration or perform any actions on this container. If you feel this should not be the case, please contact support.
warning-terminated-title; This container has been terminated
warning-terminated-text; You cannot change any configuration or perform any actions on this container, as it is terminated.
error-start-success-title; Container started
error-start-success-text; Your container was successfully started.
error-start-suspended-title; Container is suspended
error-start-suspended-text; Your container could not be started, as it is currently suspended. If you believe this is in error, please file a support ticket.
error-start-failed-title; Container failed to start
error-start-failed-text; Your container could not be started. If this error persists, please file a support ticket.
error-start-running-title; Container can't be started
error-start-running-text; Your container cannot be started because it is already running.
error-stop-success-title; Container stopped
error-stop-success-text; Your container was successfully stopped.
error-stop-failed-title; Container failed to stop
error-stop-failed-text; Your container could not be stopped. If this error persists, please file a support ticket.
error-stop-stopped-title; Container can't be stopped
error-stop-stopped-text; Your container cannot be stopped because it is not running.
error-login-invalid-title; Login failed
error-login-invalid-text; The login details you provided are invalid. Please try again.
error-admin-user-title; That user does not exist
error-admin-user-text; The user you tried to look up does not exist.
error-password-success-title; Password configuration succeeded!
error-password-success-text; Your new root password was successfully configured. Please ensure to change your root password again from your container after logging in.
error-password-nomatch-title; Passwords do not match
error-password-nomatch-text; Both entries must be identical. Please try again.
error-password-missing-title; Fields missing
error-password-missing-text; Both fields are required. Please try again.
error-password-suspended-title; Failed to configure root password
error-password-suspended-text; You can not configure the root password for this VPS, because it is suspended. If you believe this is in error, please contact support.
error-password-terminated-title; Failed to configure root password
error-password-terminated-text; You can not configure the root password for this VPS, because it has been terminated.
error-password-invalid-title; Failed to configure root password
error-password-invalid-text; Your password may be in an invalid format. Try again with a different password.
warning-password-title; Security warning
warning-password-text; Configuring your root password through this panel may expose it to the VPS provider. Only use this feature in an emergency situation, and always change your password again afterwards, from within your container.
error-reinstall-success-title; Reinstallation succeeded!
error-reinstall-success-text; Your VPS was successfully reinstalled.
error-reinstall-confirm-title; Reinstallation aborted
error-reinstall-confirm-text; You did not tick the checkbox at the bottom of the page. Please carefully read the warning, tick the checkbox, and try again.
error-reinstall-notfound-title; Reinstallation aborted
error-reinstall-notfound-text; The template you selected does not exist (anymore). Please select a different template.
error-reinstall-unavailable-title; Reinstallation aborted
error-reinstall-unavailable-text; The template you selected is not available. Please select a different template.
error-reinstall-failed-title; Reinstallation failed
error-reinstall-failed-text; Something went wrong during the reinstallation of your VPS. Please try again. If the reinstallation fails again, please contact support.
error-reinstall-start-title; Failed to start
error-reinstall-start-text; The VPS was successfully reinstalled, but it could not be started. If the issue persists, please contact support.
error-reinstall-suspended-title; Reinstallation aborted
error-reinstall-suspended-text; You can not reinstall this VPS, because it is suspended. If you believe this is in error, please contact support.
error-reinstall-terminated-title; Reinstallation aborted
error-reinstall-terminated-text; You can not reinstall this VPS, because it has been terminated.
error-restart-success-title; Container restarted
error-restart-success-text; Your container was successfully restarted.
error-restart-suspended-title; Container is suspended
error-restart-suspended-text; Your container could not be restarted, as it is currently suspended. If you believe this is in error, please file a support ticket.
error-restart-start-title; Container failed to start
error-restart-start-text; Your container could not be started. If this error persists, please file a support ticket.

@ -25,14 +25,14 @@ try
{
$sContainer->Suspend();
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container suspended", "The container has been suspended and can no longer be used by the owner.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-suspend-success-title'], $locale->strings['error-suspend-success-text']);
$sMainContents .= $err->Render();
}
elseif($_POST['action'] == "unsuspend")
{
$sContainer->Unsuspend();
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container unsuspended", "The container has been unsuspended and can now be used by the owner again.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-unsuspend-success-title'], $locale->strings['error-unsuspend-success-text']);
$sMainContents .= $err->Render();
}
@ -48,21 +48,21 @@ try
}
catch (InsufficientAccessLevelException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "You are not authorized to view this page", "Your access level is not sufficient.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-unauthorized-title'], $locale->strings['error-unauthorized-text']);
$sMainContents .= $err->Render();
}
catch (NotFoundException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container not found", "The container you selected was not found.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-notfound-title'], $locale->strings['error-notfound-text']);
$sMainContents .= $err->Render();
}
catch (ContainerSuspendException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Failed to suspend container", "The container could not be suspended.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-suspend-error-title'], $locale->strings['error-suspend-error-text']);
$sMainContents .= $err->Render();
}
catch (ContainerUnsuspendException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Failed to unsuspend container", "The container could not be unsuspended.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-unsuspend-error-title'], $locale->strings['error-unsuspend-error-text']);
$sMainContents .= $err->Render();
}

@ -46,6 +46,6 @@ try
}
catch (InsufficientAccessLevelException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "You are not authorized to view this page", "Your access level is not sufficient.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-unauthorized-title'], $locale->strings['error-unauthorized-text']);
$sMainContents .= $err->Render();
}

@ -52,7 +52,7 @@ try
}
catch (NotFoundException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "That user does not exist", "The user you tried to look up does not exist.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-admin-user-title'], $locale->strings['error-admin-user-text']);
$sPageContents .= $err->Render();
}

@ -39,13 +39,13 @@ if(isset($_POST['submit']))
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Login failed", "The login details you provided are invalid. Please try again.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-login-invalid-title'], $locale->strings['error-login-invalid-text']);
$sError .= $err->Render();
}
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Login failed", "The login details you provided are invalid. Please try again.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-login-invalid-title'], $locale->strings['error-login-invalid-text']);
$sError .= $err->Render();
}
}

@ -19,11 +19,11 @@ if($sLoggedIn === true)
$sUser = new User(0);
$sLoggedIn = false;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Successfully logged out", "You have been successfully logged out. You can now close this page.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-logout-success-title'], $locale->strings['error-logout-success-text']);
$sMainContents .= $err->Render();
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "You are not logged in", "You can only logout when you are already logged in.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-logout-notloggedin-title'], $locale->strings['error-logout-notloggedin-text']);
$sMainContents .= $err->Render();
}

@ -25,41 +25,41 @@ if(isset($_POST['submit']))
{
$sContainer->SetRootPassword($_POST['password']);
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Password configuration succeeded!", "Your new root password was successfully configured. Please ensure to change your root password again from your container after logging in.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-password-success-title'], $locale->strings['error-password-success-text']);
$sPageContents .= $err->Render();
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Passwords do not match", "Both entries should be identical. Please try again.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-nomatch-title'], $locale->strings['error-password-nomatch-text']);
$sPageContents .= $err->Render();
}
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Fields missing", "Both fields are required. Please try again.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-missing-title'], $locale->strings['error-password-missing-text']);
$sPageContents .= $err->Render();
}
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Failed to configure root password", "You can not configure the root password for this VPS, because it is suspended. If you believe this is in error, please contact support.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-suspended-title'], $locale->strings['error-password-suspended-text']);
$sPageContents .= $err->Render();
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Failed to configure root password", "You can not configure the root password for this VPS, because it has been terminated.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-terminated-title'], $locale->strings['error-password-terminated-text']);
$sPageContents .= $err->Render();
}
catch (SshExitException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Failed to configure root password", "Your password may be in an invalid format. Try again with a different password.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-password-invalid-title'], $locale->strings['error-password-invalid-text']);
$sPageContents .= $err->Render();
}
}
if($display_form === true)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, "Security warning", "Configuring your root password through this panel may expose it to the VPS provider. Only use this feature in an emergency situation, and always change your password again afterwards, from within your container.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, $locale->strings['warning-password-title'], $locale->strings['warning-password-text']);
$sPageContents .= $err->Render();
$sPageContents .= Templater::AdvancedParse("vps.password", $locale->strings, array(

@ -51,12 +51,12 @@ try
}
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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, $locale->strings['warning-suspended-title'], $locale->strings['warning-suspended-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, $locale->strings['warning-terminated-title'], $locale->strings['warning-terminated-text']);
$sMainContents .= $err->Render();
}

@ -32,43 +32,43 @@ if(isset($_POST['submit']))
$sContainer->Reinstall();
$sContainer->Start();
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Reinstallation succeeded!", "Your VPS was successfully reinstalled.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-reinstall-success-title'], $locale->strings['error-reinstall-success-text']);
$sPageContents .= $err->Render();
}
else
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation aborted", "You did not tick the checkbox at the bottom of the page. Please carefully read the warning, tick the checkbox, and try again.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-confirm-title'], $locale->strings['error-reinstall-confirm-text']);
$sPageContents .= $err->Render();
}
}
catch (NotFoundException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation aborted", "The template you selected does not exist (anymore). Please select a different template.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-notfound-title'], $locale->strings['error-reinstall-notfound-text']);
$sPageContents .= $err->Render();
}
catch (TemplateUnavailableException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation aborted", "The template you selected is not available. Please select a different template.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-unavailable-title'], $locale->strings['error-reinstall-unavailable-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-failed-title'], $locale->strings['error-reinstall-failed-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_WARNING, $locale->strings['error-reinstall-start-title'], $locale->strings['error-reinstall-start-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-suspended-title'], $locale->strings['error-reinstall-suspended-text']);
$sPageContents .= $err->Render();
}
catch (ContainerTerminatedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Reinstallation aborted", "You can not reinstall this VPS, because it has been terminated.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-reinstall-terminated-title'], $locale->strings['error-reinstall-terminated-text']);
$sPageContents .= $err->Render();
}
}

@ -27,16 +27,16 @@ try
$sContainer->Start();
$sContainer->sCurrentStatus = CVM_STATUS_STARTED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container restarted", "Your container was successfully restarted.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-restart-success-title'], $locale->strings['error-restart-success-text']);
$sError .= $err->Render();
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container is suspended", "Your container could not be restarted, as it is currently suspended. If you believe this is in error, please file a support ticket.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-restart-suspended-title'], $locale->strings['error-restart-suspended-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-restart-start-title'], $locale->strings['error-restart-start-text']);
$sError .= $err->Render();
}

@ -20,22 +20,22 @@ if($sContainer->sCurrentStatus != CVM_STATUS_STARTED)
$sContainer->Start();
$sContainer->sCurrentStatus = CVM_STATUS_STARTED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container started", "Your container was successfully started.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-start-success-title'], $locale->strings['error-start-success-text']);
$sError .= $err->Render();
}
catch (ContainerSuspendedException $e)
{
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Container is suspended", "Your container could not be started, as it is currently suspended. If you believe this is in error, please file a support ticket.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-suspended-title'], $locale->strings['error-start-suspended-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-failed-title'], $locale->strings['error-start-failed-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-start-running-title'], $locale->strings['error-start-running-text']);
$sError .= $err->Render();
}

@ -20,17 +20,17 @@ if($sContainer->sCurrentStatus != CVM_STATUS_STOPPED)
$sContainer->Stop();
$sContainer->sCurrentStatus = CVM_STATUS_STOPPED;
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, "Container stopped", "Your container was successfully stopped.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_SUCCESS, $locale->strings['error-stop-success-title'], $locale->strings['error-stop-success-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-stop-failed-title'], $locale->strings['error-stop-failed-text']);
$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.");
$err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, $locale->strings['error-stop-stopped-title'], $locale->strings['error-stop-stopped-text']);
$sError .= $err->Render();
}

Loading…
Cancel
Save