This repository was archived by the owner on Aug 6, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathconsole.php
More file actions
43 lines (36 loc) · 1.43 KB
/
Copy pathconsole.php
File metadata and controls
43 lines (36 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
include('./includes/loader.php');
// Get prerequisites.
$sId = $_GET['id'];
$sAction = $_GET['action'];
// Check for login.
if(empty($sUser)){
header("Location: index.php");
die();
}
// Check to make sure the user is actually trying to view a vps.
if(empty($sId)){
header("Location: main.php");
die();
}
// Check to make sure the vps the user is trying to view is theirs or they are a admin.
$sVPS = new VPS($sId);
if(($sVPS->sUserId != $sUser->sId) && ($sUser->sPermissions != 7)){
header("Location: main.php");
die();
}
// Restrict access to the vps if the user's vps is suspended.
if(($sVPS->sSuspended == 1) && ($sUser->sPermissions != 7)){
echo Templater::AdvancedParse($sTemplate->sValue.'/suspended', $locale->strings, array());
die();
}
if($sAction == connect){
if((!empty($_POST['hostname'])) && (!empty($_POST['port']))){
$sView = Templater::AdvancedParse($sTemplate->sValue.'/console', $locale->strings, array("connect" => "1", "VPS" => array("data" => $sVPS->uData), "Hostname" => htmlspecialchars($_POST["hostname"], ENT_QUOTES), "Port" => htmlspecialchars($_POST["port"], ENT_QUOTES)));
} else {
$sView = Templater::AdvancedParse($sTemplate->sValue.'/console', $locale->strings, array("connect" => "0", "VPS" => array("data" => $sVPS->uData)));
}
} else {
$sView = Templater::AdvancedParse($sTemplate->sValue.'/console', $locale->strings, array("connect" => "0", "VPS" => array("data" => $sVPS->uData)));
}
echo $sView;