コード例 #1
0
function loadRegistrarModule($registrar)
{
    if (!function_exists($registrar . "_getConfigArray")) {
        $registrar = get_query_val("tblregistrars", "registrar", array("registrar" => $registrar));
        if (!$registrar) {
            return false;
        }
        if (!isValidforPath($registrar)) {
            exit("Invalid Registrar Module Name");
        }
        if (!function_exists($registrar . "_getConfigArray")) {
            $regpath = ROOTDIR . "/modules/registrars/" . $registrar . "/" . $registrar . ".php";
            if (file_exists($regpath)) {
                require_once $regpath;
            }
        }
    }
    return true;
}
コード例 #2
0
ファイル: fraudfunctions.php プロジェクト: billyprice1/whmcs
function runFraudCheck($orderid, $fraudmodule, $userid = "", $ip = "")
{
    if (!isValidforPath($fraudmodule)) {
        exit("Invalid Fraud Module Name");
    }
    if (!function_exists("doFraudCheck")) {
        include ROOTDIR . ("/modules/fraud/" . $fraudmodule . "/" . $fraudmodule . ".php");
    }
    $params = getFraudParams($fraudmodule, $userid, $ip);
    $results = doFraudCheck($params);
    $fraudoutput = "";
    if ($results) {
        foreach ($results as $key => $value) {
            if ($key != "userinput" && $key != "title" && $key != "description" && $key != "error") {
                $fraudoutput .= "" . $key . " => " . $value . "\r\n";
                continue;
            }
        }
    }
    update_query("tblorders", array("fraudmodule" => $fraudmodule, "fraudoutput" => $fraudoutput), array("id" => $orderid));
    $results['fraudoutput'] = $fraudoutput;
    return $results;
}
コード例 #3
0
ファイル: configproducts.php プロジェクト: billyprice1/whmcs
     while ($data2 = mysql_fetch_array($result2)) {
         $groupid = $data2['id'];
         $groupname = $data2['name'];
         echo "<option value=\"" . $groupid . "\"";
         if ($groupid == $servergroup) {
             echo " selected";
         }
         echo ">" . $groupname . "</option>";
     }
     echo "</select>";
     echo "</td></tr>\n";
 }
 echo "</table>\n\n<br>\n\n";
 if ($servertype && in_array($servertype, $modulesarray)) {
     echo "\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\"><tr>\n";
     if (!isValidforPath($servertype)) {
         exit("Invalid Server Module Name");
     }
     include "../modules/servers/" . $servertype . "/" . $servertype . ".php";
     if (function_exists($servertype . "_ConfigOptions")) {
         $configarray = call_user_func($servertype . "_ConfigOptions");
         $i = 0;
         foreach ($configarray as $key => $values) {
             ++$i;
             if (!$values['FriendlyName']) {
                 $values['FriendlyName'] = $key;
             }
             $values['Name'] = "packageconfigoption[" . $i . "]";
             $values['Value'] = $packageconfigoption[$i];
             echo "<td class=\"fieldlabel\">" . $values['FriendlyName'] . "</td><td class=\"fieldarea\">" . moduleConfigFieldOutput($values) . "</td>";
             if ($i % 2) {
コード例 #4
0
ファイル: knowledgebase.php プロジェクト: billyprice1/whmcs
$breadcrumbnav = "<a href=\"" . $CONFIG['SystemURL'] . "/index.php\">" . $_LANG['globalsystemname'] . "</a> > <a href=\"" . $CONFIG['SystemURL'] . "/knowledgebase.php\">" . $_LANG['knowledgebasetitle'] . "</a>";
$pageicon = "images/knowledgebase_big.gif";
initialiseClientArea($pagetitle, $pageicon, $breadcrumbnav);
$action = $whmcs->get_req_var("action");
$kbcats = $kbmostviews = $kbarticles = array();
if (isset($catid) && !is_numeric($catid)) {
    redir("", $CONFIG['SystemURL'] . "/knowledgebase.php");
    exit;
}
if (isset($id) && !is_numeric($id)) {
    redir("", $CONFIG['SystemURL'] . "/knowledgebase.php");
    exit;
}
$usingsupportmodule = false;
if ($CONFIG['SupportModule']) {
    if (!isValidforPath($CONFIG['SupportModule'])) {
        exit("Invalid Support Module");
    }
    $supportmodulepath = "modules/support/" . $CONFIG['SupportModule'] . "/knowledgebase.php";
    if (file_exists($supportmodulepath)) {
        $usingsupportmodule = true;
        $templatefile = "";
        require $supportmodulepath;
        outputClientArea($templatefile);
        exit;
    }
}
if ($action == "search" && $searchin == "Downloads") {
    redir("action=search&search=" . $search, $CONFIG['SystemURL'] . "/downloads.php");
    exit;
}
コード例 #5
0
ファイル: accessdenied.php プロジェクト: billyprice1/whmcs
 **/
define("ADMINAREA", true);
require "../init.php";
$adminfolder = $whmcs->get_admin_folder_name();
$adminpermsarray = getAdminPermsArray();
if (!$adminpermsarray[$permid]) {
    exit;
}
$result = select_query("tbladmins", "language", array("id" => $_SESSION['adminid']));
$data = mysql_fetch_array($result);
$language = $data['language'];
$_ADMINLANG = array();
if ($_SESSION['adminlang']) {
    $language = $_SESSION['adminlang'];
}
if (!isValidforPath($language)) {
    exit("Invalid Admin Language Name");
}
$langfilepath = ROOTDIR . "/" . $adminfolder . "/lang/" . $language . ".php";
if (file_exists($langfilepath)) {
    include $langfilepath;
} else {
    include ROOTDIR . "/" . $adminfolder . "/lang/english.php";
}
logActivity("Access Denied to " . $adminpermsarray[$permid]);
echo "\n<html>\n<head>\n<title>WHMCS - ";
echo $_ADMINLANG['permissions']['accessdenied'];
echo "</title>\n<link href=\"templates/original/style.css\" rel=\"stylesheet\" type=\"text/css\" />\n</head>\n<body>\n\n<br /><br /><br /><br /><br />\n<p align=\"center\" style=\"font-size:24px;\">";
echo $_ADMINLANG['permissions']['accessdenied'];
echo "</p>\n<p align=\"center\" style=\"font-size:18px;color:#FF0000;\">";
echo $_ADMINLANG['permissions']['nopermission'];
コード例 #6
0
ファイル: configservers.php プロジェクト: billyprice1/whmcs
     $type = $data['type'];
     $disabled = $data['disabled'];
     $active = $active ? "*" : "";
     $result2 = select_query("tblhosting", "COUNT(*)", "server='" . $id . "' AND (domainstatus='Active' OR domainstatus='Suspended')");
     $data = mysql_fetch_array($result2);
     $numaccounts = $data[0];
     $percentuse = @round($numaccounts / $maxaccounts * 100, 0);
     $params = array();
     $params['serverip'] = $ipaddress;
     $params['serverhostname'] = $hostname;
     $params['serverusername'] = $username;
     $params['serverpassword'] = $password;
     $params['serversecure'] = $secure;
     $params['serveraccesshash'] = $accesshash;
     if (in_array($type, $modulesarray)) {
         if (!isValidforPath($type)) {
             exit("Invalid Server Module Name");
         }
         require_once "../modules/servers/" . $type . "/" . $type . ".php";
         $adminlogincode = function_exists($type . "_AdminLink") ? call_user_func($type . "_AdminLink", $params) : "-";
     } else {
         $adminlogincode = $aInt->lang("global", "modulefilemissing");
     }
     if ($disabled) {
         $disableddata[] = array("<i>" . $name . " (" . $aInt->lang("emailtpls", "disabled") . ")</i>", "<i>" . $ipaddress . "</i>", "<i>" . $numaccounts . "/" . $maxaccounts . "</i>", "<i>" . $percentuse . "%</i>", $adminlogincode, "<div align=\"center\"><a href=\"" . $PHP_SELF . "?sub=enable&id=" . $id . generate_token("link") . "\" title=\"" . $aInt->lang("configservers", "enableserver") . "\"><img src=\"images/icons/disabled.png\"></a></div>", "<a href=\"" . $PHP_SELF . "?action=manage&id=" . $id . "\" title=\"" . $aInt->lang("global", "edit") . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Edit\"></a>", "<a href=\"#\" onClick=\"doDelete('" . $id . "');return false\" title=\"" . $aInt->lang("global", "delete") . "\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "delete") . "\"></a>");
     }
     $tabledata[] = array("<a href=\"" . $PHP_SELF . "?sub=makedefault&id=" . $id . generate_token("link") . "\" title=\"" . $aInt->lang("configservers", "defaultsignups") . ("\">" . $name . "</a> " . $active), $ipaddress, "" . $numaccounts . "/" . $maxaccounts, "" . $percentuse . "%", $adminlogincode, "<div align=\"center\"><a href=\"" . $PHP_SELF . "?sub=disable&id=" . $id . generate_token("link") . "\" title=\"" . $aInt->lang("configservers", "disableserver") . "\"><img src=\"images/icons/tick.png\"></a></div>", "<a href=\"" . $PHP_SELF . "?action=manage&id=" . $id . "\" title=\"" . $aInt->lang("global", "edit") . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "edit") . "\"></a>", "<a href=\"#\" onClick=\"doDelete('" . $id . "');return false\" title=\"" . $aInt->lang("global", "delete") . "\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "delete") . "\"></a>");
 }
 foreach ($disableddata as $data) {
     $tabledata[] = $data;
 }
コード例 #7
0
function CALinkUpdateCC()
{
    global $CONFIG;
    $result = select_query("tblpaymentgateways", "gateway", array("setting" => "type", "value" => "CC"));
    while ($data = mysql_fetch_array($result)) {
        $gateway = $data['gateway'];
        if (!isValidforPath($gateway)) {
            exit("Invalid Gateway Module Name");
        }
        if (file_exists(ROOTDIR . ("/modules/gateways/" . $gateway . ".php"))) {
            require_once ROOTDIR . ("/modules/gateways/" . $gateway . ".php");
        }
        if (function_exists($gateway . "_remoteupdate")) {
            $_SESSION['calinkupdatecc'] = 1;
            return true;
        }
    }
    if (!$CONFIG['CCNeverStore']) {
        $result = select_query("tblpaymentgateways", "COUNT(*)", "setting='type' AND (value='CC' OR value='OfflineCC')");
        $data = mysql_fetch_array($result);
        if ($data[0]) {
            $_SESSION['calinkupdatecc'] = 1;
            return true;
        }
    }
    $_SESSION['calinkupdatecc'] = 0;
    return false;
}
コード例 #8
0
ファイル: class.orders.php プロジェクト: billyprice1/whmcs
 private function changeStatus($orderid, $status)
 {
     if (!$orderid) {
         return false;
     }
     $orderid = (int) $orderid;
     if ($status == "Cancelled") {
         run_hook("CancelOrder", array("orderid" => $orderid));
     } else {
         if ($status == "Fraud") {
             run_hook("FraudOrder", array("orderid" => $orderid));
         } else {
             if ($status == "Pending") {
                 run_hook("PendingOrder", array("orderid" => $orderid));
             }
         }
     }
     update_query("tblorders", array("status" => $status), array("id" => $orderid));
     if ($status == "Cancelled" || $status == "Fraud") {
         $result = select_query("tblhosting", "tblhosting.id,tblhosting.domainstatus,tblproducts.servertype,tblhosting.packageid,tblproducts.stockcontrol,tblproducts.qty", array("orderid" => $orderid), "", "", "", "tblproducts ON tblproducts.id=tblhosting.packageid");
         while ($data = mysql_fetch_array($result)) {
             $productid = $data['id'];
             $prodstatus = $data['domainstatus'];
             $module = $data['servertype'];
             $packageid = $data['packageid'];
             $stockcontrol = $data['stockcontrol'];
             $qty = $data['qty'];
             if ($module && ($prodstatus == "Active" || $prodstatus == "Suspended")) {
                 logActivity("Running Module Terminate on Order Cancel");
                 if (!isValidforPath($module)) {
                     exit("Invalid Server Module Name");
                 }
                 require_once ROOTDIR . ("/modules/servers/" . $module . "/" . $module . ".php");
                 $moduleresult = ServerTerminateAccount($productid);
                 if ($moduleresult == "success") {
                     update_query("tblhosting", array("domainstatus" => $status), array("id" => $productid));
                     if ($stockcontrol == "on") {
                         update_query("tblproducts", array("qty" => "+1"), array("id" => $packageid));
                     }
                 }
             }
             update_query("tblhosting", array("domainstatus" => $status), array("id" => $productid));
             if ($stockcontrol == "on") {
                 update_query("tblproducts", array("qty" => "+1"), array("id" => $packageid));
             }
         }
     } else {
         update_query("tblhosting", array("domainstatus" => $status), array("orderid" => $orderid));
     }
     update_query("tblhostingaddons", array("status" => $status), array("orderid" => $orderid));
     if ($status == "Pending") {
         $result = select_query("tbldomains", "id,type", array("orderid" => $orderid));
         while ($data = mysql_fetch_assoc($result)) {
             if ($data['type'] == "Transfer") {
                 $status = "Pending Transfer";
             } else {
                 $status = "Pending";
             }
             update_query("tbldomains", array("status" => $status), array("id" => $data['id']));
         }
     } else {
         update_query("tbldomains", array("status" => $status), array("orderid" => $orderid));
     }
     $result = select_query("tblorders", "userid,invoiceid", array("id" => $orderid));
     $data = mysql_fetch_array($result);
     $userid = $data['userid'];
     $invoiceid = $data['invoiceid'];
     if ($status == "Pending") {
         update_query("tblinvoices", array("status" => "Unpaid"), array("id" => $invoiceid, "status" => "Cancelled"));
     } else {
         update_query("tblinvoices", array("status" => "Cancelled"), array("id" => $invoiceid, "status" => "Unpaid"));
         run_hook("InvoiceCancelled", array("invoiceid" => $invoiceid));
     }
     logActivity("Order Status set to " . $status . " - Order ID: " . $orderid, $userid);
 }
コード例 #9
0
ファイル: configgateways.php プロジェクト: billyprice1/whmcs
$GatewayValues = $GatewayConfig = $ActiveGateways = $DisabledGateways = array();
$result = select_query("tblpaymentgateways", "", "", "setting", "ASC");
while ($data = mysql_fetch_array($result)) {
    $gwv_gateway = $data['gateway'];
    $gwv_setting = $data['setting'];
    $gwv_value = $data['value'];
    $GatewayValues[$gwv_gateway][$gwv_setting] = $gwv_value;
}
$includedmodules = array();
$dh = opendir("../modules/gateways/");
while (false !== ($file = readdir($dh))) {
    $fileext = explode(".", $file, 2);
    if (trim($file) && $file != "index.php" && $fileext[1] == "php" && !in_array($fileext[0], $includedmodules)) {
        $includedmodules[] = $fileext[0];
        $gwv_modulename = $fileext[0];
        if (!isValidforPath($fileext[0])) {
            exit("Invalid Gateway Module Name");
        }
        require_once ROOTDIR . "/modules/gateways/" . $fileext[0] . ".php";
        if (isset($GatewayValues[$gwv_modulename]['type'])) {
            $ActiveGateways[] = $gwv_modulename;
        } else {
            $DisabledGateways[] = $gwv_modulename;
        }
        if (function_exists($gwv_modulename . "_config")) {
            $GatewayConfig[$gwv_modulename] = call_user_func($gwv_modulename . "_config");
        } else {
            $GatewayFieldDefines = array();
            $GatewayFieldDefines['FriendlyName'] = array("Type" => "System", "Value" => $GATEWAYMODULE[$gwv_modulename . "visiblename"]);
            if ($GATEWAYMODULE[$gwv_modulename . "notes"]) {
                $GatewayFieldDefines['UsageNotes'] = array("Type" => "System", "Value" => $GATEWAYMODULE[$gwv_modulename . "notes"]);
コード例 #10
0
ファイル: configfraud.php プロジェクト: billyprice1/whmcs
$aInt->title = $aInt->lang("fraud", "title");
$aInt->sidebar = "config";
$aInt->icon = "configbans";
$aInt->helplink = "Fraud Protection";
$aInt->requiredFiles(array("fraudfunctions", "modulefunctions"));
ob_start();
$fraudmodules = array();
$dh = opendir(ROOTDIR . "/modules/fraud/");
while (false !== ($file = readdir($dh))) {
    if (is_file(ROOTDIR . ("/modules/fraud/" . $file . "/" . $file . ".php"))) {
        $fraudmodules[] = $file;
    }
}
closedir($dh);
if ($fraud && in_array($fraud, $fraudmodules)) {
    if (!isValidforPath($fraud)) {
        exit("Invalid Fraud Module Name");
    }
    include "../modules/fraud/" . $fraud . "/" . $fraud . ".php";
    $configarray = getConfigArray();
    foreach ($configarray as $regconfoption => $values) {
        $result = select_query("tblfraud", "", array("fraud" => $fraud, "setting" => $regconfoption));
        $num_rows = mysql_num_rows($result);
        if ($num_rows == "0") {
            insert_query("tblfraud", array("fraud" => $fraud, "setting" => $regconfoption, "value" => $values['Value']));
            continue;
        }
    }
    if ($action == "save") {
        check_token("WHMCS.admin.default");
        foreach ($configarray as $regconfoption => $values) {
コード例 #11
0
ファイル: api.php プロジェクト: billyprice1/whmcs
             insert_query("tblbannedips", array("ip" => $remote_ip, "reason" => "3 Invalid API Login Attempts", "expires" => $expire_date));
             update_query("tbladmins", array("loginattempts" => "0"), array("username" => $_POST['username']));
         }
         update_query("tbladmins", array("loginattempts" => "+1"), array("username" => $_POST['username']));
         $apiresults = array("result" => "error", "message" => "Authentication Failed");
         $allowed = false;
     } else {
         $_SESSION['adminid'] = $adminid;
         if (!checkPermission("API Access", true)) {
             $apiresults = array("result" => "error", "message" => "Access Denied");
             $allowed = false;
         }
     }
 }
 if ($allowed) {
     if (isValidforPath($action)) {
         switch ($action) {
             case "adduser":
                 $action = "addclient";
                 break;
             case "getclientsdata":
             case "getclientsdatabyemail":
                 $action = "getclientsdetails";
         }
         if (file_exists(ROOTDIR . "/includes/api/" . $action . ".php")) {
             include ROOTDIR . "/includes/api/" . $action . ".php";
         } else {
             $apiresults = array("result" => "error", "message" => "Command Not Found");
         }
     } else {
         $apiresults = array("result" => "error", "message" => "Invalid API Command Value");
コード例 #12
0
ファイル: functions.php プロジェクト: billyprice1/whmcs
 function localAPI($cmd, $apivalues1, $adminuser = "")
 {
     global $whmcs;
     global $CONFIG;
     global $_LANG;
     global $currency;
     if (!$adminuser && !$_SESSION['adminid']) {
         return array("result" => "error", "message" => "Admin User var is required if no admin is logged in");
     }
     if (!is_array($apivalues1)) {
         $apivalues1 = array();
     }
     $startadminid = $_SESSION['adminid'] ? $_SESSION['adminid'] : "";
     if ($adminuser) {
         if (is_numeric($adminuser)) {
             $where = array("id" => $adminuser);
         } else {
             $where = array("username" => $adminuser);
         }
         $result = select_query("tbladmins", "id", $where);
         $data = mysql_fetch_array($result);
         $adminid = $data['id'];
         if (!$adminid) {
             return array("result" => "error", "message" => "No matching admin user found");
         }
         $_SESSION['adminid'] = $adminid;
     }
     $_POSTbackup = $_POST;
     $_REQUESTbackup = $_REQUEST;
     $_POST = $_REQUEST = array();
     foreach ($apivalues1 as $k => $v) {
         ${$k} = $_REQUEST[$k] = $_POST[$k] = $v;
     }
     $whmcs->replace_input($apivalues1);
     $cmd = strtolower($cmd);
     if (!isValidforPath($cmd) || !file_exists(ROOTDIR . "/includes/api/" . $cmd . ".php")) {
         return array("result" => "error", "message" => "Invalid API Command");
     }
     require ROOTDIR . "/includes/api/" . $cmd . ".php";
     foreach ($apivalues1 as $k => $v) {
         unset(${$k});
     }
     $whmcs->reset_input();
     $_POST = $_POSTbackup;
     $_REQUEST = $_REQUESTbackup;
     if ($startadminid) {
         $_SESSION['adminid'] = $startadminid;
     } else {
         unset($_SESSION['adminid']);
     }
     return $apiresults;
 }
コード例 #13
0
ファイル: ccfunctions.php プロジェクト: billyprice1/whmcs
/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
function updateCCDetails($userid, $cardtype, $cardnum, $cardcvv, $cardexp, $cardstart, $cardissue, $noremotestore = "", $fullclear = "")
{
    global $CONFIG;
    global $_LANG;
    global $cc_encryption_hash;
    $gatewayid = get_query_val("tblclients", "gatewayid", array("id" => $userid));
    if ($fullclear) {
        update_query("tblclients", array("cardtype" => "", "cardlastfour" => "", "cardnum" => "", "expdate" => "", "startdate" => "", "issuenumber" => "", "gatewayid" => ""), array("id" => $userid));
    }
    $cardnum = ccFormatNumbers($cardnum);
    $cardexp = ccFormatNumbers($cardexp);
    $cardstart = ccFormatNumbers($cardstart);
    $cardissue = ccFormatNumbers($cardissue);
    $cardexp = ccFormatDate($cardexp);
    ccFormatDate($cardstart);
    $cardcvv = ccFormatNumbers($cardcvv);
    if ($cardtype) {
        $errormessage = checkCreditCard($cardnum, $cardtype);
        if (!$cardexp || strlen($cardexp) != 4) {
            $errormessage .= "<li>" . $_LANG['creditcardenterexpirydate'];
        } else {
            if (substr($cardexp, 0, 2) < date("m") && "20" . substr($cardexp, 2) <= date("Y")) {
                $errormessage .= "<li>" . $_LANG['creditcardexpirydateinvalid'];
            }
        }
    }
    if ($errormessage) {
        return $errormessage;
    }
    if (!$userid) {
        return "";
    }
    if ($noremotestore) {
        return "";
    }
    if ($CONFIG['CCNeverStore']) {
        return "";
    }
    $remotestored = false;
    $result = select_query("tblpaymentgateways", "gateway,(SELECT id FROM tblinvoices WHERE paymentmethod=gateway AND userid='" . (int) $userid . "' ORDER BY id DESC LIMIT 0,1) AS invoiceid", "setting='type' AND (value='CC' OR value='OfflineCC')");
    while ($data = mysql_fetch_array($result)) {
        $gateway = $data['gateway'];
        $invoiceid = $data['invoiceid'];
        if ($invoiceid) {
            if (!isValidforPath($gateway)) {
                exit("Invalid Gateway Module Name");
            }
            require_once ROOTDIR . ("/modules/gateways/" . $gateway . ".php");
            if (function_exists($gateway . "_storeremote")) {
                $rparams = getCCVariables($invoiceid);
                $rparams['cardtype'] = $cardtype;
                $rparams['cardnum'] = $cardnum;
                $rparams['cardcvv'] = $cardcvv;
                $rparams['cardexp'] = $cardexp;
                $rparams['cardstart'] = $cardstart;
                $rparams['cardissuenum'] = $cardissue;
                $rparams['gatewayid'] = $gatewayid;
                $action = "create";
                if ($rparams['gatewayid']) {
                    if ($rparams['cardnum']) {
                        $action = "update";
                    } else {
                        $action = "delete";
                    }
                }
                $rparams['action'] = $action;
                $captureresult = call_user_func($gateway . "_storeremote", $rparams);
                $result = select_query("tblpaymentgateways", "value", array("gateway" => $rparams['paymentmethod'], "setting" => "name"));
                $data = mysql_fetch_array($result);
                $gatewayname = $data['value'] . " Remote Storage";
                $debugdata = is_array($captureresult['rawdata']) ? array_merge(array("UserID" => $rparams['clientdetails']['userid']), $captureresult['rawdata']) : "UserID => " . $rparams['clientdetails']['userid'] . "\r\n" . $captureresult['rawdata'];
                if ($captureresult['status'] == "success") {
                    if (isset($captureresult['gatewayid'])) {
                        update_query("tblclients", array("gatewayid" => $captureresult['gatewayid']), array("id" => $userid));
                    }
                    if ($action == "delete") {
                        update_query("tblclients", array("cardtype" => "", "cardlastfour" => "", "cardnum" => "", "expdate" => "", "startdate" => "", "issuenumber" => "", "gatewayid" => ""), array("id" => $userid));
                    }
                    logTransaction($gatewayname, $debugdata, "Success");
                } else {
                    logTransaction($gatewayname, $debugdata, ucfirst($captureresult['status']));
                    return "<li>Remote Transaction Failure. Please Contact Support.";
                }
                $remotestored = true;
            }
        }
    }
    $cchash = md5($cc_encryption_hash . $userid);
    $cardstart = "";
    $cardlastfour = substr($cardnum, 0 - 4);
    if ($remotestored) {
        $cardnum = "";
    }
    update_query("tblclients", array("cardtype" => $cardtype, "cardlastfour" => $cardlastfour, "cardnum" => array("type" => "AES_ENCRYPT", "text" => $cardnum, "hashkey" => $cchash), "expdate" => array("type" => "AES_ENCRYPT", "text" => $cardexp, "hashkey" => $cchash), "startdate" => array("type" => "AES_ENCRYPT", "text" => $cardstart, "hashkey" => $cchash), "issuenumber" => array("type" => "AES_ENCRYPT", "text" => $cardissue, "hashkey" => $cchash)), array("id" => $userid));
    logActivity("Updated Stored Credit Card Details - User ID: " . $userid, $userid);
    run_hook("CCUpdate", array("userid" => $userid, "cardtype" => $cardtype, "cardnum" => $cardnum, "cardcvv" => $cardcvv, "expdate" => $cardexp, "cardstart" => $cardstart, "issuenumber" => $cardissue));
}
コード例 #14
0
ファイル: orderfunctions.php プロジェクト: billyprice1/whmcs
function getAvailableOrderPaymentGateways()
{
    $disabledgateways = "";
    if ($_SESSION['cart']['products']) {
        foreach ($_SESSION['cart']['products'] as $values) {
            $result = select_query("tblproducts", "gid", array("id" => $values['pid']));
            $data = mysql_fetch_array($result);
            $gid = $data['gid'];
            $result = select_query("tblproductgroups", "disabledgateways", array("id" => $gid));
            $data = mysql_fetch_array($result);
            $disabledgateways .= $data['disabledgateways'];
        }
    }
    $disabledgateways = explode(",", $disabledgateways);
    if (!function_exists("showPaymentGatewaysList")) {
        require ROOTDIR . "/includes/gatewayfunctions.php";
    }
    $gatewayslist = showPaymentGatewaysList($disabledgateways);
    foreach ($gatewayslist as $module => $vals) {
        if ($vals['type'] == "CC" || $vals['type'] == "OfflineCC") {
            if (!isValidforPath($module)) {
                exit("Invalid Gateway Module Name");
            }
            $gatewaypath = ROOTDIR . "/modules/gateways/" . $module . ".php";
            if (file_exists($gatewaypath)) {
                if (!function_exists($module . "_config") && !function_exists($module . "_link") && !function_exists($module . "_capture")) {
                    require_once $gatewaypath;
                }
            }
            if (function_exists($module . "_nolocalcc")) {
                $gatewayslist[$module]['type'] = "Invoices";
                continue;
            }
            continue;
        }
    }
    return $gatewayslist;
}
コード例 #15
0
ファイル: clientarea.php プロジェクト: billyprice1/whmcs
         }
         continue;
     }
 }
 if ($geninvoice) {
     foreach ($xmasspays as $iid => $vals) {
         update_query("tblinvoices", array("status" => "Cancelled"), array("id" => (int) $iid, "userid" => $client->getID()));
     }
     require "includes/processinvoices.php";
     $invoiceid = createInvoices($client->getID(), true, true);
     $invoiceid = (int) $invoiceid;
     $result = select_query("tblpaymentgateways", "value", array("gateway" => $paymentmethod, "setting" => "type"));
     $data = mysql_fetch_array($result);
     $gatewaytype = $data['value'];
     if ($gatewaytype == "CC" || $gatewaytype == "OfflineCC") {
         if (!isValidforPath($paymentmethod)) {
             exit("Invalid Payment Gateway Name");
         }
         $gatewaypath = ROOTDIR . "/modules/gateways/" . $paymentmethod . ".php";
         if (file_exists($gatewaypath)) {
             require_once $gatewaypath;
         }
         if (!function_exists($paymentmethod . "_link")) {
             redir("invoiceid=" . (int) $invoiceid, "creditcard.php");
         }
     }
     $result = select_query("tblinvoices", "", array("userid" => $client->getID(), "id" => $invoiceid));
     $data = mysql_fetch_array($result);
     $id = $data['id'];
     $total = $data['total'];
     $paymentmethod = $data['paymentmethod'];
コード例 #16
0
ファイル: orders.php プロジェクト: billyprice1/whmcs
 echo "\" onClick=\"pendingOrder()\" class=\"btn\" /></td>\n<td><input type=\"button\" value=\"";
 echo $aInt->lang("orders", "delete");
 echo "\" onClick=\"deleteOrder()\" class=\"btn\" style=\"color:#cc0000;\" /></td>\n</tr></table>\n\n";
 if (trim($nameservers[0])) {
     echo "<p><b>" . $aInt->lang("orders", "nameservers") . "</b></p><p>";
     foreach ($nameservers as $key => $ns) {
         if (trim($ns)) {
             echo $aInt->lang("domains", "nameserver") . " " . ($key + 1) . ": " . $ns . "<br />";
             continue;
         }
     }
     echo "</p>";
 }
 echo "<div id=\"notesholder\"" . ($notes ? "" : " style=\"display:none\"") . "><p><b>" . $aInt->lang("orders", "notes") . "</b></p><p align=\"center\"><table align=\"center\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><textarea rows=\"4\" cols=\"100\" id=\"notes\">" . $notes . "</textarea></td><td>&nbsp;&nbsp; <input type=\"button\" value=\"Update/Save\" id=\"savenotesbtn\" /></td></tr></table></p></div>";
 if ($fraudmodule) {
     if (!isValidforPath($fraudmodule)) {
         exit("Invalid Fraud Module Name");
     }
     include "../modules/fraud/" . $fraudmodule . "/" . $fraudmodule . ".php";
     $fraudresults = getResultsArray($fraudoutput);
     if ($fraudresults) {
         if ($fraudmodule == "maxmind") {
             echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><p><b>" . $aInt->lang("orders", "fraudcheckresults") . "</b></p></td><td align=\"right\"><div id=\"rerunfraud\"><a href=\"#\">" . $aInt->lang("orders", "fraudcheckrerun") . "</a></div></td></tr></table><br />";
         } else {
             "<p><b>" . $aInt->lang("orders", "fraudcheckresults") . "</b></p>";
         }
         echo "<div id=\"fraudresults\"><table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\"><tr>";
         $i = 0;
         foreach ($fraudresults as $key => $value) {
             ++$i;
             echo "<td class=\"fieldlabel\" width=\"30%\">" . $key . "</td><td class=\"fieldarea\"";
コード例 #17
0
ファイル: class.init.php プロジェクト: billyprice1/whmcs
 public function get_sys_tpl_name()
 {
     $tpl = $this->get_config("Template");
     if (isValidforPath($tpl)) {
         return $tpl;
     }
     return "default";
 }
コード例 #18
0
}
echo $infobox;
$aInt->deleteJSConfirm("deactivateMod", "domainregistrars", "deactivatesure", $_SERVER['PHP_SELF'] . "?action=deactivate&module=");
$jscode .= "function showConfig(module) {\n    \$(\"#\"+module+\"config\").fadeToggle();\n}\n";
echo "<div class=\"tablebg\">\n<table class=\"datatable\" width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"3\">\n<tr><th width=\"140\"></th><th>" . $aInt->lang("addonmodules", "module") . "</th><th width=\"350\"></th></tr>";
$modulesarray = array();
$dh = opendir("../modules/registrars/");
while (false !== ($file = readdir($dh))) {
    if (is_file("../modules/registrars/" . $file . "/" . $file . ".php")) {
        $modulesarray[] = $file;
    }
}
closedir($dh);
sort($modulesarray);
foreach ($modulesarray as $module) {
    if (!isValidforPath($module)) {
        exit("Invalid Registrar Module Name");
    }
    if (file_exists("../modules/registrars/" . $module . "/logo.gif")) {
        $registrarlogourl = "../modules/registrars/" . $module . "/logo.gif";
    } else {
        if (file_exists("../modules/registrars/" . $module . "/logo.jpg")) {
            $registrarlogourl = "../modules/registrars/" . $module . "/logo.jpg";
        } else {
            if (file_exists("../modules/registrars/" . $module . "/logo.png")) {
                $registrarlogourl = "../modules/registrars/" . $module . "/logo.png";
            } else {
                $registrarlogourl = "./images/spacer.gif";
            }
        }
    }
コード例 #19
0
ファイル: modulefunctions.php プロジェクト: billyprice1/whmcs
function ServerUsageUpdate()
{
    $result2 = select_query("tblservers", "", array("disabled" => "0"), "name", "ASC");
    while ($data = mysql_fetch_array($result2)) {
        $servertype = $data['type'];
        $params['serverid'] = $data['id'];
        $params['serverip'] = $data['ipaddress'];
        $params['serverhostname'] = $data['hostname'];
        $params['serverusername'] = $data['username'];
        $params['serverpassword'] = decrypt($data['password'], $encryption_key);
        $params['serveraccesshash'] = $data['accesshash'];
        $params['serversecure'] = $data['secure'];
        if (!function_exists($servertype . "_ConfigOptions")) {
            if (!isValidforPath($servertype)) {
                exit("Invalid Server Module Name");
            }
            require ROOTDIR . "/modules/servers/" . $servertype . "/" . $servertype . ".php";
        }
        if (function_exists($servertype . "_UsageUpdate")) {
            logActivity("Cron Job: Running Usage Stats Update for Server ID " . $data['id']);
            $res = call_user_func($servertype . "_UsageUpdate", $params);
        }
    }
}