예제 #1
0
    check_token("WHMCS.admin.default");
    if (!checkPermission("Edit Products/Services", true)) {
        exit("Access Denied");
    }
    $categorieslist = "";
    buildCategoriesList(0, 0);
    echo "<form method=\"post\" action=\"configproducts.php?action=uploadfile&id=" . $id . "\" id=\"quickuploadfrm\" enctype=\"multipart/form-data\">\n" . generate_token("form") . "\n<table width=\"100%\">\n<tr><td width=\"80\">Category:</td><td><select name=\"catid\" style=\"width:95%;\">" . $categorieslist . "</select></td></tr>\n<tr><td>Title:</td><td><input type=\"text\" name=\"title\" style=\"width:95%;\" /></td></tr>\n<tr><td>Description:</td><td><input type=\"text\" name=\"description\" style=\"width:95%;\" /></td></tr>\n<tr><td>Choose File:</td><td><input type=\"file\" name=\"uploadfile\" style=\"width:95%;\" /></td></tr>\n</table>\n</form>";
    exit;
}
if ($action == "uploadfile") {
    check_token("WHMCS.admin.default");
    if (!checkPermission("Edit Products/Services", true)) {
        exit("Access Denied");
    }
    if (!isFileNameSafe($_FILES['uploadfile']['name'])) {
        $aInt->gracefulExit("Invalid upload filename.  Valid filenames contain only alpha-numeric, dot, hyphen and underscore characters.");
        exit;
    }
    $filename = $_FILES['uploadfile']['name'];
    if (!$filename) {
        redir("action=edit&id=" . $id . "&tab=7");
    }
    move_uploaded_file($_FILES['uploadfile']['tmp_name'], $downloads_dir . $filename);
    $adddl = insert_query("tbldownloads", array("category" => $catid, "type" => "zip", "title" => $title, "description" => html_entity_decode($description), "location" => $filename, "clientsonly" => "on", "productdownload" => "on"));
    logActivity("Added New Product Download - " . $title);
    $result = select_query("tblproducts", "downloads", array("id" => $id));
    $data = mysql_fetch_array($result);
    $downloads = $data['downloads'];
    $downloads = unserialize($downloads);
    if (!is_array($downloads)) {
        $downloads = array();
예제 #2
0
define("ADMINAREA", true);
require "../init.php";
if (!$action) {
    $reqperm = "View Billable Items";
} else {
    $reqperm = "Manage Billable Items";
}
$aInt = new WHMCS_Admin($reqperm);
$aInt->title = $aInt->lang("billableitems", "title");
$aInt->sidebar = "billing";
$aInt->icon = "billableitems";
$aInt->requiredFiles(array("invoicefunctions", "gatewayfunctions"));
if ($action == "save") {
    check_token("WHMCS.admin.default");
    if (!$userid) {
        $aInt->gracefulExit($aInt->lang("billableitems", "noclientsmsg"));
    }
    $duedate = toMySQLDate($duedate);
    getUsersLang($userid);
    if ($id) {
        if ($hours != 0) {
            if (strpos($description, " " . $_LANG['billableitemshours'] . " @ ")) {
                $description = substr($description, 0, strrpos($description, " - ")) . " - " . $hours . " " . $_LANG['billableitemshours'] . " @ " . $amount . "/" . $_LANG['billableitemshour'];
            }
            $amount = $amount * $hours;
        }
        update_query("tblbillableitems", array("userid" => $userid, "description" => $description, "hours" => $hours, "amount" => $amount, "recur" => $recur, "recurcycle" => $recurcycle, "recurfor" => $recurfor, "invoiceaction" => $invoiceaction, "duedate" => $duedate, "invoicecount" => $invoicecount), array("id" => $id));
    } else {
        if ($hours != 0) {
            $description .= " - " . $hours . " " . $_LANG['billableitemshours'] . " @ " . $amount . "/" . $_LANG['billableitemshour'];
            $amount = $amount * $hours;
예제 #3
0
$tid = $data['tid'];
$deptid = $data['did'];
$pauserid = $data['userid'];
$name = $data['name'];
$email = $data['email'];
$date = $data['date'];
$title = $data['title'];
$message = $data['message'];
$tstatus = $data['status'];
$attachment = $data['attachment'];
$urgency = $data['urgency'];
$lastreply = $data['lastreply'];
$flag = $data['flag'];
$access = validateAdminTicketAccess($id);
if ($access == "invalidid") {
    $aInt->gracefulExit($aInt->lang("support", "ticketnotfound"));
}
if ($access == "deptblocked") {
    $aInt->gracefulExit($aInt->lang("support", "deptnoaccess"));
}
if ($access == "flagged") {
    $aInt->gracefulExit($aInt->lang("support", "flagnoaccess") . ": " . getAdminName($flag));
}
if ($access) {
    exit;
}
$message = strip_tags($message);
$message = nl2br($message);
$message = ticketAutoHyperlinks($message);
if ($pauserid != "0000000000") {
    $result = select_query("tblclients", "", array("id" => $pauserid));
예제 #4
0
$aid = $whmcs->get_req_var("aid");
$action = $whmcs->get_req_var("action");
$modop = $whmcs->get_req_var("modop");
if ($modop) {
    checkPermission("Perform Server Operations");
}
if (!$id && $hostingid) {
    $id = $hostingid;
}
if (!$userid && !$id) {
    $userid = get_query_val("tblclients", "id", "", "id", "ASC", "0,1");
}
if ($userid && !$id) {
    $aInt->valUserID($userid);
    if (!$userid) {
        $aInt->gracefulExit("Invalid User ID");
    }
    $id = get_query_val("tblhosting", "id", array("userid" => $userid), "domain", "ASC", "0,1");
}
if (!$id) {
    $aInt->gracefulExit($aInt->lang("services", "noproductsinfo") . " <a href=\"ordersadd.php?userid=" . $userid . "\">" . $aInt->lang("global", "clickhere") . "</a> " . $aInt->lang("orders", "toplacenew"));
}
$result = select_query("tblhosting", "tblhosting.*,tblproducts.servertype,tblproducts.type", array("tblhosting.id" => $id), "", "", "", "tblproducts ON tblproducts.id=tblhosting.packageid");
$service_data = mysql_fetch_array($result);
$id = $service_data['id'];
if (!$id) {
    $aInt->gracefulExit("Service ID Not Found");
}
$userid = $service_data['userid'];
$aInt->valUserID($userid);
$producttype = $service_data['type'];
예제 #5
0
} else {
    if ($action == "edit") {
        if ($pay == "true") {
            $error = AffiliatePayment($affaccid, "");
            if ($error) {
                infoBox($aInt->lang("affiliates", "paymentfailed"), $error);
            } else {
                infoBox($aInt->lang("affiliates", "paymentsuccess"), $aInt->lang("affiliates", "paymentsuccessdetail"));
            }
        }
        echo $infobox;
        $result = select_query("tblaffiliates", "", array("id" => $id));
        $data = mysql_fetch_array($result);
        $id = $data['id'];
        if (!$id) {
            $aInt->gracefulExit("Invalid Affiliate ID. Please Try Again...");
        }
        $date = $data['date'];
        $clientid = $data['clientid'];
        $visitors = $data['visitors'];
        $balance = $data['balance'];
        $withdrawn = $data['withdrawn'];
        $paymenttype = $data['paytype'];
        $payamount = $data['payamount'];
        $onetime = $data['onetime'];
        $result = select_query("tblclients", "", array("id" => $clientid));
        $data = mysql_fetch_array($result);
        $firstname = $data['firstname'];
        $lastname = $data['lastname'];
        $result = select_query("tblaffiliatesaccounts", "COUNT(id)", array("affiliateid" => $id));
        $data = mysql_fetch_array($result);
예제 #6
0
 **/
define("ADMINAREA", true);
require "../init.php";
$aInt = new WHMCS_Admin("View Clients Domains", false);
$aInt->requiredFiles(array("clientfunctions", "domainfunctions", "gatewayfunctions", "registrarfunctions"));
$aInt->inClientsProfile = true;
if (!$id && $domainid) {
    $id = $domainid;
}
if (!$userid && !$id) {
    $userid = get_query_val("tblclients", "id", "", "id", "ASC", "0,1");
}
if ($userid && !$id) {
    $aInt->valUserID($userid);
    if (!$userid) {
        $aInt->gracefulExit("Invalid User ID");
    }
    $id = get_query_val("tbldomains", "id", array("userid" => $userid), "domain", "ASC", "0,1");
}
if (!$id) {
    $aInt->gracefulExit($aInt->lang("domains", "nodomainsinfo") . " <a href=\"ordersadd.php?userid=" . $userid . "\">" . $aInt->lang("global", "clickhere") . "</a> " . $aInt->lang("orders", "toplacenew"));
}
$domains = new WHMCS_Domains();
$domain_data = $domains->getDomainsDatabyID($id);
$id = $did = $domainid = $domain_data['id'];
$userid = $domain_data['userid'];
$aInt->valUserID($userid);
if (!$id) {
    $aInt->gracefulExit("Domain ID Not Found");
}
if ($action == "delete") {
예제 #7
0
        exit;
    }
}
releaseSession();
$regperiods = $regperiodss = "";
$regperiod = 1;
while ($regperiod <= 10) {
    $regperiods .= "<option value=\"" . $regperiod . "\">" . $regperiod . " " . $aInt->lang("domains", "year" . $regperiodss) . "</option>";
    $regperiodss = "s";
    ++$regperiod;
}
$jquerycode = "\n\$(function(){\n    var prodtemplate = \$(\"#products .product:first\").clone();\n    var productsCount = 0;\n    window.addProduct = function(){\n        productsCount++;\n        var order = prodtemplate.clone().find(\"*\").each(function(){\n            var newId = this.id.substring(0, this.id.length-1) + productsCount;\n\n            \$(this).prev().attr(\"for\", newId); // update label for\n            this.id = newId; // update id\n\n        }).end()\n        .attr(\"id\", \"ord\" + productsCount)\n        .appendTo(\"#products\");\n        return false;\n    }\n    \$(\".addproduct\").click(addProduct);\n\n    var domainsCount = 0;\n    window.addDomain = function(){\n        domainsCount++;\n        \$('<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\" style=\"margin-top:10px;\"><tr><td width=\"130\" class=\"fieldlabel\">" . $aInt->lang("domains", "regtype", 1) . "</td><td class=\"fieldarea\"><input type=\"radio\" name=\"regaction['+domainsCount+']\" id=\"domnon'+domainsCount+'\" value=\"\" onclick=\"loaddomainoptions(this,0);updatesummary()\" checked /> <label for=\"domnon'+domainsCount+'\">" . $aInt->lang("global", "none", 1) . "</label> <input type=\"radio\" name=\"regaction['+domainsCount+']\" value=\"register\" id=\"domreg'+domainsCount+'\" onclick=\"loaddomainoptions(this,1);updatesummary()\" /> <label for=\"domreg'+domainsCount+'\">" . $aInt->lang("domains", "register", 1) . "</label> <input type=\"radio\" name=\"regaction['+domainsCount+']\" value=\"transfer\" id=\"domtrf'+domainsCount+'\" onclick=\"loaddomainoptions(this,2);updatesummary()\" /> <label for=\"domtrf'+domainsCount+'\">" . $aInt->lang("domains", "transfer", 1) . "</label></td></tr><tr class=\"hiddenrow\" id=\"domrowdn'+domainsCount+'\" style=\"display:none;\"><td class=\"fieldlabel\">" . $aInt->lang("fields", "domain", 1) . "</td><td class=\"fieldarea\"><input type=\"text\" class=\"regdomain\" id=\"regdomain'+domainsCount+'\" name=\"regdomain['+domainsCount+']\" size=\"40\" onkeyup=\"updatesummary()\" /></td></tr><tr class=\"hiddenrow\" id=\"domrowrp'+domainsCount+'\" style=\"display:none;\"><td class=\"fieldlabel\">" . $aInt->lang("domains", "regperiod", 1) . "</td><td class=\"fieldarea\"><select name=\"regperiod['+domainsCount+']\" onchange=\"updatesummary()\">" . $regperiods . "</select></td></tr><tr class=\"hiddentransrow\" id=\"domrowep'+domainsCount+'\" style=\"display:none;\"><td class=\"fieldlabel\">" . $aInt->lang("domains", "eppcode", 1) . "</td><td class=\"fieldarea\"><input type=\"text\" name=\"eppcode['+domainsCount+']\" size=\"20\" /></td></tr><tr class=\"hiddenrow\" id=\"domrowad'+domainsCount+'\" style=\"display:none;\"><td class=\"fieldlabel\">" . $aInt->lang("domains", "addons", 1) . "</td><td class=\"fieldarea\"><label><input type=\"checkbox\" name=\"dnsmanagement['+domainsCount+']\" onclick=\"updatesummary()\" /> " . $aInt->lang("domains", "dnsmanagement", 1) . "</label> <label><input type=\"checkbox\" name=\"emailforwarding['+domainsCount+']\" onclick=\"updatesummary()\" /> " . $aInt->lang("domains", "emailforwarding", 1) . "</label> <label><input type=\"checkbox\" name=\"idprotection['+domainsCount+']\" onclick=\"updatesummary()\" /> " . $aInt->lang("domains", "idprotection", 1) . "</label></td></tr><tr id=\"domainaddlfieldserase'+domainsCount+'\" style=\"display:none\"></tr></table>').appendTo(\"#domains\");\n        return false;\n    }\n    \$(\".adddomain\").click(addDomain);\n\n    \$(\"#domain0\").keyup(function() {\n      \$(\"#regdomain0\").val(\$(\"#domain0\").val());\n    });\n\n\t\$(\".regdomain\").live(\"keyup\", function(){\n    \tvar domainname = \$(this).val();\n\t\tif(domainname.length >= 5){\n\t\t\tvar ord = \$(this).attr(\"id\").replace(\"regdomain\",\"\");\n\t\t\t\$.post(\"ordersadd.php\", { action: \"getdomainaddlfields\", domain: domainname, order:ord, token: \"" . generate_token("plain") . "\" },\n\t\t\tfunction(data){\n\t\t\t\t\$(\".domainaddlfields\"+ord).remove();\n\t\t\t\t\$(\"#domainaddlfieldserase\"+ord).after(data);\n\t\t\t});\n\t\t}\n    });\n\n});\n";
$jscode = "\nfunction loadproductoptions(piddd) {\n    var ord = piddd.id.substring(3);\n    var pid = piddd.value;\n    var billingcycle = \$(\"#billingcycle option:selected\").val();\n    if (pid==0) {\n        \$(\"#productconfigoptions\"+ord).html(\"\");\n        \$(\"#addonsrow\"+ord).hide();\n        updatesummary();\n    } else {\n    \$(\"#productconfigoptions\"+ord).html(\"<p align=\\\"center\\\">" . $aInt->lang("global", "loading") . "<br><img src=\\\"../images/loading.gif\\\"></p>\");\n    \$.post(\"ordersadd.php\", { action: \"getconfigoptions\", pid: pid, cycle: billingcycle, orderid: ord, token: \"" . generate_token("plain") . "\" },\n    function(data){\n        if (data.addons) {\n            \$(\"#addonsrow\"+ord).show();\n            \$(\"#addonscont\"+ord).html(data.addons);\n        } else {\n            \$(\"#addonsrow\"+ord).hide();\n        }\n        \$(\"#productconfigoptions\"+ord).html(data.options);\n        updatesummary();\n    },\"json\");\n    }\n}\nfunction loaddomainoptions(domrd,type) {\n    var ord = domrd.id.substring(6);\n    if (type==1) {\n        \$(\"#domrowdn\"+ord).css(\"display\",\"\");\n        \$(\"#domrowrp\"+ord).css(\"display\",\"\");\n        \$(\"#domrowep\"+ord).css(\"display\",\"none\");\n        \$(\"#domrowad\"+ord).css(\"display\",\"\");\n    } else if (type==2) {\n        \$(\"#domrowdn\"+ord).css(\"display\",\"\");\n        \$(\"#domrowrp\"+ord).css(\"display\",\"\");\n        \$(\"#domrowep\"+ord).css(\"display\",\"\");\n        \$(\"#domrowad\"+ord).css(\"display\",\"\");\n    } else {\n        \$(\"#domrowdn\"+ord).css(\"display\",\"none\");\n        \$(\"#domrowrp\"+ord).css(\"display\",\"none\");\n        \$(\"#domrowep\"+ord).css(\"display\",\"none\");\n        \$(\"#domrowad\"+ord).css(\"display\",\"none\");\n    }\n}\nfunction updatesummary() {\n    jQuery.post(\"ordersadd.php\", \"submitorder=1&calconly=1&\"+jQuery(\"#orderfrm\").serialize(),\n    function(data){\n        jQuery(\"#ordersumm\").html(data);\n    });\n}\n";
ob_start();
if (!checkActiveGateway()) {
    $aInt->gracefulExit($aInt->lang("gateways", "nonesetup"));
}
if ($userid && !$paymentmethod) {
    $paymentmethod = getClientsPaymentMethod($userid);
}
if ($whmcs->get_req_var("noselections")) {
    infoBox($aInt->lang("global", "validationerror"), $aInt->lang("orders", "noselections"));
}
echo $infobox;
echo "\n<form method=\"post\" action=\"";
echo $_SERVER['PHP_SELF'];
echo "\" id=\"orderfrm\">\n<input type=\"hidden\" name=\"submitorder\" value=\"true\" />\n\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td valign=\"top\" class=\"ordersummaryleftcol\">\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"130\" class=\"fieldlabel\">";
echo $aInt->lang("fields", "client");
echo "</td><td class=\"fieldarea\">";
echo $aInt->clientsDropDown($userid);
echo "</td></tr>\n<tr><td class=\"fieldlabel\">";
예제 #8
0
 if ($action == "edit") {
     $result = select_query("tblaccounts", "", array("id" => $id));
     $data = mysql_fetch_array($result);
     $id = $data['id'];
     $userid = $data['userid'];
     $date = $data['date'];
     $date = fromMySQLDate($date);
     $description = $data['description'];
     $amountin = $data['amountin'];
     $fees = $data['fees'];
     $amountout = $data['amountout'];
     $paymentmethod = $data['gateway'];
     $transid = $data['transid'];
     $invoiceid = $data['invoiceid'];
     if (!$id) {
         $aInt->gracefulExit($aInt->lang("transactions", "notfound"));
     }
     echo "\n<h2>";
     echo $aInt->lang("transactions", "edit");
     echo "</h2>\n\n<form method=\"post\" action=\"";
     echo $PHP_SELF;
     echo "?action=save&id=";
     echo $id;
     echo "\" name=\"calendarfrm\">\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"15%\" class=\"fieldlabel\">";
     echo $aInt->lang("transactions", "relclient");
     echo "</td><td class=\"fieldarea\">";
     echo $aInt->clientsDropDown($userid, "", "client", true);
     echo "</td><td class=\"fieldlabel\">";
     echo $aInt->lang("fields", "transid");
     echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"transid\" size=20 value=\"";
     echo $transid;
예제 #9
0
global $jscode;
$jquerycode = $jscode = "";
ob_start();
if (!($module = $whmcs->get_req_var("module"))) {
    $aInt->title = $aInt->lang("utilities", "addonsdirectory");
    echo "\n<div id=\"searchaddons\"><form onsubmit=\"search();return false\"><input type=\"text\" id=\"searchterm\" /> <input type=\"submit\" value=\"Search\" /></form></div>\n<div id=\"addonscats\"></div>\n<div id=\"addonslist\">\n<div class=\"loading\">";
    echo $aInt->lang("global", "loading");
    echo "<br /><img src=\"../images/loading.gif\" /></div>\n</div>\n<div style=\"clear:both;\"></div>\n\n<p style=\"font-size:10px;\">* Please note that any addon modules listed above outside of the \"Official Addon's\" directory are third party modules that WHMCS is in no way affiliated with or endorsing by listing them in the addons directory. We are unable to provide support for, and cannot be held responsible for any pro";
    echo "blems resulting from the use of third party addons.</p>\n\n";
    $jscode = "function loadcats() {\n    \$.post(\"addonmodules.php\", { action: \"getcats\" },\n\t    function(data){\n\t\t    \$(\"#addonscats\").html(data);\n\t\t});\n}\nfunction loadaddons(id) {\n    \$(\".cat\").removeClass(\"addonsel\");\n    \$(\"#cat\"+id).addClass(\"addonsel\")\n    \$(\"#addonslist\").html('<div class=\"loading\">" . $aInt->lang("global", "loading", 1) . "<br /><img src=\"../images/loading.gif\" /></div>');\n    \$.post(\"addonmodules.php\", { action: \"getaddons\", catid: id },\n\t    function(data){\n\t\t    \$(\"#addonslist\").html(data);\n\t\t});\n}\nfunction search() {\n    \$(\".cat\").removeClass(\"addonsel\");\n    \$(\"#cat\").addClass(\"addonsel\")\n    \$(\"#addonslist\").html('<div class=\"loading\">" . $aInt->lang("global", "loading", 1) . "<br /><img src=\"../images/loading.gif\" /></div>');\n    \$.post(\"addonmodules.php\", { action: \"getaddons\", search: \$(\"#searchterm\").val() },\n\t    function(data){\n\t\t    \$(\"#addonslist\").html(data);\n\t\t});\n}";
    $jquerycode = "loadcats();loadaddons(\"\");";
} else {
    $activeaddonmodules = $CONFIG['ActiveAddonModules'];
    $activeaddonmodules = explode(",", $activeaddonmodules);
    if (!in_array($module, $activeaddonmodules)) {
        $aInt->gracefulExit("Invalid Module Name. Please Try Again.");
    }
    $modulelink = "addonmodules.php?module=" . $module;
    $result = select_query("tbladdonmodules", "value", array("module" => $module, "setting" => "access"));
    $data = mysql_fetch_array($result);
    $allowedroles = explode(",", $data[0]);
    $result = select_query("tbladmins", "roleid", array("id" => $_SESSION['adminid']));
    $data = mysql_fetch_array($result);
    $adminroleid = $data[0];
    if (!isValidforPath($module)) {
        exit("Invalid Addon Module Name");
    }
    $modulepath = ROOTDIR . ("/modules/addons/" . $module . "/" . $module . ".php");
    if (file_exists($modulepath)) {
        require $modulepath;
        if (function_exists($module . "_config")) {
예제 #10
0
        if (0 < $data['tax']) {
            echo "<tr bgcolor=\"#efefef\" style=\"text-align:right;font-weight:bold;\"><td>" . $data['taxrate'] . "% " . $aInt->lang("fields", "tax") . "&nbsp;</td><td>" . formatCurrency($data['tax']) . "</td></tr>";
        }
        if (0 < $data['tax2']) {
            echo "<tr bgcolor=\"#efefef\" style=\"text-align:right;font-weight:bold;\"><td>" . $data['taxrate2'] . "% " . $aInt->lang("fields", "tax") . "&nbsp;</td><td>" . formatCurrency($data['tax2']) . "</td></tr>";
        }
    }
    echo "<tr bgcolor=\"#efefef\" style=\"text-align:right;font-weight:bold;\"><td>" . $aInt->lang("fields", "credit") . "&nbsp;</td><td>" . formatCurrency($data['credit']) . "</td></tr>";
    echo "<tr bgcolor=\"#efefef\" style=\"text-align:right;font-weight:bold;\"><td>" . $aInt->lang("fields", "totaldue") . "&nbsp;</td><td>" . formatCurrency($data['total']) . "</td></tr>";
    echo "</table>";
    exit;
}
if ($action == "createinvoice") {
    check_token("WHMCS.admin.default");
    if (!checkActiveGateway()) {
        $aInt->gracefulExit($aInt->lang("gateways", "nonesetup"));
    }
    $gateway = getClientsPaymentMethod($userid);
    if ($CONFIG['TaxEnabled'] == "on") {
        $clientsdetails = getClientsDetails($userid);
        if (!$clientsdetails['taxexempt']) {
            $state = $clientsdetails['state'];
            $country = $clientsdetails['country'];
            $taxdata = getTaxRate(1, $state, $country);
            $taxdata2 = getTaxRate(2, $state, $country);
            $taxrate = $taxdata['rate'];
            $taxrate2 = $taxdata2['rate'];
        }
    }
    $duedate = date("Ymd", mktime(0, 0, 0, date("m"), date("d") + $CONFIG['CreateInvoiceDaysBefore'], date("Y")));
    $invoiceid = insert_query("tblinvoices", array("date" => "now()", "duedate" => $duedate, "userid" => $userid, "status" => "Unpaid", "paymentmethod" => $gateway, "taxrate" => $taxrate, "taxrate2" => $taxrate2));
예제 #11
0
    $licensing->forceRemoteCheck();
    redir();
}
$twofasettings = $whmcs->get_config("2fasettings");
$twofasettings = unserialize($twofasettings);
echo $frm->form();
echo "<table width=\"100%\"><tr><td width=\"45%\" valign=\"top\">\n\n<div style=\"padding:20px;background-color:#FAF5E4;-moz-border-radius: 10px;-webkit-border-radius: 10px;-o-border-radius: 10px;border-radius: 10px;\">";
echo "\n\n<strong>What is Two-Factor Authentication?</strong><br /><br />\n\nTwo-factor authentication adds an additional layer of security by adding a second step to your login. It takes something you know (ie. your password) and adds a second factor, typically something you have (such as your phone.) Since both are required to log in, even if an attacker has your password they can't access your account.\n\n<div style=\"margin:20px auto;padding:10px;width:370px;background-color:#fff;-moz-border-radius: 10px;-webkit-border-radius: 10px;-o-border-radius: 10px;border-radius: 10px;\"><img src=\"images/twofahow.png\" width=\"350\" height=\"233\" /></div>\n\n<strong>Why do you need it?</strong><br /><br />\n\nPasswords are increasingly easy to compromise. They can often be guessed or leaked, they usually don't change very often, and despite advice otherwise, many of us have favorite passwords that we use for more than one thing. So Two-factor authentication gives you additional security because your password alone no longer allows access to your account.<br /><br />\n\n<strong>How it works?</strong><br /><br />\n\nThere are many different options available, and in WHMCS we support more than one so <i>you</i> have the choice.  But one of the most common and simplest to use is time based one-time passwords.  With these, in addition to your regular username & password, you also have to enter a 6 digit code that changes every 30 seconds.  Only your token device (typically a mobile smartphone) will know your secret key, and be able to generate valid one time passwords for your account.  And so your account is far safer.<br /><br />\n\n<strong>Force Settings</strong><br /><br />\n\n";
echo $frm->checkbox("forceclient", "Force Clients to enable Two Factor Authentication on Next Login", $twofasettings['forceclient']) . "<br />";
echo $frm->checkbox("forceadmin", "Force Administrator Users to enable Two Factor Authentication on Next Login", $twofasettings['forceadmin']) . "<br /><br />";
echo $frm->submit($aInt->lang("global", "savechanges"));
echo "</td><td width=\"55%\" valign=\"top\">";
$mod = new WHMCS_Module();
$moduleslist = $mod->getList("security");
if (!$moduleslist) {
    $aInt->gracefulExit("Security Module Folder Not Found. Please try reuploading all WHMCS related files.");
}
$i = 0;
foreach ($moduleslist as $module) {
    $mod->load($module);
    $configarray = $mod->call("config");
    $moduleconfigdata = $twofasettings['modules'][$module];
    echo "<div style=\"width:90%;margin:" . ($i ? "10px" : "0") . " auto;padding:10px 20px;border:1px solid #ccc;background-color:#fff;-moz-border-radius: 10px;-webkit-border-radius: 10px;-o-border-radius: 10px;border-radius: 10px;\">";
    if ($moduleconfigdata['clientenabled'] || $moduleconfigdata['adminenabled']) {
        echo "<p style=\"float:right;\"><input type=\"button\" value=\"Deactivate\" class=\"btn-danger\" onclick=\"deactivate('" . $module . "')\" /></p>";
        $showstyle = "";
    } else {
        if (array_key_exists("Licensed", $configarray)) {
            if ($configarray['Licensed']['Value']) {
                echo "<p style=\"float:right;\"><input type=\"button\" value=\"Activate\" class=\"btn-success\" id=\"activatebtn" . $module . "\" onclick=\"activate('" . $module . "')\" /></p>";
            } else {
예제 #12
0
     }
     if (!$errormessage) {
         $attachments = uploadTicketAttachments(true);
         $client = (int) str_replace("UserID:", "", $client);
         $ticketdata = openNewTicket($client, $contactid, $deptid, $subject, $message, $priority, $attachments, array("name" => $name, "email" => $email), $relatedservice, $ccemail, $sendemail ? false : true, true);
         $id = $ticketdata['ID'];
         redir("action=viewticket&id=" . $id);
         exit;
     } else {
         $action = "open";
     }
 } else {
     if ($action == "viewticket") {
         $access = validateAdminTicketAccess($id);
         if ($access == "invalidid") {
             $aInt->gracefulExit($aInt->lang("support", "ticketnotfound"));
         }
         if ($access == "deptblocked") {
             $aInt->gracefulExit($aInt->lang("support", "deptnoaccess"));
         }
         if ($access == "flagged") {
             $aInt->gracefulExit($aInt->lang("support", "flagnoaccess") . ": " . getAdminName($flag));
         }
         if ($access) {
             exit;
         }
         if ($postreply || $postaction) {
             check_token("WHMCS.admin.default");
             if ($postaction == "note") {
                 AddNote($id, $message);
             } else {
예제 #13
0
    logActivity("Deleted Knowledgebase Category (ID: " . $id . ")");
    redir("catid=" . $catid);
    exit;
}
ob_start();
if ($action == "") {
    if (!$catid) {
        $catid = 0;
    }
    $breadcrumbnav = "";
    if ($catid != "0") {
        $result = select_query("tblknowledgebasecats", "", array("id" => $catid));
        $data = mysql_fetch_array($result);
        $catid = $data['id'];
        if (!$catid) {
            $aInt->gracefulExit("Category ID Not Found");
        }
        $catparentid = $data['parentid'];
        $catname = $data['name'];
        $catbreadcrumbnav = " > <a href=\"" . $PHP_SELF . "?catid=" . $catid . "\">" . $catname . "</a>";
        while ($catparentid != "0") {
            $result = select_query("tblknowledgebasecats", "", array("id" => $catparentid));
            $data = mysql_fetch_array($result);
            $cattempid = $data['id'];
            $catparentid = $data['parentid'];
            $catname = $data['name'];
            $catbreadcrumbnav = " > <a href=\"" . $PHP_SELF . "?catid=" . $cattempid . "\">" . $catname . "</a>" . $catbreadcrumbnav;
        }
        $breadcrumbnav .= $catbreadcrumbnav;
    }
    $aInt->deleteJSConfirm("doDelete", "support", "kbdelsure", $_SERVER['PHP_SELF'] . "?catid=" . $catid . "&action=delete&id=");