Replace $_CVM with more generic $_APP.

feature/node-rewrite
Sven Slootweg 12 years ago
parent 1b2b2b7600
commit e3da8b66a5

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
$_CVM = true; $_APP = true;
require("includes/include.base.php"); require("includes/include.base.php");
$return_object = array(); $return_object = array();

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$router->uVariables['display_menu'] = true; $router->uVariables['display_menu'] = true;

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$public_token = $_SERVER['HTTP_API_PUBLIC_TOKEN']; $public_token = $_SERVER['HTTP_API_PUBLIC_TOKEN'];
$private_token = $_SERVER['HTTP_API_PRIVATE_TOKEN']; $private_token = $_SERVER['HTTP_API_PRIVATE_TOKEN'];

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$router->uVariables['display_menu'] = true; $router->uVariables['display_menu'] = true;

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
class ApiKey extends CPHPDatabaseRecordClass class ApiKey extends CPHPDatabaseRecordClass
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
define("IP_TYPE_NONE", 0); define("IP_TYPE_NONE", 0);
define("IP_TYPE_IPV4", 4); define("IP_TYPE_IPV4", 4);

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
class Node extends CPHPDatabaseRecordClass class Node extends CPHPDatabaseRecordClass
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
class SshConnector extends CPHPBaseClass class SshConnector extends CPHPBaseClass
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
class Template extends CPHPDatabaseRecordClass class Template extends CPHPDatabaseRecordClass
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
class User extends CPHPDatabaseRecordClass class User extends CPHPDatabaseRecordClass
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
class Vps extends CPHPDatabaseRecordClass class Vps extends CPHPDatabaseRecordClass
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
$_CVM = true; $_APP = true;
require("includes/include.base.php"); require("includes/include.base.php");
if($result = $database->CachedQuery("SELECT * FROM containers")) if($result = $database->CachedQuery("SELECT * FROM containers"))

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$_CPHP_CONFIG = "../config.json"; $_CPHP_CONFIG = "../config.json";
$_CPHP = true; $_CPHP = true;
@ -24,7 +24,7 @@ require("include.misc.php");
function __autoload($class_name) function __autoload($class_name)
{ {
global $_CVM; global $_APP;
if(strpos($class_name, "\\") !== false) if(strpos($class_name, "\\") !== false)
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
define("CVM_VIRTUALIZATION_OPENVZ", 1 ); define("CVM_VIRTUALIZATION_OPENVZ", 1 );

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
// SshConnector-related exceptions // SshConnector-related exceptions
class SshException extends Exception {} class SshException extends Exception {}

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
function check_fields($source, $fields, &$errors) function check_fields($source, $fields, &$errors)
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
function split_whitespace($input) function split_whitespace($input)
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$sErrors = array(); $sErrors = array();

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$sNodeList = array(); $sNodeList = array();

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
try try
{ {

@ -11,6 +11,6 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$sPageContents = Templater::AdvancedParse("{$sTheme}/admin/overview/index", $locale->strings, array()); $sPageContents = Templater::AdvancedParse("{$sTheme}/admin/overview/index", $locale->strings, array());

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$result = $database->CachedQuery("SELECT * FROM users ORDER BY `AccessLevel` DESC"); $result = $database->CachedQuery("SELECT * FROM users ORDER BY `AccessLevel` DESC");

@ -13,7 +13,7 @@
/* TODO: Add "create VPS" button. */ /* TODO: Add "create VPS" button. */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
try try
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$sErrors = array(); $sErrors = array();

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$sVpsList = array(); $sVpsList = array();

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
try try
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
if($result = $database->CachedQuery("SELECT * FROM containers WHERE `UserId` = :UserId", array(':UserId' => $sApiKey->sUser->sId))) if($result = $database->CachedQuery("SELECT * FROM containers WHERE `UserId` = :UserId", array(':UserId' => $sApiKey->sUser->sId)))
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
try try
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
if($sVps->sCurrentStatus != CVM_STATUS_STARTED) if($sVps->sCurrentStatus != CVM_STATUS_STARTED)
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
if($sVps->sCurrentStatus != CVM_STATUS_STOPPED) if($sVps->sCurrentStatus != CVM_STATUS_STOPPED)
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$sPageContents .= Templater::AdvancedParse("{$sTheme}/client/vps/console", $locale->strings, array( $sPageContents .= Templater::AdvancedParse("{$sTheme}/client/vps/console", $locale->strings, array(
'host' => htmlspecialchars($_SERVER['SERVER_NAME']), 'host' => htmlspecialchars($_SERVER['SERVER_NAME']),

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
if($sLoggedIn === true) if($sLoggedIn === true)
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
if(!empty($router->uVariables['action'])) if(!empty($router->uVariables['action']))
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$display_form = true; $display_form = true;

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
$display_form = true; $display_form = true;

@ -11,6 +11,6 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
throw new UnauthorizedException("You are not allowed to access this page."); throw new UnauthorizedException("You are not allowed to access this page.");

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
if($sLoggedIn === true) if($sLoggedIn === true)
{ {

@ -11,7 +11,7 @@
* licensing text. * licensing text.
*/ */
if(!isset($_CVM)) { die("Unauthorized."); } if(!isset($_APP)) { die("Unauthorized."); }
if($sLoggedIn === true) if($sLoggedIn === true)
{ {

@ -13,7 +13,7 @@
$timing_start = microtime(true); $timing_start = microtime(true);
$_CVM = true; $_APP = true;
require("includes/include.base.php"); require("includes/include.base.php");
$sTheme = "default"; $sTheme = "default";

Loading…
Cancel
Save