} } $message_text = str_replace("</p>", "\r\n\r\n", $sendmessage); $message_text = str_replace("<br>", "\r\n", $message_text); $message_text = str_replace("<br />", "\r\n", $message_text); $message_text = strip_tags($message_text); $mail->Body = $sendmessage; $mail->AltBody = html_entity_decode($message_text, ENT_QUOTES); if (!$CONFIG['ContactFormTo']) { $contactformemail = $CONFIG['Email']; } else { $contactformemail = $CONFIG['ContactFormTo']; } $mail->AddAddress($contactformemail); if ($smtp_debug) { $mail->SMTPDebug = true; } $mail->Send(); $mail->ClearAddresses(); $sent = "true"; $smarty->assign("sent", $sent); } } $smarty->assign("errormessage", $validate->getHTMLErrorOutput()); $smarty->assign("name", $name); $smarty->assign("email", $email); $smarty->assign("subject", $subject); $smarty->assign("message", $message); $smarty->assign("capatacha", $capatacha); $smarty->assign("recapatchahtml", clientAreaReCaptchaHTML()); outputClientArea($templatefile);
$notes = $data['notes']; $template = $data['template']; $language = $data['language']; $disabled = $data['disabled']; } $numrows = get_query_vals("tbladmins", "COUNT(id)", array("roleid" => "1")); $onlyadmin = $numrows == "1" && $roleid == "1" ? true : false; $managetitle = $aInt->lang("administrators", "editadmin"); } else { $supportdepts = $ticketnotify = array(); $managetitle = $aInt->lang("administrators", "addadmin"); } $language = $whmcs->validateLanguage($language, true); echo "<p><b>" . $managetitle . "</b></p>"; if ($validate->hasErrors()) { infoBox($aInt->lang("global", "validationerror"), $validate->getHTMLErrorOutput(), "error"); echo $infobox; } echo "\n<form method=\"post\" action=\""; echo $PHP_SELF; echo "?action=save&id="; echo $id; echo "\">\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"20%\" class=\"fieldlabel\">"; echo $aInt->lang("administrators", "role"); echo "</td><td class=\"fieldarea\">"; echo "<s"; echo "elect name=\"roleid\""; if ($onlyadmin) { echo " disabled"; } echo ">";
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 { $modulechangepwresult = "error"; $modulechangepasswordmessage = $_LANG['serverchangepasswordfailed']; update_query("tblhosting", array("password" => encrypt($servicepw)), array("id" => $id)); } } $smartyvalues['modulechangepwresult'] = $modulechangepwresult;
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(); }