@ -11,7 +11,7 @@
* licensing text.
*/
$_CVM = true;
$_APP = true;
require("includes/include.base.php");
$return_object = array();
if(!isset($_CVM)) { die("Unauthorized."); }
if(!isset($_APP)) { die("Unauthorized."); }
$router->uVariables['display_menu'] = true;
$public_token = $_SERVER['HTTP_API_PUBLIC_TOKEN'];
$private_token = $_SERVER['HTTP_API_PRIVATE_TOKEN'];
class ApiKey extends CPHPDatabaseRecordClass
{
define("IP_TYPE_NONE", 0);
define("IP_TYPE_IPV4", 4);
class Node extends CPHPDatabaseRecordClass
class SshConnector extends CPHPBaseClass
class Template extends CPHPDatabaseRecordClass
class User extends CPHPDatabaseRecordClass
class Vps extends CPHPDatabaseRecordClass
if($result = $database->CachedQuery("SELECT * FROM containers"))
$_CPHP_CONFIG = "../config.json";
$_CPHP = true;
@ -24,7 +24,7 @@ require("include.misc.php");
function __autoload($class_name)
global $_CVM;
global $_APP;
if(strpos($class_name, "\\") !== false)
define("CVM_VIRTUALIZATION_OPENVZ", 1 );
// SshConnector-related exceptions
class SshException extends Exception {}
function check_fields($source, $fields, &$errors)
function split_whitespace($input)
$sErrors = array();
$sNodeList = array();
try
@ -11,6 +11,6 @@
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/overview/index", $locale->strings, array());
$result = $database->CachedQuery("SELECT * FROM users ORDER BY `AccessLevel` DESC");
@ -13,7 +13,7 @@
/* TODO: Add "create VPS" button. */
$sVpsList = array();
if($result = $database->CachedQuery("SELECT * FROM containers WHERE `UserId` = :UserId", array(':UserId' => $sApiKey->sUser->sId)))
if($sVps->sCurrentStatus != CVM_STATUS_STARTED)
if($sVps->sCurrentStatus != CVM_STATUS_STOPPED)
$sPageContents .= Templater::AdvancedParse("{$sTheme}/client/vps/console", $locale->strings, array(
'host' => htmlspecialchars($_SERVER['SERVER_NAME']),
if($sLoggedIn === true)
if(!empty($router->uVariables['action']))
$display_form = true;
throw new UnauthorizedException("You are not allowed to access this page.");
$timing_start = microtime(true);
$sTheme = "default";