$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; }
function checkDetailsareValid($uid = "", $signup = false, $checkemail = true, $captcha = true, $checkcustomfields = true) { global $whmcs; $validate = new WHMCS_Validate(); $validate->setOptionalFields($whmcs->get_config("ClientsProfileOptionalFields")); if (!$signup) { $validate->setOptionalFields($whmcs->get_config("ClientsProfileUneditableFields")); } $validate->validate("required", "firstname", "clientareaerrorfirstname"); $validate->validate("required", "lastname", "clientareaerrorlastname"); if (($signup || $checkemail) && $validate->validate("required", "email", "clientareaerroremail")) { if ($validate->validate("email", "email", "clientareaerroremailinvalid")) { if ($validate->validate("banneddomain", "email", "clientareaerrorbannedemail")) { $validate->validate("uniqueemail", "email", "ordererroruserexists", array($uid, "")); } } } $validate->validate("required", "address1", "clientareaerroraddress1"); $validate->validate("required", "city", "clientareaerrorcity"); $validate->validate("required", "state", "clientareaerrorstate"); $validate->validate("required", "postcode", "clientareaerrorpostcode"); $validate->validate("postcode", "postcode", "clientareaerrorpostcode2"); $validate->validate("required", "phonenumber", "clientareaerrorphonenumber"); $validate->validate("phone", "phonenumber", "clientareaerrorphonenumber2"); $validate->validate("country", "country", "clientareaerrorcountry"); if ($signup && $validate->validate("required", "password", "ordererrorpassword")) { if ($validate->validate("pwstrength", "password", "pwstrengthfail")) { if ($validate->validate("required", "password2", "clientareaerrorpasswordconfirm")) { $validate->validate("match_value", "password", "clientareaerrorpasswordnotmatch", "password2"); } } } if ($checkcustomfields) { $validate->validateCustomFields("client", "", $signup); } if ($signup) { $securityquestions = getSecurityQuestions(); if ($securityquestions) { $validate->validate("required", "securityqans", "securityanswerrequired"); } if ($captcha) { $validate->validate("captcha", "code", "captchaverifyincorrect"); } if ($whmcs->get_config("EnableTOSAccept")) { $validate->validate("required", "accepttos", "ordererroraccepttos"); } } run_validate_hook($validate, "ClientDetailsValidation", $_POST); $errormessage = $validate->getHTMLErrorOutput(); return $errormessage; }
$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); if ($validate->hasErrors()) { $step = "2"; } } checkContactPermission("tickets"); $usingsupportmodule = false; if ($CONFIG['SupportModule']) { if (!isset($_SESSION['uid'])) { $goto = "submitticket"; include "login.php"; } if (!isValidforPath($CONFIG['SupportModule'])) { exit("Invalid Support Module"); } $supportmodulepath = "modules/support/" . $CONFIG['SupportModule'] . "/submitticket.php";