Example #1
1
function AutoSuspendHook_OnAppvCD()
{
    if ($GLOBALS['CONFIG']['AutoSuspension'] != 'on') {
        return;
    }
    global $cron;
    $moduleName = OnAppvCDModule::MODULE_NAME;
    $qry = 'SELECT
				tblhosting.`id`,
				tblhosting.`userid`
			FROM
				tblinvoices
			LEFT JOIN tblinvoiceitems ON
				tblinvoiceitems.`invoiceid` = tblinvoices.`id`
			LEFT JOIN tblhosting ON
				tblhosting.`id` = tblinvoiceitems.`relid`
			LEFT JOIN tblproducts ON
				tblproducts.`id` = tblhosting.`packageid`
			WHERE
				tblinvoices.`status` = "Unpaid"
				AND tblinvoiceitems.`type` = "@moduleName"
				AND tblhosting.`domainstatus` = "Active"
				AND NOW() > DATE_ADD( tblinvoices.`duedate`, INTERVAL tblproducts.`configoption3` DAY )
				AND ( tblhosting.`overideautosuspend` != 1
                        OR ( tblhosting.`overidesuspenduntil` != "0000-00-00"
                            AND tblhosting.`overidesuspenduntil` <= NOW() ) )
			GROUP BY
				tblhosting.`id`';
    $qry = str_replace('@moduleName', $moduleName, $qry);
    $result = full_query($qry);
    if (!function_exists('serversuspendaccount')) {
        $path = dirname(dirname(dirname(__DIR__))) . '/includes/';
        require_once $path . 'modulefunctions.php';
    }
    $cnt = 0;
    echo 'Starting Processing ' . $moduleName . ' Suspensions', PHP_EOL;
    while ($data = mysql_fetch_assoc($result)) {
        ServerSuspendAccount($data['id']);
        echo ' - suspend service ID ', $data['id'], ', user ID ', $data['userid'], PHP_EOL;
        ++$cnt;
    }
    echo ' - Processed ', $cnt, ' Suspensions', PHP_EOL;
    $cron->emailLog($cnt . ' ' . $moduleName . ' Services Suspended');
}
Example #2
0
    if (file_exists($modulepath)) {
        require_once $modulepath;
    }
    if (function_exists($module . "_AdminCustomButtonArray")) {
        $adminbuttonarray = call_user_func($module . "_AdminCustomButtonArray");
    }
}
if ($modop == "create") {
    check_token("WHMCS.admin.default");
    $result = ServerCreateAccount($id);
    wSetCookie("ModCmdResult", $result);
    redir("userid=" . $userid . "&id=" . $id . "&act=create&ajaxupdate=1");
}
if ($modop == "suspend") {
    check_token("WHMCS.admin.default");
    $result = ServerSuspendAccount($id, $suspreason);
    wSetCookie("ModCmdResult", $result);
    if ($result == "success" && $suspemail == "true") {
        sendMessage("Service Suspension Notification", $id);
    }
    redir("userid=" . $userid . "&id=" . $id . "&act=suspend&ajaxupdate=1");
}
if ($modop == "unsuspend") {
    check_token("WHMCS.admin.default");
    $result = ServerUnsuspendAccount($id);
    wSetCookie("ModCmdResult", $result);
    redir("userid=" . $userid . "&id=" . $id . "&act=unsuspend&ajaxupdate=1");
}
if ($modop == "terminate") {
    check_token("WHMCS.admin.default");
    $result = ServerTerminateAccount($id);
Example #3
0
     $loginfo = $firstname . " " . $lastname . " - " . $name . " (Service ID: " . $serviceid . " - Addon ID: " . $id . ")";
     $cron->logActivity("SUCCESS: " . $loginfo, true);
     run_hook("AddonSuspended", array("id" => $id, "userid" => $userid, "serviceid" => $serviceid, "addonid" => $addonid));
     if ($addonid) {
         $result2 = select_query("tbladdons", "suspendproduct", array("id" => $addonid));
         $data2 = mysql_fetch_array($result2);
         $suspendproduct = $data2[0];
         if ($suspendproduct) {
             $result2 = select_query("tblproducts", "name,servertype", array("id" => $packageid));
             $data2 = mysql_fetch_array($result2);
             $prodname = $data2['name'];
             $module = $data2['servertype'];
             $serverresult = "No Module";
             logActivity("Cron Job: Suspending Parent Service - Service ID: " . $serviceid);
             if ($module) {
                 $serverresult = ServerSuspendAccount($serviceid, "Parent Service Suspended due to Overdue Addon");
             }
             if ($domain) {
                 $domain = " - " . $domain;
             }
             $loginfo = $firstname . " " . $lastname . " - " . $prodname . $domain . " (Service ID: " . $serviceid . " - User ID: " . $userid . ")";
             if ($serverresult == "success") {
                 sendMessage("Service Suspension Notification", $serviceid);
                 $cron->emailLogSub("SUCCESS: " . $loginfo, true);
             } else {
                 $cron->emailLogSub("ERROR: Manual Parent Service Suspension Required - " . $serverresult . " - " . $loginfo, true);
             }
         }
     }
     ++$i;
 }
Example #4
0
 $moduleresults = array();
 if ($masscreate) {
     checkPermission("Perform Server Operations");
     foreach ($selproducts as $serviceid) {
         $modresult = ServerCreateAccount($serviceid);
         if ($modresult != "success") {
             $moduleresults[] = "Service ID " . $serviceid . ": " . $modresult;
             continue;
         }
         $moduleresults[] = "Service ID " . $serviceid . ": " . $aInt->lang("services", "createsuccess");
     }
 }
 if ($masssuspend) {
     checkPermission("Perform Server Operations");
     foreach ($selproducts as $serviceid) {
         $modresult = ServerSuspendAccount($serviceid);
         if ($modresult != "success") {
             $moduleresults[] = "Service ID " . $serviceid . ": " . $modresult;
             continue;
         }
         $moduleresults[] = "Service ID " . $serviceid . ": " . $aInt->lang("services", "suspendsuccess");
     }
 }
 if ($massunsuspend) {
     checkPermission("Perform Server Operations");
     foreach ($selproducts as $serviceid) {
         $modresult = ServerUnsuspendAccount($serviceid);
         if ($modresult != "success") {
             $moduleresults[] = "Service ID " . $serviceid . ": " . $modresult;
             continue;
         }
Example #5
0
<?php

/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
if (!defined("WHMCS")) {
    exit("This file cannot be accessed directly");
}
if (!function_exists("ServerSuspendAccount")) {
    require ROOTDIR . "/includes/modulefunctions.php";
}
$result = select_query("tblhosting", "packageid", array("id" => $_POST['accountid']));
$data = mysql_fetch_array($result);
$packageid = $data['packageid'];
$result = ServerSuspendAccount($_POST['accountid'], $_POST['suspendreason']);
if ($result == "success") {
    $apiresults = array("result" => "success");
    return 1;
}
$apiresults = array("result" => "error", "message" => $result);