Esempio n. 1
0
$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");
        $mail = new PHPMailer();
        $mail->From = $email;
        $mail->FromName = html_entity_decode($name, ENT_QUOTES);
        $mail->Subject = html_entity_decode("Contact Form: " . $subject, ENT_QUOTES);
        $mail->CharSet = $CONFIG['Charset'];
        if ($CONFIG['MailType'] == "mail") {
            $mail->Mailer = "mail";
        } else {
            if ($CONFIG['MailType'] == "smtp") {
                $mail->IsSMTP();
Esempio n. 2
0
 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")) {
     if ($domain != $_LANG['domaincheckerdomainexample']) {
         redir("sld=" . $sld . "&tld=" . $search_tlds[0], "cart.php");
     } else {
         redir("", "cart.php");
Esempio n. 3
-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();
}