diff --git a/frontend/modules/client/vps/list.php b/frontend/modules/client/vps/list.php index a2ddec5..9aaa799 100644 --- a/frontend/modules/client/vps/list.php +++ b/frontend/modules/client/vps/list.php @@ -15,36 +15,37 @@ if(!isset($_CVM)) { die("Unauthorized."); } if($sLoggedIn === true) { - $result = $database->CachedQuery("SELECT * FROM containers WHERE `UserId` = :UserId", array(":UserId" => $sUser->sId)); - $sVpsList = array(); - foreach($result->data as $row) + if($result = $database->CachedQuery("SELECT * FROM containers WHERE `UserId` = :UserId", array(":UserId" => $sUser->sId))) { - $sVps = new Vps($row); - - try - { - $sStatus = $sVps->sStatusText; - } - catch (SshException $e) + foreach($result->data as $row) { - $sStatus = "unknown"; + $sVps = new Vps($row); + + try + { + $sStatus = $sVps->sStatusText; + } + catch (SshException $e) + { + $sStatus = "unknown"; + } + + $sVpsList[] = array( + 'id' => $sVps->sId, + 'hostname' => $sVps->sHostname, + 'node' => $sVps->sNode->sName, + 'node-hostname' => $sVps->sNode->sHostname, + 'template' => $sVps->sTemplate->sName, + 'diskspace' => number_format($sVps->sDiskSpace / 1024), + 'diskspace-unit' => "GB", + 'guaranteed-ram' => $sVps->sGuaranteedRam, + 'guaranteed-ram-unit' => "MB", + 'status' => $sStatus, + 'virtualization-type' => $sVps->sVirtualizationType + ); } - - $sVpsList[] = array( - 'id' => $sVps->sId, - 'hostname' => $sVps->sHostname, - 'node' => $sVps->sNode->sName, - 'node-hostname' => $sVps->sNode->sHostname, - 'template' => $sVps->sTemplate->sName, - 'diskspace' => number_format($sVps->sDiskSpace / 1024), - 'diskspace-unit' => "GB", - 'guaranteed-ram' => $sVps->sGuaranteedRam, - 'guaranteed-ram-unit' => "MB", - 'status' => $sStatus, - 'virtualization-type' => $sVps->sVirtualizationType - ); } $sMainContents = Templater::AdvancedParse("{$sTheme}/client/vps/list", $locale->strings, array(