function vpn_hooks($vars) { if ($_GET['a'] != 'vpn') { return; } $var = array(); $var['menu'] = "<a href='clientarea.php?action=productdetails&id={$_GET['id']}'>{$vars['domain']}</a>"; $var['error'] = 'none'; $var['password'] = ''; $var['ruid'] = $vars['ruid']; $var['rid'] = APIClient::resellerID(ION_API); $var['hashruid'] = ion_mcrypt($var['ruid']); if (isset($_POST['password'], $_POST['userid'])) { $var['password'] = trim($_POST['password']); if (strlen($var['password']) < 6) { $var['error'] = 'password'; } else { $var['uid'] = ion_decrypt(urldecode($_POST['userid'])); $result = APIClient::resellerSetVPN(ION_API, array('password' => $var['password'], 'userID' => $var['uid'])); if (is_array($result)) { $var['error'] = 'failed'; $var['msg'] = $result['error']['message']; } else { $var['error'] = 'success'; } } } $var['content'] = ''; if (trim(DOWNLOAD_VPN) != '#') { $var['content'] = '<a style="margin-bottom: 20px;" href="' . DOWNLOAD_VPN . '">Download VPN</a><hr>'; } if (trim(LINUX_VPN) != '#' || trim(WIN_VPN) != '#' || trim(MAC_VPN) != '#') { $var['content'] .= '<h4>How to Connect:</h4>'; $var['content'] .= trim(LINUX_VPN) != '#' && trim(LINUX_VPN) != '' ? '<p><a href="' . LINUX_VPN . '">Linux</a></p>' : ''; $var['content'] .= trim(WIN_VPN) != '#' && trim(WIN_VPN) != '' ? '<p><a href="' . WIN_VPN . '">Windows</a></p>' : ''; $var['content'] .= trim(MAC_VPN) != '#' && trim(MAC_VPN) != '' ? '<p><a href="' . MAC_VPN . '">Mac</a></p>' : ''; } return $var; }
<?php /** * WHMCS v6 Module for HugeServer Resellers * * @author HugeServer Networks, LLC - Development Team */ include "config.php"; require_once __DIR__ . "/functions.php"; include "api.php"; if (!isset($_GET['sid'])) { die('Argument missing'); } $sid = (int) trim(ion_decrypt($_GET['sid'])); $res = APIClient::serverReboot(ION_API, array('serverID' => $sid)); if ($res) { header("Location: " . $_SERVER['HTTP_REFERER'] . "&reboot=success"); } else { header("Location: " . $_SERVER['HTTP_REFERER'] . "&reboot=failed"); }
/** * WHMCS v6 Module for HugeServer Resellers * * @author HugeServer Networks, LLC - Development Team */ include_once 'config.php'; include "functions.php"; include "api.php"; include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '../../../configuration.php'; header("Cache-Control: no-cache, must-revalidate"); $db_conn = mysql_connect($db_host, $db_username, $db_password); if (!$db_conn) { throw new Exception('Unable to connect to DB'); } $db_select = @mysql_select_db($db_name, $db_conn); if (!$db_select) { throw new Exception('Unable to select WHMCS database'); } if (!isset($_GET['pid'])) { throw new Exception('Argument missing'); } $wid = trim(ion_decrypt($_GET['pid'])); $query = "SELECT ion_sid from ion_module WHERE whmcs_sid = '{$wid}'"; $result = mysql_query($query); if (mysql_num_rows($result) < 1 || strlen($wid) > 5) { die("not found"); } $sid = mysql_fetch_array($result)[0]; $period = isset($_GET['period']) ? $_GET['period'] : 'hour'; header('Content-Type: image/PNG'); echo APIClient::serverGraph(ION_API, array('serverID' => $sid, 'period' => $period, 'title' => $_GET['title']));
<?php /** * WHMCS v6 Module for HugeServer Resellers * * @author HugeServer Networks, LLC - Development Team */ include "config.php"; require_once __DIR__ . "/functions.php"; include_once "api.php"; if (!isset($_GET['sid'])) { die('Argument missing'); } APIClient::$file = true; APIClient::$fileContentType = "application/x-java-jnlp-file"; APIClient::$fileName = "IPMI-{$_GET['hostname']}.jnlp"; $sid = (int) ion_decrypt($_GET['sid']); echo APIClient::serverIPMI(ION_API, array('serverID' => $sid));