Example #1
0
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
define("ADMINAREA", true);
require "../init.php";
$aInt = new WHMCS_Admin("Configure Administrators");
$aInt->title = $aInt->lang("administrators", "title");
$aInt->sidebar = "config";
$aInt->icon = "admins";
$aInt->helplink = "Administrators";
$validate = new WHMCS_Validate();
if ($action == "save") {
    check_token("WHMCS.admin.default");
    $auth = new WHMCS_Auth();
    $auth->getInfobyID(WHMCS_Session::get("adminid"));
    if (!$auth->comparePassword($whmcs->get_req_var("confirmpassword"))) {
        $_ADMINLANG['administrators']['confirmexistingpw'] = "You must confirm your existing administrator password";
        $validate->addError(array("administrators", "confirmexistingpw"));
    } else {
        $validate->validate("required", "firstname", array("administrators", "namerequired"));
        if ($validate->validate("required", "email", array("administrators", "emailerror"))) {
            $validate->validate("email", "email", array("administrators", "emailinvalid"));
        }
        if ($validate->validate("required", "username", array("administrators", "usererror"))) {
            $existingid = get_query_val("tbladmins", "id", array("username" => $username));
            if (!$id && $existingid || $id && $existingid && $id != $existingid) {
Example #2
0
require "init.php";
$pagetitle = $_LANG['contacttitle'];
$breadcrumbnav = "<a href=\"index.php\">" . $_LANG['globalsystemname'] . "</a> > <a href=\"contact.php\">" . $_LANG['contacttitle'] . "</a>";
$templatefile = "contact";
$pageicon = "images/contact_big.gif";
initialiseClientArea($pagetitle, $pageicon, $breadcrumbnav);
$action = $whmcs->get_req_var("action");
$name = $whmcs->get_req_var("name");
$email = $whmcs->get_req_var("email");
$subject = $whmcs->get_req_var("subject");
$message = $whmcs->get_req_var("message");
if ($CONFIG['ContactFormDept']) {
    redir("step=2&deptid=" . (int) $CONFIG['ContactFormDept'], "submitticket.php");
}
$capatacha = clientAreaInitCaptcha();
$validate = new WHMCS_Validate();
if ($action == "send") {
    check_token();
    $validate->validate("required", "name", "contacterrorname");
    if ($validate->validate("required", "email", "clientareaerroremail")) {
        $validate->validate("email", "email", "clientareaerroremailinvalid");
    }
    $validate->validate("required", "subject", "contacterrorsubject");
    $validate->validate("required", "message", "contacterrormessage");
    $validate->validate("captcha", "code", "captchaverifyincorrect");
    if (!$validate->hasErrors()) {
        if ($CONFIG['LogoURL']) {
            $sendmessage = "<p><a href=\"" . $CONFIG['Domain'] . "\" target=\"_blank\"><img src=\"" . $CONFIG['LogoURL'] . "\" alt=\"" . $CONFIG['CompanyName'] . "\" border=\"0\"></a></p>";
        }
        $sendmessage .= "<font style=\"font-family:Verdana;font-size:11px\"><p>" . nl2br($message) . "</p>";
        $whmcs->load_class("phpmailer");
Example #3
0
 $newpassword1 = $whmcs->get_req_var("newpw");
 $newpassword2 = $whmcs->get_req_var("confirmpw");
 foreach (array("newpassword1", "newserverpassword1") as $key) {
     if (!$newpassword1 && $whmcs->get_req_var($key)) {
         $newpwfield = $key;
         $newpassword1 = $whmcs->get_req_var($key);
         continue;
     }
 }
 foreach (array("newpassword2", "newserverpassword2") as $key) {
     if ($whmcs->get_req_var($key)) {
         $newpassword2 = $whmcs->get_req_var($key);
         continue;
     }
 }
 $validate = new WHMCS_Validate();
 if ($validate->validate("match_value", "newpw", "clientareaerrorpasswordnotmatch", array($newpassword1, $newpassword2))) {
     $validate->validate("pwstrength", $newpwfield, "pwstrengthfail");
 }
 if ($validate->hasErrors()) {
     $modulechangepwresult = "error";
     $modulechangepasswordmessage = $validate->getHTMLErrorOutput();
 } else {
     update_query("tblhosting", array("password" => encrypt($newpassword1)), array("id" => $id));
     $success = $service->moduleCall("ChangePassword", array("password" => html_entity_decode($newpassword1)));
     if ($success) {
         logActivity("Module Change Password Successful - Service ID: " . $id);
         $modulechangepwresult = "success";
         $modulechangepasswordmessage = $_LANG['serverchangepasswordsuccessful'];
         $servicepw = $newpassword1;
     } else {
Example #4
0
 if ($calctotal) {
     $i = $whmcs->get_req_var("i");
     $productinfo = $orderfrm->setPid($_SESSION['cart']['products'][$i]['pid']);
     $ordersummarytemp = "/templates/orderforms/" . $orderfrm->getTemplate() . "/ordersummary.tpl";
     if (file_exists(ROOTDIR . $ordersummarytemp)) {
         $carttotals = calcCartTotals(false, true);
         $templatevars = array("producttotals" => $carttotals['products'][$i], "carttotals" => $carttotals);
         echo processSingleTemplate($ordersummarytemp, $templatevars);
     }
     exit;
 }
 if (!$ajax && !$nocyclerefresh && $previousbillingcycle != $billingcycle) {
     redir("a=confproduct&i=" . $i);
     exit;
 }
 $validate = new WHMCS_Validate();
 $validate->validateCustomFields("product", $pid, true);
 run_validate_hook($validate, "ShoppingCartValidateProductUpdate", $_REQUEST);
 if ($validate->hasErrors()) {
     $errormessage .= $validate->getHTMLErrorOutput();
 }
 if ($errormessage) {
     if ($ajax) {
         exit($errormessage);
     }
     $smartyvalues['errormessage'] = $errormessage;
 } else {
     unset($_SESSION['cart']['products'][$i]['noconfig']);
     $_SESSION['cart']['lastconfigured'] = array("type" => "product", "i" => $i);
     if ($ajax) {
         exit;
Example #5
0
             continue;
         }
     }
 }
 foreach ($search_tlds as $k => $temptld) {
     if (!in_array($temptld, $tldslist)) {
         $invalidtld = $temptld;
         unset($search_tlds[$k]);
         continue;
     }
 }
 $checkdomain = false;
 if ($sld && count($search_tlds)) {
     $checkdomain = true;
 }
 $validate = new WHMCS_Validate();
 if ($capatacha) {
     $validate->validate("captcha", "code", "captchaverifyincorrect");
 }
 if (!$direct && $sld && $validate->hasErrors()) {
     $smartyvalues['inccode'] = true;
     $checkdomain = false;
 }
 if ($whmcs->get_req_var("transfer")) {
     if ($domain != $_LANG['domaincheckerdomainexample']) {
         redir("a=add&domain=transfer&sld=" . $sld . "&tld=" . $search_tlds[0], "cart.php");
     } else {
         redir("a=add&domain=transfer", "cart.php");
     }
 }
 if ($whmcs->get_req_var("hosting")) {
Example #6
0
$name = $whmcs->get_req_var("name");
$email = $whmcs->get_req_var("email");
$urgency = $whmcs->get_req_var("urgency");
$subject = $whmcs->get_req_var("subject");
$message = $whmcs->get_req_var("message");
$customfield = $whmcs->get_req_var("customfield");
if ($action == "getkbarticles") {
    $kbarticles = getKBAutoSuggestions($text);
    if (count($kbarticles)) {
        $smarty->assign("kbarticles", $kbarticles);
        echo $smarty->fetch($whmcs->get_sys_tpl_name() . "/supportticketsubmit-kbsuggestions.tpl");
    }
    exit;
}
$captcha = clientAreaInitCaptcha();
$validate = new WHMCS_Validate();
if ($step == "3") {
    check_token();
    if (!isset($_SESSION['uid'])) {
        $validate->validate("required", "name", "supportticketserrornoname");
        if ($validate->validate("required", "email", "supportticketserrornoemail")) {
            $validate->validate("email", "email", "clientareaerroremailinvalid");
        }
    }
    $validate->validate("required", "subject", "supportticketserrornosubject");
    $validate->validate("required", "message", "supportticketserrornomessage");
    $validate->validate("fileuploads", "attachments", "supportticketsfilenotallowed");
    if ($captcha) {
        $validate->validate("captcha", "code", "captchaverifyincorrect");
    }
    $validate->validateCustomFields("support", $deptid);
Example #7
-1
function doResetPW($key, $newpw, $confirmpw)
{
    global $_LANG;
    $newpw = html_entity_decode($newpw);
    $confirmpw = html_entity_decode($confirmpw);
    if (!$key) {
        return $_LANG['pwresetemailrequired'];
    }
    $result = select_query("tblclients", "id,email,pwresetexpiry", array("pwresetkey" => $key));
    $data = mysql_fetch_array($result);
    $userid = $data['id'];
    $email = $data['email'];
    $pwresetexpiry = $data['pwresetexpiry'];
    if (!$userid) {
        $result = select_query("tblcontacts", "id,email,userid,pwresetexpiry", array("pwresetkey" => $key));
        $data = mysql_fetch_array($result);
        $contactid = $data['id'];
        $userid = $data['userid'];
        $pwresetexpiry = $data['pwresetexpiry'];
        $email = $data['email'];
    }
    if (!$userid) {
        return $_LANG['pwresetemailnotfound'];
    }
    if ($pwresetexpiry < time()) {
        return $_LANG['pwresetkeyexpired'];
    }
    $validate = new WHMCS_Validate();
    if ($validate->validate("required", "newpw", "ordererrorpassword")) {
        if ($validate->validate("pwstrength", "newpw", "pwstrengthfail")) {
            if ($validate->validate("required", "confirmpw", "clientareaerrorpasswordconfirm")) {
                $validate->validate("match_value", "newpw", "clientareaerrorpasswordnotmatch", "confirmpw");
            }
        }
    }
    if (!$validate->hasErrors()) {
        if ($contactid) {
            update_query("tblcontacts", array("password" => generateClientPW($newpw), "pwresetkey" => "", "pwresetexpiry" => ""), array("id" => $contactid));
        } else {
            update_query("tblclients", array("password" => generateClientPW($newpw), "pwresetkey" => "", "pwresetexpiry" => ""), array("id" => $userid));
        }
        run_hook("ClientChangePassword", array("userid" => $userid, "password" => $newpw));
        logActivity("Password Reset Completed", $userid);
        sendMessage("Password Reset Confirmation", $userid, array("contactid" => $contactid));
        validateClientLogin($email, $newpw);
        redir("success=true", "pwreset.php");
    }
    return $validate->getHTMLErrorOutput();
}