<?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");
}
Пример #2
0
function ion_reboot($params)
{
    $result = select_query('ion_module', 'ion_sid', array('whmcs_sid' => $params['serviceid']));
    $ion_sid = 0;
    if (mysql_num_rows($result) > 0) {
        $ion_sid = mysql_fetch_array($result)[0];
    }
    if ($ion_sid == 0) {
        return;
    }
    if (APIClient::serverReboot(ION_API, array('serverID' => $ion_sid))) {
        return 'success';
    } else {
        return 'Error. please try again.';
    }
}