Merge branch 'fix/node-admin' into feature/terminate-vps

feature/node-rewrite
Sven Slootweg 11 years ago
commit b7a2150625

@ -305,6 +305,34 @@ class SshConnector extends CPHPBaseClass
else
{
$response = json_decode(implode("", $response));
$json_error = json_last_error();
if($json_error !== JSON_ERROR_NONE)
{
switch($json_last_error)
{
case JSON_ERROR_DEPTH:
$err_msg = "Maximum stack depth exceeded.";
break;
case JSON_ERROR_STATE_MISMATCH:
$err_msg = "Underflow or modes mismatch.";
break;
case JSON_ERROR_CTRL_CHAR:
$err_msg = "Unexpected control character found.";
break;
case JSON_ERROR_SYNTAX:
$err_msg = "Syntax error, malformed JSON.";
break;
case JSON_ERROR_UTF8:
$err_msg = "Malformed UTF-8 characters, possibly incorrectly encoded.";
break;
default:
$err_msg = "Unknown error {$json_error}.";
}
throw new SshCommandException("An error occurred while decoding the response from the slave: {$err_msg}");
}
}
if($response->returncode != 0 && $throw_exception === true)

@ -127,7 +127,7 @@
</tr>
</table>
{%if accesslevel = 20}
{%if accesslevel >= 20}
<h3>{%!header-vps-admin}</h3>
<div class="vps-admin">
<a href="/admin/vps/{%?id}/suspend/">{%!vps-admin-suspend}</a>

Loading…
Cancel
Save