From e3da8b66a502538c905c19f0c7c406258bdd7161 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 2 Jun 2013 22:25:05 +0200 Subject: [PATCH] Replace $_CVM with more generic $_APP. --- frontend/api.local.php | 2 +- frontend/authenticators/admin.php | 2 +- frontend/authenticators/api/client.php | 2 +- frontend/authenticators/vps.php | 2 +- frontend/classes/apikey.php | 2 +- frontend/classes/iprange.php | 2 +- frontend/classes/node.php | 2 +- frontend/classes/sshconnector.php | 2 +- frontend/classes/template.php | 2 +- frontend/classes/user.php | 2 +- frontend/classes/vps.php | 2 +- frontend/cron.15.php | 2 +- frontend/includes/include.base.php | 4 ++-- frontend/includes/include.constants.php | 2 +- frontend/includes/include.exceptions.php | 2 +- frontend/includes/include.misc.php | 2 +- frontend/includes/include.parsing.php | 2 +- frontend/modules/admin/node/add.php | 2 +- frontend/modules/admin/node/list.php | 2 +- frontend/modules/admin/node/lookup.php | 2 +- frontend/modules/admin/overview/index.php | 2 +- frontend/modules/admin/user/list.php | 2 +- frontend/modules/admin/user/lookup.php | 2 +- frontend/modules/admin/vps/create.php | 2 +- frontend/modules/admin/vps/list.php | 2 +- frontend/modules/admin/vps/suspend.php | 2 +- frontend/modules/api/client/vps/list.php | 2 +- frontend/modules/client/vps/action/restart.php | 2 +- frontend/modules/client/vps/action/start.php | 2 +- frontend/modules/client/vps/action/stop.php | 2 +- frontend/modules/client/vps/console.php | 2 +- frontend/modules/client/vps/list.php | 2 +- frontend/modules/client/vps/lookup.php | 2 +- frontend/modules/client/vps/password.php | 2 +- frontend/modules/client/vps/reinstall.php | 2 +- frontend/modules/error/access.php | 2 +- frontend/modules/shared/login.php | 2 +- frontend/modules/shared/logout.php | 2 +- frontend/rewrite.php | 2 +- 39 files changed, 40 insertions(+), 40 deletions(-) diff --git a/frontend/api.local.php b/frontend/api.local.php index ad337f4..ef5592c 100644 --- a/frontend/api.local.php +++ b/frontend/api.local.php @@ -11,7 +11,7 @@ * licensing text. */ -$_CVM = true; +$_APP = true; require("includes/include.base.php"); $return_object = array(); diff --git a/frontend/authenticators/admin.php b/frontend/authenticators/admin.php index 9a2508b..ac00348 100644 --- a/frontend/authenticators/admin.php +++ b/frontend/authenticators/admin.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $router->uVariables['display_menu'] = true; diff --git a/frontend/authenticators/api/client.php b/frontend/authenticators/api/client.php index be0cfda..e49be1b 100644 --- a/frontend/authenticators/api/client.php +++ b/frontend/authenticators/api/client.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $public_token = $_SERVER['HTTP_API_PUBLIC_TOKEN']; $private_token = $_SERVER['HTTP_API_PRIVATE_TOKEN']; diff --git a/frontend/authenticators/vps.php b/frontend/authenticators/vps.php index 4ccb193..b23cadf 100644 --- a/frontend/authenticators/vps.php +++ b/frontend/authenticators/vps.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $router->uVariables['display_menu'] = true; diff --git a/frontend/classes/apikey.php b/frontend/classes/apikey.php index 9fe0860..f213b98 100644 --- a/frontend/classes/apikey.php +++ b/frontend/classes/apikey.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } class ApiKey extends CPHPDatabaseRecordClass { diff --git a/frontend/classes/iprange.php b/frontend/classes/iprange.php index 5e7715b..afed82a 100644 --- a/frontend/classes/iprange.php +++ b/frontend/classes/iprange.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } define("IP_TYPE_NONE", 0); define("IP_TYPE_IPV4", 4); diff --git a/frontend/classes/node.php b/frontend/classes/node.php index f20b822..393937a 100644 --- a/frontend/classes/node.php +++ b/frontend/classes/node.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } class Node extends CPHPDatabaseRecordClass { diff --git a/frontend/classes/sshconnector.php b/frontend/classes/sshconnector.php index 35f405d..95ae3c7 100644 --- a/frontend/classes/sshconnector.php +++ b/frontend/classes/sshconnector.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } class SshConnector extends CPHPBaseClass { diff --git a/frontend/classes/template.php b/frontend/classes/template.php index 6973c26..7bf9c2b 100644 --- a/frontend/classes/template.php +++ b/frontend/classes/template.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } class Template extends CPHPDatabaseRecordClass { diff --git a/frontend/classes/user.php b/frontend/classes/user.php index 9a2f528..01569f4 100644 --- a/frontend/classes/user.php +++ b/frontend/classes/user.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } class User extends CPHPDatabaseRecordClass { diff --git a/frontend/classes/vps.php b/frontend/classes/vps.php index bb45e47..d842255 100644 --- a/frontend/classes/vps.php +++ b/frontend/classes/vps.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } class Vps extends CPHPDatabaseRecordClass { diff --git a/frontend/cron.15.php b/frontend/cron.15.php index e9db17c..9b68837 100644 --- a/frontend/cron.15.php +++ b/frontend/cron.15.php @@ -11,7 +11,7 @@ * licensing text. */ -$_CVM = true; +$_APP = true; require("includes/include.base.php"); if($result = $database->CachedQuery("SELECT * FROM containers")) diff --git a/frontend/includes/include.base.php b/frontend/includes/include.base.php index 6fc6e15..0a1287d 100644 --- a/frontend/includes/include.base.php +++ b/frontend/includes/include.base.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $_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) { diff --git a/frontend/includes/include.constants.php b/frontend/includes/include.constants.php index 0583086..8460b29 100644 --- a/frontend/includes/include.constants.php +++ b/frontend/includes/include.constants.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } define("CVM_VIRTUALIZATION_OPENVZ", 1 ); diff --git a/frontend/includes/include.exceptions.php b/frontend/includes/include.exceptions.php index db934a6..09988f1 100644 --- a/frontend/includes/include.exceptions.php +++ b/frontend/includes/include.exceptions.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } // SshConnector-related exceptions class SshException extends Exception {} diff --git a/frontend/includes/include.misc.php b/frontend/includes/include.misc.php index 72dbd3b..525fdf7 100644 --- a/frontend/includes/include.misc.php +++ b/frontend/includes/include.misc.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } function check_fields($source, $fields, &$errors) { diff --git a/frontend/includes/include.parsing.php b/frontend/includes/include.parsing.php index b69e6d0..46ee8ca 100644 --- a/frontend/includes/include.parsing.php +++ b/frontend/includes/include.parsing.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } function split_whitespace($input) { diff --git a/frontend/modules/admin/node/add.php b/frontend/modules/admin/node/add.php index 48e3ad2..8fdc5bd 100644 --- a/frontend/modules/admin/node/add.php +++ b/frontend/modules/admin/node/add.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $sErrors = array(); diff --git a/frontend/modules/admin/node/list.php b/frontend/modules/admin/node/list.php index 5e0324e..0e546bd 100644 --- a/frontend/modules/admin/node/list.php +++ b/frontend/modules/admin/node/list.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $sNodeList = array(); diff --git a/frontend/modules/admin/node/lookup.php b/frontend/modules/admin/node/lookup.php index 1f0ad65..dd91ef0 100644 --- a/frontend/modules/admin/node/lookup.php +++ b/frontend/modules/admin/node/lookup.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } try { diff --git a/frontend/modules/admin/overview/index.php b/frontend/modules/admin/overview/index.php index 51dda62..2b7fefd 100644 --- a/frontend/modules/admin/overview/index.php +++ b/frontend/modules/admin/overview/index.php @@ -11,6 +11,6 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $sPageContents = Templater::AdvancedParse("{$sTheme}/admin/overview/index", $locale->strings, array()); diff --git a/frontend/modules/admin/user/list.php b/frontend/modules/admin/user/list.php index b2e0446..df66af0 100644 --- a/frontend/modules/admin/user/list.php +++ b/frontend/modules/admin/user/list.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $result = $database->CachedQuery("SELECT * FROM users ORDER BY `AccessLevel` DESC"); diff --git a/frontend/modules/admin/user/lookup.php b/frontend/modules/admin/user/lookup.php index 696bb42..f8221c1 100644 --- a/frontend/modules/admin/user/lookup.php +++ b/frontend/modules/admin/user/lookup.php @@ -13,7 +13,7 @@ /* TODO: Add "create VPS" button. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } try { diff --git a/frontend/modules/admin/vps/create.php b/frontend/modules/admin/vps/create.php index 23e2b15..3b89dfd 100644 --- a/frontend/modules/admin/vps/create.php +++ b/frontend/modules/admin/vps/create.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $sErrors = array(); diff --git a/frontend/modules/admin/vps/list.php b/frontend/modules/admin/vps/list.php index 7e875a8..aa0242a 100644 --- a/frontend/modules/admin/vps/list.php +++ b/frontend/modules/admin/vps/list.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $sVpsList = array(); diff --git a/frontend/modules/admin/vps/suspend.php b/frontend/modules/admin/vps/suspend.php index c4e35b4..d5c3f5c 100644 --- a/frontend/modules/admin/vps/suspend.php +++ b/frontend/modules/admin/vps/suspend.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } try { diff --git a/frontend/modules/api/client/vps/list.php b/frontend/modules/api/client/vps/list.php index b1d7f2d..511feeb 100644 --- a/frontend/modules/api/client/vps/list.php +++ b/frontend/modules/api/client/vps/list.php @@ -11,7 +11,7 @@ * 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))) { diff --git a/frontend/modules/client/vps/action/restart.php b/frontend/modules/client/vps/action/restart.php index c62ba4f..dbde64f 100644 --- a/frontend/modules/client/vps/action/restart.php +++ b/frontend/modules/client/vps/action/restart.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } try { diff --git a/frontend/modules/client/vps/action/start.php b/frontend/modules/client/vps/action/start.php index 0ffe1bd..732db7e 100644 --- a/frontend/modules/client/vps/action/start.php +++ b/frontend/modules/client/vps/action/start.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } if($sVps->sCurrentStatus != CVM_STATUS_STARTED) { diff --git a/frontend/modules/client/vps/action/stop.php b/frontend/modules/client/vps/action/stop.php index 1e41fb4..bc7907a 100644 --- a/frontend/modules/client/vps/action/stop.php +++ b/frontend/modules/client/vps/action/stop.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } if($sVps->sCurrentStatus != CVM_STATUS_STOPPED) { diff --git a/frontend/modules/client/vps/console.php b/frontend/modules/client/vps/console.php index 3dd83d8..d7f7cad 100644 --- a/frontend/modules/client/vps/console.php +++ b/frontend/modules/client/vps/console.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $sPageContents .= Templater::AdvancedParse("{$sTheme}/client/vps/console", $locale->strings, array( 'host' => htmlspecialchars($_SERVER['SERVER_NAME']), diff --git a/frontend/modules/client/vps/list.php b/frontend/modules/client/vps/list.php index 9aaa799..51efebe 100644 --- a/frontend/modules/client/vps/list.php +++ b/frontend/modules/client/vps/list.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } if($sLoggedIn === true) { diff --git a/frontend/modules/client/vps/lookup.php b/frontend/modules/client/vps/lookup.php index e9fe608..e84215d 100644 --- a/frontend/modules/client/vps/lookup.php +++ b/frontend/modules/client/vps/lookup.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } if(!empty($router->uVariables['action'])) { diff --git a/frontend/modules/client/vps/password.php b/frontend/modules/client/vps/password.php index 9c07e2a..5aa1ce8 100644 --- a/frontend/modules/client/vps/password.php +++ b/frontend/modules/client/vps/password.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $display_form = true; diff --git a/frontend/modules/client/vps/reinstall.php b/frontend/modules/client/vps/reinstall.php index cf26597..158a7be 100644 --- a/frontend/modules/client/vps/reinstall.php +++ b/frontend/modules/client/vps/reinstall.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } $display_form = true; diff --git a/frontend/modules/error/access.php b/frontend/modules/error/access.php index 328087e..020fedf 100644 --- a/frontend/modules/error/access.php +++ b/frontend/modules/error/access.php @@ -11,6 +11,6 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } throw new UnauthorizedException("You are not allowed to access this page."); diff --git a/frontend/modules/shared/login.php b/frontend/modules/shared/login.php index 01da306..d4d9fe6 100644 --- a/frontend/modules/shared/login.php +++ b/frontend/modules/shared/login.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } if($sLoggedIn === true) { diff --git a/frontend/modules/shared/logout.php b/frontend/modules/shared/logout.php index b3f5a1c..b5d4e6e 100644 --- a/frontend/modules/shared/logout.php +++ b/frontend/modules/shared/logout.php @@ -11,7 +11,7 @@ * licensing text. */ -if(!isset($_CVM)) { die("Unauthorized."); } +if(!isset($_APP)) { die("Unauthorized."); } if($sLoggedIn === true) { diff --git a/frontend/rewrite.php b/frontend/rewrite.php index 07ededd..c59a783 100644 --- a/frontend/rewrite.php +++ b/frontend/rewrite.php @@ -13,7 +13,7 @@ $timing_start = microtime(true); -$_CVM = true; +$_APP = true; require("includes/include.base.php"); $sTheme = "default";