Iniit
Этот коммит содержится в:
@@ -0,0 +1,238 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class ForgotPassword extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
var jsfiles = ["tenants/themes/compact/index.anonymous.js", "platform/membership/managers/accountmanager.js", "libs/passwordrequirement/passwordrequirement.js"];
|
||||
return jsfiles;
|
||||
}
|
||||
cssFiles() {
|
||||
return ["libs/passwordrequirement/passwordrequirement.css"];
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
|
||||
$(".pr-password").click(function () {
|
||||
var signUpPswd = $(".pr-password");
|
||||
signUpPswd.passwordRequirements({
|
||||
numCharacters: 8,
|
||||
useLowercase: true,
|
||||
useUppercase: true,
|
||||
useNumbers: true,
|
||||
useSpecial: true
|
||||
});
|
||||
});
|
||||
jQuery(".preloader-it").delay(500).fadeOut("slow");
|
||||
jQuery("#external-container").delay(500).fadeIn("slow");
|
||||
jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
|
||||
$("#div_modalbody").removeAttr("style");
|
||||
$('#passwordHide').click(function () {
|
||||
var input = $('#txt_NewPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#passwordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
$('#confirmPasswordHide').click(function () {
|
||||
var input = $('#txt_ConfirmPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#confirmPasswordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
var instance = this;
|
||||
$("#txt_PhoneorMail").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_SendCode").click();
|
||||
});
|
||||
$("#txt_Code").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_VerifyCode").click();
|
||||
});
|
||||
$("#txt_NewPassword,#txt_ConfirmPassword").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_ResetPswd").click();
|
||||
});
|
||||
$("#btn_SendCode").click(function () {
|
||||
instance.validate();
|
||||
});
|
||||
$("#btn_VerifyCode").click(function () {
|
||||
instance.verifyOtp();
|
||||
});
|
||||
$("#btn_ResendCode").click(function () {
|
||||
instance.sendOtp(instance.OtpId);
|
||||
});
|
||||
$("#btn_ResetPswd").click(function () {
|
||||
instance.resetPassword();
|
||||
});
|
||||
if (callback != null)
|
||||
callback();
|
||||
}
|
||||
html(id, containerid) {
|
||||
if (jQuery("#external-form").length === 0) {
|
||||
var index = new Components.Index_Anonymous();
|
||||
index.init(null);
|
||||
}
|
||||
const html = `<div id="div_ForgotPassword"><form id="frm_ForgotPassword" data-validate="parsley" data-isdynamic="false" autocomplete="off"><div id="div_ValidationSummary"></div><div id="div_ForgotPswd" class=""><h1 class="display-5 mb-10 text-center">Need help with your Password?</h1><p class="mb-30 text-center">We will send new code to your recovery Email or Phone to reset your password.</p><div class="form-group"><input class="form-control" required autocomplete="off" placeholder="Enter Registered Email or Mobile" id="txt_PhoneorMail" type="text"></div><button class="btn btn-primary btn-block mb-20" id="btn_SendCode" type="button">Send</button><p class="text-right"><a href="index.html#/login">Back to login</a></p></div><div id="div_ResetPswd" class="d-none"><h1 class="display-5 mb-30 text-center">Please reset your password</h1><div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off"><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span><div class="showpwsdreq"></div></div><div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="off"><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div><button class="btn btn-primary btn-block mb-20" id="btn_ResetPswd" type="button">Reset Password</button><p class="text-right"><a href="/Index.html">Back to login</a></p></div><div id="div_SuccessMsg" class="d-none"><div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div><h1 class="display-4 mb-20 text-center">Password Updated Successfully</h1><p class="text-center"><a href="index.html#/login">Click here to Login</a></p></div></form><div id="modal_Otp" class="modal fade hide"><div class="modal-dialog"><div class="modal-content"><div class="modal-header mt-2 mb-2"><h5 class="modal-title pull-left">Mobile or Email Verification</h5><button type="button" class="close pull-right" data-dismiss="modal" aria-hidden="true" >×</button></div><div class="modal-body" id="div_modalbody"><div class="mb-10"><p class="lbl_Otp">We have sent OTP on your Mobile Number and Email!</p></div><div class="floating-label-form-group mb-2"><input class="form-control" id ="txt_Code" placeholder="Enter Mobile OTP/Email OTP" type="text"></div></div><div class="modal-footer mb-2" style="display:block"><button type = "button" class="btn btn-primary pull-left" id="btn_ResendCode">Resend</button><button type = "button" class="btn btn-primary pull-right" id="btn_VerifyCode">Verify</button></div></div></div></div></div>`;
|
||||
return html;
|
||||
}
|
||||
validate() {
|
||||
var instance = this;
|
||||
if ($("#txt_PhoneorMail").val() == "") {
|
||||
MessageHelper.Instance().showError("Email or Phone cannot be Empty!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
else if ($("#txt_PhoneorMail").val() != "") {
|
||||
$(".preloader-it").fadeIn();
|
||||
var phoneOrMail = $("#txt_PhoneorMail").val();
|
||||
instance._accountManager.getUser(phoneOrMail, phoneOrMail).then(function (response) {
|
||||
if (response.result != null) {
|
||||
instance.UserName = response.result.userName;
|
||||
$(".lbl_Otp").removeClass('text-danger text-success').text("We have sent OTP on your Mobile Number and Email !");
|
||||
$("#txt_Code").val('');
|
||||
$("#div_ValidationSummary").empty();
|
||||
instance.sendOtp(0);
|
||||
}
|
||||
else {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Enter valid Email/Phone!", "div_ValidationSummary");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
}
|
||||
sendOtp(IsResend) {
|
||||
var instance = this;
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: $("#txt_PhoneorMail").val(),
|
||||
IsSignup: false,
|
||||
IsRegisterUser: false,
|
||||
IsForgotPswd: true,
|
||||
UnibaseId: instance.UserName,
|
||||
OtpId: IsResend,
|
||||
UserOtp: ""
|
||||
};
|
||||
instance._accountManager.sendOtp(postData).then(function (response) {
|
||||
if (IsResend != 0)
|
||||
$(".lbl_Otp").text("OTP has been Resent!").removeClass('text-danger', '').addClass('text-success', '');
|
||||
if (response == 0) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
}
|
||||
else if (response == 2) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("User Is InActive (or) Relieved!", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
instance.OtpId = response;
|
||||
$("#modal_Otp").modal("show");
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
verifyOtp() {
|
||||
var instance = this;
|
||||
if ($("#txt_Code").val() == "")
|
||||
$(".lbl_Otp").text("Please Enter OTP!").addClass('text-danger', '');
|
||||
else {
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: "",
|
||||
IsForgotPswd: false,
|
||||
IsRegisterUser: false,
|
||||
IsSignup: true,
|
||||
UnibaseId: "",
|
||||
OtpId: instance.OtpId,
|
||||
UserOtp: $("#txt_Code").val(),
|
||||
};
|
||||
instance._accountManager.verifyOtp(postData).then(function (response) {
|
||||
if (response.code.toString() == "2") {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$(".lbl_Otp").text("Otp Expired, Please click on Resend to get new OTP").addClass('text-danger', '');
|
||||
$("#txt_Code").val('');
|
||||
}
|
||||
else if (response.result != null) {
|
||||
if (response.result.contactConfirmed == false && response.result.emailConfirmed == false) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$(".lbl_Otp").text("Invalid OTP!").addClass('text-danger', '');
|
||||
$("#txt_Code").val("");
|
||||
}
|
||||
else {
|
||||
$("#div_ForgotPswd").addClass('d-none');
|
||||
$("#modal_Otp").modal("hide");
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#div_ResetPswd").removeClass('d-none');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
resetPassword() {
|
||||
var instance = this;
|
||||
$("#div_ValidationSummary").empty();
|
||||
var confirmPswd = $("#txt_ConfirmPassword").val();
|
||||
var pswd = $("#txt_NewPassword").val();
|
||||
if (pswd.length == 0 || confirmPswd.length == 0) {
|
||||
MessageHelper.Instance().showError("Password fields cannot be empty!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
if ((pswd.length < 8 || confirmPswd.length < 8) || (pswd.length > 15 || confirmPswd.length > 15)) {
|
||||
MessageHelper.Instance().showError("Your password length is " + pswd.length + ", Password must be atleast minimum 8 characters and maximum 15 characters!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
if (pswd != confirmPswd) {
|
||||
MessageHelper.Instance().showError("New and Confirm Passwords doesn't match!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
var password = $("#txt_NewPassword").val();
|
||||
var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
|
||||
var checkpassword = password.match(decimal) ? true : false;
|
||||
if (checkpassword == false) {
|
||||
$(".pr-password").focus();
|
||||
MessageHelper.Instance().showError("Please Match the Password in requested Format", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
$(".preloader-it").fadeIn();
|
||||
var postData = {
|
||||
Password: $("#txt_NewPassword").val(),
|
||||
UserName: instance.UserName,
|
||||
};
|
||||
instance._accountManager.updatePassword(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
$("#div_ResetPswd").addClass('d-none');
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#div_SuccessMsg").removeClass('d-none');
|
||||
MessageHelper.Instance().showSuccess("Password Updated Successfully", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError(response.errors[0], "div_ValidationSummary");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", "div_ValidationSummary");
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
return new ForgotPassword();
|
||||
}
|
||||
}
|
||||
Components.ForgotPassword = ForgotPassword;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
поставляемый
Исполняемый файл
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+331
@@ -0,0 +1,331 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class HomeAffairsForgotPassword extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
var jsfiles = ["tenants/themes/compact/index.mobil_anonymous.js", "platform/membership/managers/accountmanager.js", "libs/passwordrequirement/passwordrequirement.js"];
|
||||
return jsfiles;
|
||||
}
|
||||
cssFiles() {
|
||||
return ["tenants/themes/compact/css/style.ext.css", 'libs/passwordrequirement/passwordrequirement.css'];
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
$(".biz-pg-wrapper").addClass("mt-0");
|
||||
$(".pr-password").focus(function () {
|
||||
var resetPswd = $(".pr-password");
|
||||
resetPswd.passwordRequirements({
|
||||
numCharacters: 8,
|
||||
useLowercase: true,
|
||||
useUppercase: true,
|
||||
useNumbers: true,
|
||||
useSpecial: true
|
||||
});
|
||||
});
|
||||
$("#txt_NewPassword").click(function () {
|
||||
$(this).removeAttr("readonly");
|
||||
});
|
||||
$("#txt_NewPassword").keyup(function (e) {
|
||||
if (e.keyCode == 8) {
|
||||
let check = $(this).val();
|
||||
if (check == "" || check == null || check == 0) {
|
||||
$("#txt_NewPassword").attr("readonly");
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#txt_ConfirmPassword").click(function () {
|
||||
$(this).removeAttr("readonly");
|
||||
});
|
||||
$("#txt_ConfirmPassword").keyup(function (e) {
|
||||
if (e.keyCode == 8) {
|
||||
let check = $(this).val();
|
||||
if (check == "" || check == null || check == 0) {
|
||||
$("#txt_NewPassword").attr("readonly");
|
||||
}
|
||||
}
|
||||
});
|
||||
this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
|
||||
jQuery(".preloader-it").delay(500).fadeOut("slow");
|
||||
jQuery("#external-container").delay(500).fadeIn("slow");
|
||||
jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
|
||||
$("#div_modalbody").removeAttr("style");
|
||||
$('#passwordHide').click(function () {
|
||||
var input = $('#txt_NewPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#passwordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
$('#confirmPasswordHide').click(function () {
|
||||
var input = $('#txt_ConfirmPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#confirmPasswordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
var instance = this;
|
||||
$("#txt_PhoneorMail").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_SendCode").click();
|
||||
});
|
||||
$(".txt_Code:last").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
$("#btn_VerifyCode").click();
|
||||
});
|
||||
$("#txt_NewPassword,#txt_ConfirmPassword").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_ResetPswd").click();
|
||||
});
|
||||
$("#btn_SendCode").click(function () {
|
||||
instance.validate();
|
||||
});
|
||||
$("#btn_VerifyCode").click(function () {
|
||||
instance.verifyOtp();
|
||||
});
|
||||
$("#btn_ResendCode").click(function () {
|
||||
instance.sendOtp(instance.OtpId);
|
||||
});
|
||||
$("#btn_ResetPswd").click(function () {
|
||||
instance.resetPassword();
|
||||
});
|
||||
$('.floating-label-form-group .txt_Code').on('input', function (e) {
|
||||
const inputEl = this;
|
||||
inputEl.value = inputEl.value.replace(/[^0-9]/g, '');
|
||||
});
|
||||
$(".txt_Code").click(function () {
|
||||
$(".lbl_Otp").empty();
|
||||
});
|
||||
if (callback != null)
|
||||
callback();
|
||||
}
|
||||
otpInputTabChange(val) {
|
||||
const ele = $('.txt_Code');
|
||||
if (ele[val - 1].value != '') {
|
||||
if (ele[val])
|
||||
ele[val].focus();
|
||||
}
|
||||
else if (ele[val - 1].value == '') {
|
||||
if (ele[val - 2])
|
||||
ele[val - 2].focus();
|
||||
}
|
||||
}
|
||||
html(id, containerid) {
|
||||
if (jQuery("#external-form").length === 0) {
|
||||
var index = new Components.Index_Mobil_Anonymous();
|
||||
index.init(null);
|
||||
}
|
||||
let assesturl = _appsettings.asset_url();
|
||||
let html = '';
|
||||
if (($(window).width()) > 1200) {
|
||||
html += `<div class="row h-100" style="background:url('` + assesturl + `tenants/themes/compact/imgs/homeaffairs/homeaffariesdesktopbg.jpg');background-size:cover;"> <div class="col-xl-5"> <div class="banner-img-container h-100 d-flex align-items-center justify-content-center pl-145"><img src="` + assesturl + `tenants/themes/compact/imgs/homeaffairs/aa.png" alt="img" class="img-fluid"> </div></div> <div class="col-xl-7 desktop-view"><div id="div_ForgotPassword" class="mt-150"><form id="frm_ForgotPassword" class="align-items-center d-flex justify-content-center " data-validate="parsley" data-isdynamic="false" style="" autocomplete="off"><div id="div_ValidationSummary"></div> <div id="div_ForgotPswd" class=""> <h1 class="display-5 mb-10 text-center text-white">Forgot your Password?</h1><p class="mb-30 text-center text-white">Enter your Phone Number to receive OTP.</p> <div class="form-group"><input class="form-control" required autocomplete="off" placeholder="Enter your Phone Number/Email Address" id="txt_PhoneorMail" type="text"></div><button class="btn text-white btn-block mb-20" id="btn_SendCode" type="button" style="background:#001F5D;">Send OTP</button><p class="text-right"><a href="index.html#/login" class="text-white">Back to login</a></p></div> <div id="div_ResetPswd" class="d-none"><h1 class="display-5 mb-30 text-center">Please reset your password</h1><div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off" readonly><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span>
|
||||
<div class="showpwsdreq"></div> </div> <div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="new-password" readonly><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div><button class="btn btn-block mb-20 text-white" id="btn_ResetPswd" type="button" style="background:#001F5D;">Reset Password</button>
|
||||
<p class="text-right"><a href="/Index.html">Back to login</a></p></div> <div id="div_SuccessMsg" class="d-none"><div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div><h1 class="display-4 mb-20 text-center">Password Updated Successfully</h1><p class="text-center"><a href="index.html#/login">Click here to Login</a></p></div> </form></div></div> </div>`;
|
||||
}
|
||||
else {
|
||||
html += `<div id="div_ForgotPassword"> <form id="frm_ForgotPassword" data-validate="parsley" data-isdynamic="false" style="background: url(` + assesturl + `tenants/themes/compact/imgs/homeaffairs/homeaffariesmobilebg.jpg)!important;" autocomplete="off"> <div id="div_ValidationSummary" class="position-fixed w-100"></div> <div id="div_ForgotPswd" class="" style="color:#686b70"> <div class="d-flex flex-column justify-content-around p-3 " style="height:100vh"><div class="logo_img mx-auto"> <img src="tenants/themes/compact/imgs/homeaffairs/aa.png" class="img-fluid w-100"></div><div class="forgot_pass_header">
|
||||
<div class=""><h1 class="display-5 mb-10 text-center font-weight-bold">ForgotPassword?</h1><p class="mb-30 text-center font-11">Enter your Phone Number to receive OTP.</p></div> <div class="form-group "><input class="form-control" required autocomplete="off" placeholder="Phone Number/Email Address" id="txt_PhoneorMail" type="text"></div> <p class="text-right"><a href="index.html#/login" class="" style="color:#686b70">Back to login</a></p> </div>
|
||||
<div class="forgot_pass_register"><button class="btn btn-block mb-20 rounded-10 text-white" id="btn_SendCode" type="button" style="background:#001F5D; padding: 10px !important;">Send OTP</button></div> </div></div> <div id="div_ResetPswd" class="d-none"><div class="d-flex flex-column justify-content-around p-3 " style="height:100vh"> <div class="pass_fields mt-70"><h1 class=" text-white display-5 mb-30 text-center text-white font-weight-bold">Please reset your password</h1>
|
||||
<div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off" readonly><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span>
|
||||
<div class="showpwsdreq"></div></div><div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="new-password" readonly><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div> <p class="text-right"><a href="/Index.html" class="text-white">Back to login</a></p> </div>
|
||||
<div class="pass_footer"><button class="btn btn-primary btn-block mb-20 rounded-10" id="btn_ResetPswd" type="button" style="background:#001F5D; padding: 10px !important;">Reset Password</button></div>
|
||||
<div id="div_SuccessMsg" class="d-none">
|
||||
<div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div>
|
||||
<h1 class="display-4 mb-20 text-center text-white">Password Updated Successfully</h1>
|
||||
<p class="text-center"><a href="index.html#/login" class="text-white">Click here to Login</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>`;
|
||||
}
|
||||
html += `<div id="modal_Otp" class="modal fade hide">
|
||||
<div class="modal-dialog modal-dialog-centered ">
|
||||
<div class="modal-content ">
|
||||
<div class="modal-header border-0 d-block"><button type="button" class="btn btn-link pull-right font-16 text-secondary p-0" data-dismiss="modal" aria-hidden="true">×</button></div>
|
||||
<div class="modal-body text-center" id="div_modalbody">
|
||||
<img src="tenants/themes/compact/imgs/otp-verify-img.png" class="img-fluid h-100p mx-auto my-10">
|
||||
<h4 class="modal-title font-weight-600">Mobile or Email Verification</h4>
|
||||
|
||||
<div class="lbl_Otp"></div>
|
||||
<div class="otpdiv my-10">
|
||||
<div class="floating-label-form-group mb-2 p-0">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(1)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(2)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(3)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(4)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(5)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(6)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input type="hidden" class="form-control optmsg" id="otpMsg">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer py-10" style="display:block"><button type="button" class="btn btn-outline-primary pull-left" id="btn_ResendCode">Resend</button><button type="button" class="btn btn-outline-primary pull-right" id="btn_VerifyCode">Verify</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
return html;
|
||||
}
|
||||
validate() {
|
||||
var instance = this;
|
||||
if ($("#txt_PhoneorMail").val() == "") {
|
||||
MessageHelper.Instance().showError("Email or Phone cannot be Empty!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
else if ($("#txt_PhoneorMail").val() != "") {
|
||||
$(".preloader-it").fadeIn();
|
||||
var phoneOrMail = $("#txt_PhoneorMail").val();
|
||||
instance._accountManager.getUser(phoneOrMail, phoneOrMail).then(function (response) {
|
||||
if (response.result != null) {
|
||||
instance.UserName = response.result.userName;
|
||||
$(".lbl_Otp").removeClass('text-danger text-success').text("We have sent OTP on your Mobile Number and Email !").addClass("h6 position-relative py-3");
|
||||
$("#txt_Code").val('');
|
||||
$("#div_ValidationSummary").empty();
|
||||
instance.sendOtp(0);
|
||||
}
|
||||
else {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Enter valid Email/Phone!", "div_ValidationSummary");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
}
|
||||
sendOtp(IsResend) {
|
||||
var instance = this;
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: $("#txt_PhoneorMail").val(),
|
||||
IsSignup: false,
|
||||
IsRegisterUser: false,
|
||||
IsForgotPswd: true,
|
||||
UnibaseId: instance.UserName,
|
||||
OtpId: IsResend,
|
||||
UserOtp: ""
|
||||
};
|
||||
instance._accountManager.sendOtp(postData).then(function (response) {
|
||||
if (IsResend != 0)
|
||||
$(".lbl_Otp").text("OTP has been Resent!").removeClass('text-danger', '').addClass('text-success', '');
|
||||
if (response == 0) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
instance.OtpId = response;
|
||||
$("#modal_Otp").modal("show");
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
verifyOtp() {
|
||||
var otpMsg = "";
|
||||
$(".floating-label-form-group .txt_Code").each(function () {
|
||||
otpMsg += $(this).val();
|
||||
});
|
||||
parseInt(otpMsg);
|
||||
$(".floating-label-form-group").find('#otpMsg').attr("value", otpMsg);
|
||||
var instance = this;
|
||||
if ($("#otpMsg").val() == "")
|
||||
$(".lbl_Otp").text("Please Enter OTP!").addClass('text-danger', '');
|
||||
else {
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: "",
|
||||
IsForgotPswd: false,
|
||||
IsRegisterUser: false,
|
||||
IsSignup: true,
|
||||
UnibaseId: "",
|
||||
OtpId: instance.OtpId,
|
||||
UserOtp: $("#otpMsg").val()
|
||||
};
|
||||
instance._accountManager.verifyOtp(postData).then(function (response) {
|
||||
if (response.code.toString() == "2") {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$(".lbl_Otp").text("Otp Expired, Please click on Resend to get new OTP").addClass('text-danger', '');
|
||||
$("#otpMsg").val('');
|
||||
}
|
||||
else if (response.result != null) {
|
||||
if (response.result.contactConfirmed == false && response.result.emailConfirmed == false) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$(".lbl_Otp").text("Invalid OTP!").addClass('text-danger', '');
|
||||
$("#otpMsg").val('');
|
||||
}
|
||||
else {
|
||||
$("#div_ForgotPswd").addClass('d-none');
|
||||
$("#modal_Otp").modal("hide");
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#div_ResetPswd").removeClass('d-none');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
resetPassword() {
|
||||
var instance = this;
|
||||
$("#div_ValidationSummary").empty();
|
||||
var confirmPswd = $("#txt_ConfirmPassword").val();
|
||||
var pswd = $("#txt_NewPassword").val();
|
||||
if (pswd.length == 0 || confirmPswd.length == 0) {
|
||||
MessageHelper.Instance().showError("Password fields cannot be empty!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
if (pswd.length < 8 || confirmPswd.length < 8) {
|
||||
MessageHelper.Instance().showError("Password must be atleast 8 characters!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
var password = $("#txt_NewPassword").val();
|
||||
var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
|
||||
var checkpassword = password.match(decimal) ? true : false;
|
||||
if (checkpassword == false) {
|
||||
$(".pr-password").focus();
|
||||
MessageHelper.Instance().showError("Please Match the Password in requested Format", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if (pswd != confirmPswd) {
|
||||
MessageHelper.Instance().showError("New and Confirm Passwords doesn't match!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
$(".preloader-it").fadeIn();
|
||||
var postData = {
|
||||
Password: $("#txt_NewPassword").val(),
|
||||
UserName: instance.UserName,
|
||||
};
|
||||
instance._accountManager.updatePassword(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
$("#div_ResetPswd").addClass('d-none');
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#div_SuccessMsg").removeClass('d-none');
|
||||
MessageHelper.Instance().showSuccess("Password Updated Successfully", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError(response.errors[0], "div_ValidationSummary");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", "div_ValidationSummary");
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
return new HomeAffairsForgotPassword();
|
||||
}
|
||||
}
|
||||
Components.HomeAffairsForgotPassword = HomeAffairsForgotPassword;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
Исполняемый файл
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
+308
@@ -0,0 +1,308 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class MobilForgotPassword extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
var jsfiles = ["tenants/themes/compact/index.anonymous.js", "platform/membership/managers/accountmanager.js", "libs/passwordrequirement/passwordrequirement.js"];
|
||||
return jsfiles;
|
||||
}
|
||||
cssFiles() {
|
||||
return ["tenants/themes/compact/css/style.ext.css", 'libs/passwordrequirement/passwordrequirement.css'];
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
$(".pr-password").focus(function () {
|
||||
var resetPswd = $(".pr-password");
|
||||
resetPswd.passwordRequirements({
|
||||
numCharacters: 8,
|
||||
useLowercase: true,
|
||||
useUppercase: true,
|
||||
useNumbers: true,
|
||||
useSpecial: true
|
||||
});
|
||||
});
|
||||
$("#txt_NewPassword").click(function () {
|
||||
$(this).removeAttr("readonly");
|
||||
});
|
||||
$("#txt_NewPassword").keyup(function (e) {
|
||||
if (e.keyCode == 8) {
|
||||
let check = $(this).val();
|
||||
if (check == "" || check == null || check == 0) {
|
||||
$("#txt_NewPassword").attr("readonly");
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#txt_ConfirmPassword").click(function () {
|
||||
$(this).removeAttr("readonly");
|
||||
});
|
||||
$("#txt_ConfirmPassword").keyup(function (e) {
|
||||
if (e.keyCode == 8) {
|
||||
let check = $(this).val();
|
||||
if (check == "" || check == null || check == 0) {
|
||||
$("#txt_NewPassword").attr("readonly");
|
||||
}
|
||||
}
|
||||
});
|
||||
this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
|
||||
jQuery(".preloader-it").delay(500).fadeOut("slow");
|
||||
jQuery("#external-container").delay(500).fadeIn("slow");
|
||||
jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
|
||||
$("#div_modalbody").removeAttr("style");
|
||||
$('#passwordHide').click(function () {
|
||||
var input = $('#txt_NewPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#passwordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
$('#confirmPasswordHide').click(function () {
|
||||
var input = $('#txt_ConfirmPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#confirmPasswordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
var instance = this;
|
||||
$("#txt_PhoneorMail").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_SendCode").click();
|
||||
});
|
||||
$(".txt_Code:last").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
$("#btn_VerifyCode").click();
|
||||
});
|
||||
$("#txt_NewPassword,#txt_ConfirmPassword").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_ResetPswd").click();
|
||||
});
|
||||
$("#btn_SendCode").click(function () {
|
||||
instance.validate();
|
||||
});
|
||||
$("#btn_VerifyCode").click(function () {
|
||||
instance.verifyOtp();
|
||||
});
|
||||
$("#btn_ResendCode").click(function () {
|
||||
instance.sendOtp(instance.OtpId);
|
||||
});
|
||||
$("#btn_ResetPswd").click(function () {
|
||||
instance.resetPassword();
|
||||
});
|
||||
$('.floating-label-form-group .txt_Code').on('input', function (e) {
|
||||
const inputEl = this;
|
||||
inputEl.value = inputEl.value.replace(/[^0-9]/g, '');
|
||||
});
|
||||
$(".txt_Code").click(function () {
|
||||
$(".lbl_Otp").empty();
|
||||
});
|
||||
if (callback != null)
|
||||
callback();
|
||||
}
|
||||
otpInputTabChange(val) {
|
||||
const ele = $('.txt_Code');
|
||||
if (ele[val - 1].value != '') {
|
||||
if (ele[val])
|
||||
ele[val].focus();
|
||||
}
|
||||
else if (ele[val - 1].value == '') {
|
||||
if (ele[val - 2])
|
||||
ele[val - 2].focus();
|
||||
}
|
||||
}
|
||||
html(id, containerid) {
|
||||
if (jQuery("#external-form").length === 0) {
|
||||
var index = new Components.Index_Anonymous();
|
||||
index.init(null);
|
||||
}
|
||||
const html = `<div id="div_ForgotPassword"><form id="frm_ForgotPassword" data-validate="parsley" data-isdynamic="false" style="" autocomplete="off">
|
||||
<div id="div_ValidationSummary"></div><div id="div_ForgotPswd" class=""><h1 class="display-5 mb-10 text-center">Forgot your Password?</h1><p class="mb-30 text-center">Enter your Phone Number to receive OTP.</p><div class="form-group"><input class="form-control" required autocomplete="off" placeholder="Enter your Phone Number/Email Address" id="txt_PhoneorMail" type="text"></div><button class="btn btn-primary btn-block mb-20" id="btn_SendCode" type="button">Send OTP</button><p class="text-right"><a href="index.html#/login">Back to login</a></p></div><div id="div_ResetPswd" class="d-none"><h1 class="display-5 mb-30 text-center">Please reset your password</h1><div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off" readonly><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span><div class="showpwsdreq"></div></div><div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="new-password" readonly><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div>
|
||||
<button class="btn btn-primary btn-block mb-20" id="btn_ResetPswd" type="button">Reset Password</button><p class="text-right"><a href="/Index.html">Back to login</a></p></div><div id="div_SuccessMsg" class="d-none"><div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div><h1 class="display-4 mb-20 text-center">Password Updated Successfully</h1><p class="text-center"><a href="index.html#/login">Click here to Login</a></p></div></form><div id="modal_Otp" class="modal fade hide">
|
||||
<div class="modal-dialog modal-dialog-centered ">
|
||||
<div class="modal-content ">
|
||||
<div class="modal-header border-0 d-block"><button type="button" class="btn btn-link pull-right font-16 text-secondary p-0" data-dismiss="modal" aria-hidden="true" >×</button></div>
|
||||
<div class="modal-body text-center" id="div_modalbody">
|
||||
<img src="tenants/themes/compact/imgs/otp-verify-img.png" class="img-fluid h-100p mx-auto my-10" >
|
||||
<h4 class="modal-title font-weight-600">Mobile or Email Verification</h4>
|
||||
|
||||
<div class="lbl_Otp"></div>
|
||||
<div class="otpdiv my-10">
|
||||
<div class="floating-label-form-group mb-2 p-0">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(1)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(2)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(3)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(4)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(5)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(6)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input type="hidden" class="form-control optmsg" id="otpMsg" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer py-10" style="display:block"><button type = "button" class="btn btn-outline-primary pull-left" id="btn_ResendCode">Resend</button><button type = "button" class="btn btn-outline-primary pull-right" id="btn_VerifyCode">Verify</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
return html;
|
||||
}
|
||||
validate() {
|
||||
var instance = this;
|
||||
if ($("#txt_PhoneorMail").val() == "") {
|
||||
MessageHelper.Instance().showError("Email or Phone cannot be Empty!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
else if ($("#txt_PhoneorMail").val() != "") {
|
||||
$(".preloader-it").fadeIn();
|
||||
var phoneOrMail = $("#txt_PhoneorMail").val();
|
||||
instance._accountManager.getUser(phoneOrMail, phoneOrMail).then(function (response) {
|
||||
if (response.result != null) {
|
||||
instance.UserName = response.result.userName;
|
||||
$(".lbl_Otp").removeClass('text-danger text-success').text("We have sent OTP on your Mobile Number and Email !").addClass("h6 position-relative py-3");
|
||||
$("#txt_Code").val('');
|
||||
$("#div_ValidationSummary").empty();
|
||||
instance.sendOtp(0);
|
||||
}
|
||||
else {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Enter valid Email/Phone!", "div_ValidationSummary");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
}
|
||||
sendOtp(IsResend) {
|
||||
var instance = this;
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: $("#txt_PhoneorMail").val(),
|
||||
IsSignup: false,
|
||||
IsRegisterUser: false,
|
||||
IsForgotPswd: true,
|
||||
UnibaseId: instance.UserName,
|
||||
OtpId: IsResend,
|
||||
UserOtp: ""
|
||||
};
|
||||
instance._accountManager.sendOtp(postData).then(function (response) {
|
||||
if (IsResend != 0)
|
||||
$(".lbl_Otp").text("OTP has been Resent!").removeClass('text-danger', '').addClass('text-success', '');
|
||||
if (response == 0) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
instance.OtpId = response;
|
||||
$("#modal_Otp").modal("show");
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
verifyOtp() {
|
||||
var otpMsg = "";
|
||||
$(".floating-label-form-group .txt_Code").each(function () {
|
||||
otpMsg += $(this).val();
|
||||
});
|
||||
parseInt(otpMsg);
|
||||
$(".floating-label-form-group").find('#otpMsg').attr("value", otpMsg);
|
||||
var instance = this;
|
||||
if ($("#otpMsg").val() == "")
|
||||
$(".lbl_Otp").text("Please Enter OTP!").addClass('text-danger', '');
|
||||
else {
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: "",
|
||||
IsForgotPswd: false,
|
||||
IsRegisterUser: false,
|
||||
IsSignup: true,
|
||||
UnibaseId: "",
|
||||
OtpId: instance.OtpId,
|
||||
UserOtp: $("#otpMsg").val(),
|
||||
};
|
||||
instance._accountManager.verifyOtp(postData).then(function (response) {
|
||||
if (response.code.toString() == "2") {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$(".lbl_Otp").text("Otp Expired, Please click on Resend to get new OTP").addClass('text-danger', '');
|
||||
$("#otpMsg").val('');
|
||||
}
|
||||
else if (response.result != null) {
|
||||
if (response.result.contactConfirmed == false && response.result.emailConfirmed == false) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$(".lbl_Otp").text("Invalid OTP!").addClass('text-danger', '');
|
||||
$("#otpMsg").val('');
|
||||
}
|
||||
else {
|
||||
$("#div_ForgotPswd").addClass('d-none');
|
||||
$("#modal_Otp").modal("hide");
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#div_ResetPswd").removeClass('d-none');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
resetPassword() {
|
||||
var instance = this;
|
||||
$("#div_ValidationSummary").empty();
|
||||
var confirmPswd = $("#txt_ConfirmPassword").val();
|
||||
var pswd = $("#txt_NewPassword").val();
|
||||
if (pswd.length == 0 || confirmPswd.length == 0) {
|
||||
MessageHelper.Instance().showError("Password fields cannot be empty!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
if (pswd.length < 8 || confirmPswd.length < 8) {
|
||||
MessageHelper.Instance().showError("Password must be atleast 8 characters!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
var password = $("#txt_NewPassword").val();
|
||||
var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
|
||||
var checkpassword = password.match(decimal) ? true : false;
|
||||
if (checkpassword == false) {
|
||||
$(".pr-password").focus();
|
||||
MessageHelper.Instance().showError("Please Match the Password in requested Format", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if (pswd != confirmPswd) {
|
||||
MessageHelper.Instance().showError("New and Confirm Passwords doesn't match!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
$(".preloader-it").fadeIn();
|
||||
var postData = {
|
||||
Password: $("#txt_NewPassword").val(),
|
||||
UserName: instance.UserName,
|
||||
};
|
||||
instance._accountManager.updatePassword(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
$("#div_ResetPswd").addClass('d-none');
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#div_SuccessMsg").removeClass('d-none');
|
||||
MessageHelper.Instance().showSuccess("Password Updated Successfully", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError(response.errors[0], "div_ValidationSummary");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", "div_ValidationSummary");
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
return new MobilForgotPassword();
|
||||
}
|
||||
}
|
||||
Components.MobilForgotPassword = MobilForgotPassword;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
Исполняемый файл
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
поставляемый
Исполняемый файл
+29
@@ -0,0 +1,29 @@
|
||||
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{jsFiles(){return["tenants/themes/compact/index.anonymous.js","platform/membership/managers/accountmanager.js","libs/passwordrequirement/passwordrequirement.js"]}cssFiles(){return["tenants/themes/compact/css/style.ext.css","libs/passwordrequirement/passwordrequirement.css"]}load(t,i,r){$(".pr-password").focus(function(){var n=$(".pr-password");n.passwordRequirements({numCharacters:8,useLowercase:!0,useUppercase:!0,useNumbers:!0,useSpecial:!0})});$("#txt_NewPassword").click(function(){$(this).removeAttr("readonly")});$("#txt_NewPassword").keyup(function(n){if(n.keyCode==8){let n=$(this).val();(n==""||n==null||n==0)&&$("#txt_NewPassword").attr("readonly")}});$("#txt_ConfirmPassword").click(function(){$(this).removeAttr("readonly")});$("#txt_ConfirmPassword").keyup(function(n){if(n.keyCode==8){let n=$(this).val();(n==""||n==null||n==0)&&$("#txt_NewPassword").attr("readonly")}});this._accountManager=n.Platform.Membership.Managers.AccountManager.Instance();jQuery(".preloader-it").delay(500).fadeOut("slow");jQuery("#external-container").delay(500).fadeIn("slow");jQuery("#bizgaze_body").css("background-color","#f4f6f7");$("#div_modalbody").removeAttr("style");$("#passwordHide").click(function(){var n=$("#txt_NewPassword");n.attr("type")=="password"?n.attr("type","text"):n.attr("type","password");$("#passwordHide").toggleClass("fa-eye-slash fa-eye")});$("#confirmPasswordHide").click(function(){var n=$("#txt_ConfirmPassword");n.attr("type")=="password"?n.attr("type","text"):n.attr("type","password");$("#confirmPasswordHide").toggleClass("fa-eye-slash fa-eye")});var u=this;$("#txt_PhoneorMail").keypress(function(n){n.which==13&&document.getElementById("btn_SendCode").click()});$(".txt_Code:last").keypress(function(n){n.which==13&&$("#btn_VerifyCode").click()});$("#txt_NewPassword,#txt_ConfirmPassword").keypress(function(n){n.which==13&&document.getElementById("btn_ResetPswd").click()});$("#btn_SendCode").click(function(){u.validate()});$("#btn_VerifyCode").click(function(){u.verifyOtp()});$("#btn_ResendCode").click(function(){u.sendOtp(u.OtpId)});$("#btn_ResetPswd").click(function(){u.resetPassword()});$(".floating-label-form-group .txt_Code").on("input",function(){const n=this;n.value=n.value.replace(/[^0-9]/g,"")});$(".txt_Code").click(function(){$(".lbl_Otp").empty()});r!=null&&r()}otpInputTabChange(n){const t=$(".txt_Code");t[n-1].value!=""?t[n]&&t[n].focus():t[n-1].value==""&&t[n-2]&&t[n-2].focus()}html(){if(jQuery("#external-form").length===0){var n=new t.Index_Anonymous;n.init(null)}return`<div id="div_ForgotPassword"><form id="frm_ForgotPassword" data-validate="parsley" data-isdynamic="false" style="" autocomplete="off">
|
||||
<div id="div_ValidationSummary"></div><div id="div_ForgotPswd" class=""><h1 class="display-5 mb-10 text-center">Forgot your Password?</h1><p class="mb-30 text-center">Enter your Phone Number to receive OTP.</p><div class="form-group"><input class="form-control" required autocomplete="off" placeholder="Enter your Phone Number/Email Address" id="txt_PhoneorMail" type="text"></div><button class="btn btn-primary btn-block mb-20" id="btn_SendCode" type="button">Send OTP</button><p class="text-right"><a href="index.html#/login">Back to login</a></p></div><div id="div_ResetPswd" class="d-none"><h1 class="display-5 mb-30 text-center">Please reset your password</h1><div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off" readonly><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span><div class="showpwsdreq"></div></div><div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="new-password" readonly><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div>
|
||||
<button class="btn btn-primary btn-block mb-20" id="btn_ResetPswd" type="button">Reset Password</button><p class="text-right"><a href="/Index.html">Back to login</a></p></div><div id="div_SuccessMsg" class="d-none"><div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div><h1 class="display-4 mb-20 text-center">Password Updated Successfully</h1><p class="text-center"><a href="index.html#/login">Click here to Login</a></p></div></form><div id="modal_Otp" class="modal fade hide">
|
||||
<div class="modal-dialog modal-dialog-centered ">
|
||||
<div class="modal-content ">
|
||||
<div class="modal-header border-0 d-block"><button type="button" class="btn btn-link pull-right font-16 text-secondary p-0" data-dismiss="modal" aria-hidden="true" >×</button></div>
|
||||
<div class="modal-body text-center" id="div_modalbody">
|
||||
<img src="tenants/themes/compact/imgs/otp-verify-img.png" class="img-fluid h-100p mx-auto my-10" >
|
||||
<h4 class="modal-title font-weight-600">Mobile or Email Verification</h4>
|
||||
|
||||
<div class="lbl_Otp"></div>
|
||||
<div class="otpdiv my-10">
|
||||
<div class="floating-label-form-group mb-2 p-0">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(1)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(2)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(3)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(4)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(5)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(6)' id ="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input type="hidden" class="form-control optmsg" id="otpMsg" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer py-10" style="display:block"><button type = "button" class="btn btn-outline-primary pull-left" id="btn_ResendCode">Resend</button><button type = "button" class="btn btn-outline-primary pull-right" id="btn_VerifyCode">Verify</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`}validate(){var n=this,t;if($("#txt_PhoneorMail").val()=="")return MessageHelper.Instance().showError("Email or Phone cannot be Empty!","div_ValidationSummary"),!1;$("#txt_PhoneorMail").val()!=""&&($(".preloader-it").fadeIn(),t=$("#txt_PhoneorMail").val(),n._accountManager.getUser(t,t).then(function(t){t.result!=null?(n.UserName=t.result.userName,$(".lbl_Otp").removeClass("text-danger text-success").text("We have sent OTP on your Mobile Number and Email !").addClass("h6 position-relative py-3"),$("#txt_Code").val(""),$("#div_ValidationSummary").empty(),n.sendOtp(0)):($(".preloader-it").delay(200).fadeOut("slow"),MessageHelper.Instance().showError("Enter valid Email/Phone!","div_ValidationSummary"))},function(){$(".preloader-it").delay(200).fadeOut("slow");MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")}))}sendOtp(n){var t=this,i={FirstName:"",LastName:"",ContactNumber:"",Email:"",TenantName:"",ContactOrEmail:$("#txt_PhoneorMail").val(),IsSignup:!1,IsRegisterUser:!1,IsForgotPswd:!0,UnibaseId:t.UserName,OtpId:n,UserOtp:""};t._accountManager.sendOtp(i).then(function(i){n!=0&&$(".lbl_Otp").text("OTP has been Resent!").removeClass("text-danger","").addClass("text-success","");i==0?($(".preloader-it").delay(200).fadeOut("slow"),MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")):(t.OtpId=i,$("#modal_Otp").modal("show"),$(".preloader-it").delay(200).fadeOut("slow"))},function(){$(".preloader-it").delay(200).fadeOut("slow");MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")})}verifyOtp(){var n="",t,i;$(".floating-label-form-group .txt_Code").each(function(){n+=$(this).val()});parseInt(n);$(".floating-label-form-group").find("#otpMsg").attr("value",n);t=this;$("#otpMsg").val()==""?$(".lbl_Otp").text("Please Enter OTP!").addClass("text-danger",""):(i={FirstName:"",LastName:"",ContactNumber:"",Email:"",TenantName:"",ContactOrEmail:"",IsForgotPswd:!1,IsRegisterUser:!1,IsSignup:!0,UnibaseId:"",OtpId:t.OtpId,UserOtp:$("#otpMsg").val()},t._accountManager.verifyOtp(i).then(function(n){n.code.toString()=="2"?($(".preloader-it").delay(200).fadeOut("slow"),$(".lbl_Otp").text("Otp Expired, Please click on Resend to get new OTP").addClass("text-danger",""),$("#otpMsg").val("")):n.result!=null&&(n.result.contactConfirmed==!1&&n.result.emailConfirmed==!1?($(".preloader-it").delay(200).fadeOut("slow"),$(".lbl_Otp").text("Invalid OTP!").addClass("text-danger",""),$("#otpMsg").val("")):($("#div_ForgotPswd").addClass("d-none"),$("#modal_Otp").modal("hide"),$(".preloader-it").delay(200).fadeOut("slow"),$("#div_ResetPswd").removeClass("d-none")))}))}resetPassword(){var i=this,n,t,r;if($("#div_ValidationSummary").empty(),n=$("#txt_ConfirmPassword").val(),t=$("#txt_NewPassword").val(),t.length==0||n.length==0)return MessageHelper.Instance().showError("Password fields cannot be empty!","div_ValidationSummary"),!1;if(t.length<8||n.length<8)return MessageHelper.Instance().showError("Password must be atleast 8 characters!","div_ValidationSummary"),!1;var u=$("#txt_NewPassword").val(),f=u.match(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/)?!0:!1;if(f==!1)return $(".pr-password").focus(),MessageHelper.Instance().showError("Please Match the Password in requested Format","div_ValidationSummary"),!1;if(t!=n)return MessageHelper.Instance().showError("New and Confirm Passwords doesn't match!","div_ValidationSummary"),!1;$(".preloader-it").fadeIn();r={Password:$("#txt_NewPassword").val(),UserName:i.UserName};i._accountManager.updatePassword(r).then(function(n){n.errors==null?($("#div_ResetPswd").addClass("d-none"),$(".preloader-it").delay(200).fadeOut("slow"),$("#div_SuccessMsg").removeClass("d-none"),MessageHelper.Instance().showSuccess("Password Updated Successfully","div_ValidationSummary")):($(".preloader-it").delay(200).fadeOut("slow"),MessageHelper.Instance().showError(n.errors[0],"div_ValidationSummary"))},function(){$(".preloader-it").delay(200).fadeOut("slow");MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")})}static Instance(){return new i}}t.MobilForgotPassword=i})(i=t.Components||(t.Components={}))})(i=t.Compact||(t.Compact={}))})(t=n.Themes||(n.Themes={}))})(Unibase||(Unibase={}));
|
||||
+329
@@ -0,0 +1,329 @@
|
||||
var Unibase;
|
||||
(function (Unibase) {
|
||||
let Themes;
|
||||
(function (Themes) {
|
||||
let Compact;
|
||||
(function (Compact) {
|
||||
let Components;
|
||||
(function (Components) {
|
||||
class MobilNewForgotPassword extends Unibase.Platform.Core.BaseComponent {
|
||||
jsFiles() {
|
||||
var jsfiles = ["tenants/themes/compact/index.mobil_anonymous.js", "platform/membership/managers/accountmanager.js", "libs/passwordrequirement/passwordrequirement.js"];
|
||||
return jsfiles;
|
||||
}
|
||||
cssFiles() {
|
||||
return ["tenants/themes/compact/css/style.ext.css", 'libs/passwordrequirement/passwordrequirement.css'];
|
||||
}
|
||||
load(id, containerid, callback) {
|
||||
$(".pr-password").focus(function () {
|
||||
var resetPswd = $(".pr-password");
|
||||
resetPswd.passwordRequirements({
|
||||
numCharacters: 8,
|
||||
useLowercase: true,
|
||||
useUppercase: true,
|
||||
useNumbers: true,
|
||||
useSpecial: true
|
||||
});
|
||||
});
|
||||
$("#txt_NewPassword").click(function () {
|
||||
$(this).removeAttr("readonly");
|
||||
});
|
||||
$("#txt_NewPassword").keyup(function (e) {
|
||||
if (e.keyCode == 8) {
|
||||
let check = $(this).val();
|
||||
if (check == "" || check == null || check == 0) {
|
||||
$("#txt_NewPassword").attr("readonly");
|
||||
}
|
||||
}
|
||||
});
|
||||
$("#txt_ConfirmPassword").click(function () {
|
||||
$(this).removeAttr("readonly");
|
||||
});
|
||||
$("#txt_ConfirmPassword").keyup(function (e) {
|
||||
if (e.keyCode == 8) {
|
||||
let check = $(this).val();
|
||||
if (check == "" || check == null || check == 0) {
|
||||
$("#txt_NewPassword").attr("readonly");
|
||||
}
|
||||
}
|
||||
});
|
||||
this._accountManager = Unibase.Platform.Membership.Managers.AccountManager.Instance();
|
||||
jQuery(".preloader-it").delay(500).fadeOut("slow");
|
||||
jQuery("#external-container").delay(500).fadeIn("slow");
|
||||
jQuery("#bizgaze_body").css("background-color", "#f4f6f7");
|
||||
$("#div_modalbody").removeAttr("style");
|
||||
$('#passwordHide').click(function () {
|
||||
var input = $('#txt_NewPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#passwordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
$('#confirmPasswordHide').click(function () {
|
||||
var input = $('#txt_ConfirmPassword');
|
||||
input.attr('type') == "password" ? input.attr('type', 'text') : input.attr('type', 'password');
|
||||
$('#confirmPasswordHide').toggleClass('fa-eye-slash fa-eye');
|
||||
});
|
||||
var instance = this;
|
||||
$("#txt_PhoneorMail").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_SendCode").click();
|
||||
});
|
||||
$(".txt_Code:last").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
$("#btn_VerifyCode").click();
|
||||
});
|
||||
$("#txt_NewPassword,#txt_ConfirmPassword").keypress(function (e) {
|
||||
if (e.which == 13)
|
||||
document.getElementById("btn_ResetPswd").click();
|
||||
});
|
||||
$("#btn_SendCode").click(function () {
|
||||
instance.validate();
|
||||
});
|
||||
$("#btn_VerifyCode").click(function () {
|
||||
instance.verifyOtp();
|
||||
});
|
||||
$("#btn_ResendCode").click(function () {
|
||||
instance.sendOtp(instance.OtpId);
|
||||
});
|
||||
$("#btn_ResetPswd").click(function () {
|
||||
instance.resetPassword();
|
||||
});
|
||||
$('.floating-label-form-group .txt_Code').on('input', function (e) {
|
||||
const inputEl = this;
|
||||
inputEl.value = inputEl.value.replace(/[^0-9]/g, '');
|
||||
});
|
||||
$(".txt_Code").click(function () {
|
||||
$(".lbl_Otp").empty();
|
||||
});
|
||||
if (callback != null)
|
||||
callback();
|
||||
}
|
||||
otpInputTabChange(val) {
|
||||
const ele = $('.txt_Code');
|
||||
if (ele[val - 1].value != '') {
|
||||
if (ele[val])
|
||||
ele[val].focus();
|
||||
}
|
||||
else if (ele[val - 1].value == '') {
|
||||
if (ele[val - 2])
|
||||
ele[val - 2].focus();
|
||||
}
|
||||
}
|
||||
html(id, containerid) {
|
||||
if (jQuery("#external-form").length === 0) {
|
||||
var index = new Components.Index_Mobil_Anonymous();
|
||||
index.init(null);
|
||||
}
|
||||
let html = '';
|
||||
if (($(window).width()) > 1200) {
|
||||
html += `<div class="row h-100"> <div class="col-xl-5"> <div class="banner-img-container h-100"><img src="tenants/themes/compact/imgs/mobil-desktop-view-bg.png" alt="img" class="h-100 w-100"> </div></div> <div class="col-xl-7 desktop-view"><div id="div_ForgotPassword" class="mt-100"><form id="frm_ForgotPassword" data-validate="parsley" data-isdynamic="false" style="" autocomplete="off"><div id="div_ValidationSummary"></div> <div id="div_ForgotPswd" class=""> <h1 class="display-5 mb-10 text-center">Forgot your Password?</h1><p class="mb-30 text-center">Enter your Phone Number to receive OTP.</p> <div class="form-group"><input class="form-control" required autocomplete="off" placeholder="Enter your Phone Number/Email Address" id="txt_PhoneorMail" type="text"></div><button class="btn text-white btn-block mb-20" id="btn_SendCode" type="button" style="background:#001F5D;">Send OTP</button><p class="text-right"><a href="index.html#/login">Back to login</a></p></div> <div id="div_ResetPswd" class="d-none"><h1 class="display-5 mb-30 text-center">Please reset your password</h1><div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off" readonly><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span>
|
||||
<div class="showpwsdreq"></div> </div> <div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="new-password" readonly><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div><button class="btn btn-block mb-20 text-white" id="btn_ResetPswd" type="button" style="background:#001F5D;">Reset Password</button>
|
||||
<p class="text-right"><a href="/Index.html">Back to login</a></p></div> <div id="div_SuccessMsg" class="d-none"><div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div><h1 class="display-4 mb-20 text-center">Password Updated Successfully</h1><p class="text-center"><a href="index.html#/login">Click here to Login</a></p></div> </form></div></div> </div>`;
|
||||
}
|
||||
else {
|
||||
html += `<div id="div_ForgotPassword"> <form id="frm_ForgotPassword" data-validate="parsley" data-isdynamic="false" style="background: url(tenants/themes/compact/imgs/mobil-background.png) no-repeat;" autocomplete="off"> <div id="div_ValidationSummary" class="position-fixed w-100"></div> <div id="div_ForgotPswd" class=""> <div class="d-flex flex-column justify-content-around p-3 " style="height:100vh"><div class="forgot_pass_header mt-100">
|
||||
<div class=""><h1 class="display-5 mb-10 text-center text-white font-weight-bold">ForgotPassword?</h1><p class="mb-30 text-center text-white font-11">Enter your Phone Number to receive OTP.</p></div> <div class="form-group "><input class="form-control" required autocomplete="off" placeholder="Phone Number/Email Address" id="txt_PhoneorMail" type="text"></div> <p class="text-right"><a href="index.html#/login" class="text-white">Back to login</a></p> </div>
|
||||
<div class="forgot_pass_register"><button class="btn btn-block mb-20 rounded-10 text-white" id="btn_SendCode" type="button" style="background:#001F5D; padding: 10px !important;">Send OTP</button></div> </div></div> <div id="div_ResetPswd" class="d-none"><div class="d-flex flex-column justify-content-around p-3 " style="height:100vh"> <div class="pass_fields mt-70"><h1 class="display-5 mb-30 text-center text-white font-weight-bold">Please reset your password</h1>
|
||||
<div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off" readonly><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span>
|
||||
<div class="showpwsdreq"></div></div><div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="new-password" readonly><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div> <p class="text-right"><a href="/Index.html" class="text-white">Back to login</a></p> </div>
|
||||
<div class="pass_footer"><button class="btn btn-primary btn-block mb-20 rounded-10" id="btn_ResetPswd" type="button" style="background:#001F5D; padding: 10px !important;">Reset Password</button></div>
|
||||
<div id="div_SuccessMsg" class="d-none">
|
||||
<div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div>
|
||||
<h1 class="display-4 mb-20 text-center">Password Updated Successfully</h1>
|
||||
<p class="text-center"><a href="index.html#/login">Click here to Login</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>`;
|
||||
}
|
||||
html += `<div id="modal_Otp" class="modal fade hide">
|
||||
<div class="modal-dialog modal-dialog-centered ">
|
||||
<div class="modal-content ">
|
||||
<div class="modal-header border-0 d-block"><button type="button" class="btn btn-link pull-right font-16 text-secondary p-0" data-dismiss="modal" aria-hidden="true">×</button></div>
|
||||
<div class="modal-body text-center" id="div_modalbody">
|
||||
<img src="tenants/themes/compact/imgs/otp-verify-img.png" class="img-fluid h-100p mx-auto my-10">
|
||||
<h4 class="modal-title font-weight-600">Mobile or Email Verification</h4>
|
||||
|
||||
<div class="lbl_Otp"></div>
|
||||
<div class="otpdiv my-10">
|
||||
<div class="floating-label-form-group mb-2 p-0">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(1)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(2)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(3)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(4)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(5)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(6)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input type="hidden" class="form-control optmsg" id="otpMsg">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer py-10" style="display:block"><button type="button" class="btn btn-outline-primary pull-left" id="btn_ResendCode">Resend</button><button type="button" class="btn btn-outline-primary pull-right" id="btn_VerifyCode">Verify</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
return html;
|
||||
}
|
||||
validate() {
|
||||
var instance = this;
|
||||
if ($("#txt_PhoneorMail").val() == "") {
|
||||
MessageHelper.Instance().showError("Email or Phone cannot be Empty!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
else if ($("#txt_PhoneorMail").val() != "") {
|
||||
$(".preloader-it").fadeIn();
|
||||
var phoneOrMail = $("#txt_PhoneorMail").val();
|
||||
instance._accountManager.getUser(phoneOrMail, phoneOrMail).then(function (response) {
|
||||
if (response.result != null) {
|
||||
instance.UserName = response.result.userName;
|
||||
$(".lbl_Otp").removeClass('text-danger text-success').text("We have sent OTP on your Mobile Number and Email !").addClass("h6 position-relative py-3");
|
||||
$("#txt_Code").val('');
|
||||
$("#div_ValidationSummary").empty();
|
||||
instance.sendOtp(0);
|
||||
}
|
||||
else {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Enter valid Email/Phone!", "div_ValidationSummary");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
}
|
||||
sendOtp(IsResend) {
|
||||
var instance = this;
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: $("#txt_PhoneorMail").val(),
|
||||
IsSignup: false,
|
||||
IsRegisterUser: false,
|
||||
IsForgotPswd: true,
|
||||
UnibaseId: instance.UserName,
|
||||
OtpId: IsResend,
|
||||
UserOtp: ""
|
||||
};
|
||||
instance._accountManager.sendOtp(postData).then(function (response) {
|
||||
if (IsResend != 0)
|
||||
$(".lbl_Otp").text("OTP has been Resent!").removeClass('text-danger', '').addClass('text-success', '');
|
||||
if (response == 0) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
instance.OtpId = response;
|
||||
$("#modal_Otp").modal("show");
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", 'div_ValidationSummary');
|
||||
});
|
||||
}
|
||||
verifyOtp() {
|
||||
var otpMsg = "";
|
||||
$(".floating-label-form-group .txt_Code").each(function () {
|
||||
otpMsg += $(this).val();
|
||||
});
|
||||
parseInt(otpMsg);
|
||||
$(".floating-label-form-group").find('#otpMsg').attr("value", otpMsg);
|
||||
var instance = this;
|
||||
if ($("#otpMsg").val() == "")
|
||||
$(".lbl_Otp").text("Please Enter OTP!").addClass('text-danger', '');
|
||||
else {
|
||||
var postData = {
|
||||
FirstName: "",
|
||||
LastName: "",
|
||||
ContactNumber: "",
|
||||
Email: "",
|
||||
TenantName: "",
|
||||
ContactOrEmail: "",
|
||||
IsForgotPswd: false,
|
||||
IsRegisterUser: false,
|
||||
IsSignup: true,
|
||||
UnibaseId: "",
|
||||
OtpId: instance.OtpId,
|
||||
UserOtp: $("#otpMsg").val()
|
||||
};
|
||||
instance._accountManager.verifyOtp(postData).then(function (response) {
|
||||
if (response.code.toString() == "2") {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$(".lbl_Otp").text("Otp Expired, Please click on Resend to get new OTP").addClass('text-danger', '');
|
||||
$("#otpMsg").val('');
|
||||
}
|
||||
else if (response.result != null) {
|
||||
if (response.result.contactConfirmed == false && response.result.emailConfirmed == false) {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$(".lbl_Otp").text("Invalid OTP!").addClass('text-danger', '');
|
||||
$("#otpMsg").val('');
|
||||
}
|
||||
else {
|
||||
$("#div_ForgotPswd").addClass('d-none');
|
||||
$("#modal_Otp").modal("hide");
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#div_ResetPswd").removeClass('d-none');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
resetPassword() {
|
||||
var instance = this;
|
||||
$("#div_ValidationSummary").empty();
|
||||
var confirmPswd = $("#txt_ConfirmPassword").val();
|
||||
var pswd = $("#txt_NewPassword").val();
|
||||
if (pswd.length == 0 || confirmPswd.length == 0) {
|
||||
MessageHelper.Instance().showError("Password fields cannot be empty!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
if (pswd.length < 8 || confirmPswd.length < 8) {
|
||||
MessageHelper.Instance().showError("Password must be atleast 8 characters!", 'div_ValidationSummary');
|
||||
return false;
|
||||
}
|
||||
var password = $("#txt_NewPassword").val();
|
||||
var decimal = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/;
|
||||
var checkpassword = password.match(decimal) ? true : false;
|
||||
if (checkpassword == false) {
|
||||
$(".pr-password").focus();
|
||||
MessageHelper.Instance().showError("Please Match the Password in requested Format", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
if (pswd != confirmPswd) {
|
||||
MessageHelper.Instance().showError("New and Confirm Passwords doesn't match!", "div_ValidationSummary");
|
||||
return false;
|
||||
}
|
||||
$(".preloader-it").fadeIn();
|
||||
var postData = {
|
||||
Password: $("#txt_NewPassword").val(),
|
||||
UserName: instance.UserName,
|
||||
};
|
||||
instance._accountManager.updatePassword(postData).then(function (response) {
|
||||
if (response.errors == null) {
|
||||
$("#div_ResetPswd").addClass('d-none');
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
$("#div_SuccessMsg").removeClass('d-none');
|
||||
MessageHelper.Instance().showSuccess("Password Updated Successfully", 'div_ValidationSummary');
|
||||
}
|
||||
else {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError(response.errors[0], "div_ValidationSummary");
|
||||
}
|
||||
}, function () {
|
||||
$(".preloader-it").delay(200).fadeOut("slow");
|
||||
MessageHelper.Instance().showError("Some Error has occurred!", "div_ValidationSummary");
|
||||
});
|
||||
}
|
||||
static Instance() {
|
||||
return new MobilNewForgotPassword();
|
||||
}
|
||||
}
|
||||
Components.MobilNewForgotPassword = MobilNewForgotPassword;
|
||||
})(Components = Compact.Components || (Compact.Components = {}));
|
||||
})(Compact = Themes.Compact || (Themes.Compact = {}));
|
||||
})(Themes = Unibase.Themes || (Unibase.Themes = {}));
|
||||
})(Unibase || (Unibase = {}));
|
||||
Исполняемый файл
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
поставляемый
Исполняемый файл
+43
@@ -0,0 +1,43 @@
|
||||
var Unibase;(function(n){let t;(function(t){let i;(function(t){let i;(function(t){class i extends n.Platform.Core.BaseComponent{jsFiles(){return["tenants/themes/compact/index.mobil_anonymous.js","platform/membership/managers/accountmanager.js","libs/passwordrequirement/passwordrequirement.js"]}cssFiles(){return["tenants/themes/compact/css/style.ext.css","libs/passwordrequirement/passwordrequirement.css"]}load(t,i,r){$(".pr-password").focus(function(){var n=$(".pr-password");n.passwordRequirements({numCharacters:8,useLowercase:!0,useUppercase:!0,useNumbers:!0,useSpecial:!0})});$("#txt_NewPassword").click(function(){$(this).removeAttr("readonly")});$("#txt_NewPassword").keyup(function(n){if(n.keyCode==8){let n=$(this).val();(n==""||n==null||n==0)&&$("#txt_NewPassword").attr("readonly")}});$("#txt_ConfirmPassword").click(function(){$(this).removeAttr("readonly")});$("#txt_ConfirmPassword").keyup(function(n){if(n.keyCode==8){let n=$(this).val();(n==""||n==null||n==0)&&$("#txt_NewPassword").attr("readonly")}});this._accountManager=n.Platform.Membership.Managers.AccountManager.Instance();jQuery(".preloader-it").delay(500).fadeOut("slow");jQuery("#external-container").delay(500).fadeIn("slow");jQuery("#bizgaze_body").css("background-color","#f4f6f7");$("#div_modalbody").removeAttr("style");$("#passwordHide").click(function(){var n=$("#txt_NewPassword");n.attr("type")=="password"?n.attr("type","text"):n.attr("type","password");$("#passwordHide").toggleClass("fa-eye-slash fa-eye")});$("#confirmPasswordHide").click(function(){var n=$("#txt_ConfirmPassword");n.attr("type")=="password"?n.attr("type","text"):n.attr("type","password");$("#confirmPasswordHide").toggleClass("fa-eye-slash fa-eye")});var u=this;$("#txt_PhoneorMail").keypress(function(n){n.which==13&&document.getElementById("btn_SendCode").click()});$(".txt_Code:last").keypress(function(n){n.which==13&&$("#btn_VerifyCode").click()});$("#txt_NewPassword,#txt_ConfirmPassword").keypress(function(n){n.which==13&&document.getElementById("btn_ResetPswd").click()});$("#btn_SendCode").click(function(){u.validate()});$("#btn_VerifyCode").click(function(){u.verifyOtp()});$("#btn_ResendCode").click(function(){u.sendOtp(u.OtpId)});$("#btn_ResetPswd").click(function(){u.resetPassword()});$(".floating-label-form-group .txt_Code").on("input",function(){const n=this;n.value=n.value.replace(/[^0-9]/g,"")});$(".txt_Code").click(function(){$(".lbl_Otp").empty()});r!=null&&r()}otpInputTabChange(n){const t=$(".txt_Code");t[n-1].value!=""?t[n]&&t[n].focus():t[n-1].value==""&&t[n-2]&&t[n-2].focus()}html(){if(jQuery("#external-form").length===0){var i=new t.Index_Mobil_Anonymous;i.init(null)}let n="";return n+=$(window).width()>1200?`<div class="row h-100"> <div class="col-xl-5"> <div class="banner-img-container h-100"><img src="tenants/themes/compact/imgs/mobil-desktop-view-bg.png" alt="img" class="h-100 w-100"> </div></div> <div class="col-xl-7 desktop-view"><div id="div_ForgotPassword" class="mt-100"><form id="frm_ForgotPassword" data-validate="parsley" data-isdynamic="false" style="" autocomplete="off"><div id="div_ValidationSummary"></div> <div id="div_ForgotPswd" class=""> <h1 class="display-5 mb-10 text-center">Forgot your Password?</h1><p class="mb-30 text-center">Enter your Phone Number to receive OTP.</p> <div class="form-group"><input class="form-control" required autocomplete="off" placeholder="Enter your Phone Number/Email Address" id="txt_PhoneorMail" type="text"></div><button class="btn text-white btn-block mb-20" id="btn_SendCode" type="button" style="background:#001F5D;">Send OTP</button><p class="text-right"><a href="index.html#/login">Back to login</a></p></div> <div id="div_ResetPswd" class="d-none"><h1 class="display-5 mb-30 text-center">Please reset your password</h1><div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off" readonly><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span>
|
||||
<div class="showpwsdreq"></div> </div> <div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="new-password" readonly><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div><button class="btn btn-block mb-20 text-white" id="btn_ResetPswd" type="button" style="background:#001F5D;">Reset Password</button>
|
||||
<p class="text-right"><a href="/Index.html">Back to login</a></p></div> <div id="div_SuccessMsg" class="d-none"><div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div><h1 class="display-4 mb-20 text-center">Password Updated Successfully</h1><p class="text-center"><a href="index.html#/login">Click here to Login</a></p></div> </form></div></div> </div>`:`<div id="div_ForgotPassword"> <form id="frm_ForgotPassword" data-validate="parsley" data-isdynamic="false" style="background: url(tenants/themes/compact/imgs/mobil-background.png) no-repeat;" autocomplete="off"> <div id="div_ValidationSummary" class="position-fixed w-100"></div> <div id="div_ForgotPswd" class=""> <div class="d-flex flex-column justify-content-around p-3 " style="height:100vh"><div class="forgot_pass_header mt-100">
|
||||
<div class=""><h1 class="display-5 mb-10 text-center text-white font-weight-bold">ForgotPassword?</h1><p class="mb-30 text-center text-white font-11">Enter your Phone Number to receive OTP.</p></div> <div class="form-group "><input class="form-control" required autocomplete="off" placeholder="Phone Number/Email Address" id="txt_PhoneorMail" type="text"></div> <p class="text-right"><a href="index.html#/login" class="text-white">Back to login</a></p> </div>
|
||||
<div class="forgot_pass_register"><button class="btn btn-block mb-20 rounded-10 text-white" id="btn_SendCode" type="button" style="background:#001F5D; padding: 10px !important;">Send OTP</button></div> </div></div> <div id="div_ResetPswd" class="d-none"><div class="d-flex flex-column justify-content-around p-3 " style="height:100vh"> <div class="pass_fields mt-70"><h1 class="display-5 mb-30 text-center text-white font-weight-bold">Please reset your password</h1>
|
||||
<div class="form-group"><input class="form-control pr-password" required id="txt_NewPassword" placeholder="New password" type="password" autocomplete="off" readonly><span toggle="#txt_NewPassword" id="passwordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span>
|
||||
<div class="showpwsdreq"></div></div><div class="form-group"><input class="form-control" required id="txt_ConfirmPassword" placeholder="Re-enter new password" type="password" autocomplete="new-password" readonly><span toggle="#txt_ConfirmPassword" id="confirmPasswordHide" class="fa fa-eye-slash font-15 mr-10 field-icon"></span></div> <p class="text-right"><a href="/Index.html" class="text-white">Back to login</a></p> </div>
|
||||
<div class="pass_footer"><button class="btn btn-primary btn-block mb-20 rounded-10" id="btn_ResetPswd" type="button" style="background:#001F5D; padding: 10px !important;">Reset Password</button></div>
|
||||
<div id="div_SuccessMsg" class="d-none">
|
||||
<div class="d-62 bg-white rounded-circle mb-10 d-flex align-items-center justify-content-center mx-auto"><i class="fa fa-check font-50 text-success"></i></div>
|
||||
<h1 class="display-4 mb-20 text-center">Password Updated Successfully</h1>
|
||||
<p class="text-center"><a href="index.html#/login">Click here to Login</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>`,n+`<div id="modal_Otp" class="modal fade hide">
|
||||
<div class="modal-dialog modal-dialog-centered ">
|
||||
<div class="modal-content ">
|
||||
<div class="modal-header border-0 d-block"><button type="button" class="btn btn-link pull-right font-16 text-secondary p-0" data-dismiss="modal" aria-hidden="true">×</button></div>
|
||||
<div class="modal-body text-center" id="div_modalbody">
|
||||
<img src="tenants/themes/compact/imgs/otp-verify-img.png" class="img-fluid h-100p mx-auto my-10">
|
||||
<h4 class="modal-title font-weight-600">Mobile or Email Verification</h4>
|
||||
|
||||
<div class="lbl_Otp"></div>
|
||||
<div class="otpdiv my-10">
|
||||
<div class="floating-label-form-group mb-2 p-0">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(1)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(2)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(3)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(4)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(5)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input class="form-control bg-transparent txt_Code" onkeyup='Unibase.Themes.Compact.Components.MobilForgotPassword.Instance().otpInputTabChange(6)' id="txt_Code" type="text" maxlength="1" autocomplete="off">
|
||||
<input type="hidden" class="form-control optmsg" id="otpMsg">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer py-10" style="display:block"><button type="button" class="btn btn-outline-primary pull-left" id="btn_ResendCode">Resend</button><button type="button" class="btn btn-outline-primary pull-right" id="btn_VerifyCode">Verify</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`}validate(){var n=this,t;if($("#txt_PhoneorMail").val()=="")return MessageHelper.Instance().showError("Email or Phone cannot be Empty!","div_ValidationSummary"),!1;$("#txt_PhoneorMail").val()!=""&&($(".preloader-it").fadeIn(),t=$("#txt_PhoneorMail").val(),n._accountManager.getUser(t,t).then(function(t){t.result!=null?(n.UserName=t.result.userName,$(".lbl_Otp").removeClass("text-danger text-success").text("We have sent OTP on your Mobile Number and Email !").addClass("h6 position-relative py-3"),$("#txt_Code").val(""),$("#div_ValidationSummary").empty(),n.sendOtp(0)):($(".preloader-it").delay(200).fadeOut("slow"),MessageHelper.Instance().showError("Enter valid Email/Phone!","div_ValidationSummary"))},function(){$(".preloader-it").delay(200).fadeOut("slow");MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")}))}sendOtp(n){var t=this,i={FirstName:"",LastName:"",ContactNumber:"",Email:"",TenantName:"",ContactOrEmail:$("#txt_PhoneorMail").val(),IsSignup:!1,IsRegisterUser:!1,IsForgotPswd:!0,UnibaseId:t.UserName,OtpId:n,UserOtp:""};t._accountManager.sendOtp(i).then(function(i){n!=0&&$(".lbl_Otp").text("OTP has been Resent!").removeClass("text-danger","").addClass("text-success","");i==0?($(".preloader-it").delay(200).fadeOut("slow"),MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")):(t.OtpId=i,$("#modal_Otp").modal("show"),$(".preloader-it").delay(200).fadeOut("slow"))},function(){$(".preloader-it").delay(200).fadeOut("slow");MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")})}verifyOtp(){var n="",t,i;$(".floating-label-form-group .txt_Code").each(function(){n+=$(this).val()});parseInt(n);$(".floating-label-form-group").find("#otpMsg").attr("value",n);t=this;$("#otpMsg").val()==""?$(".lbl_Otp").text("Please Enter OTP!").addClass("text-danger",""):(i={FirstName:"",LastName:"",ContactNumber:"",Email:"",TenantName:"",ContactOrEmail:"",IsForgotPswd:!1,IsRegisterUser:!1,IsSignup:!0,UnibaseId:"",OtpId:t.OtpId,UserOtp:$("#otpMsg").val()},t._accountManager.verifyOtp(i).then(function(n){n.code.toString()=="2"?($(".preloader-it").delay(200).fadeOut("slow"),$(".lbl_Otp").text("Otp Expired, Please click on Resend to get new OTP").addClass("text-danger",""),$("#otpMsg").val("")):n.result!=null&&(n.result.contactConfirmed==!1&&n.result.emailConfirmed==!1?($(".preloader-it").delay(200).fadeOut("slow"),$(".lbl_Otp").text("Invalid OTP!").addClass("text-danger",""),$("#otpMsg").val("")):($("#div_ForgotPswd").addClass("d-none"),$("#modal_Otp").modal("hide"),$(".preloader-it").delay(200).fadeOut("slow"),$("#div_ResetPswd").removeClass("d-none")))}))}resetPassword(){var i=this,n,t,r;if($("#div_ValidationSummary").empty(),n=$("#txt_ConfirmPassword").val(),t=$("#txt_NewPassword").val(),t.length==0||n.length==0)return MessageHelper.Instance().showError("Password fields cannot be empty!","div_ValidationSummary"),!1;if(t.length<8||n.length<8)return MessageHelper.Instance().showError("Password must be atleast 8 characters!","div_ValidationSummary"),!1;var u=$("#txt_NewPassword").val(),f=u.match(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\s).{8,15}$/)?!0:!1;if(f==!1)return $(".pr-password").focus(),MessageHelper.Instance().showError("Please Match the Password in requested Format","div_ValidationSummary"),!1;if(t!=n)return MessageHelper.Instance().showError("New and Confirm Passwords doesn't match!","div_ValidationSummary"),!1;$(".preloader-it").fadeIn();r={Password:$("#txt_NewPassword").val(),UserName:i.UserName};i._accountManager.updatePassword(r).then(function(n){n.errors==null?($("#div_ResetPswd").addClass("d-none"),$(".preloader-it").delay(200).fadeOut("slow"),$("#div_SuccessMsg").removeClass("d-none"),MessageHelper.Instance().showSuccess("Password Updated Successfully","div_ValidationSummary")):($(".preloader-it").delay(200).fadeOut("slow"),MessageHelper.Instance().showError(n.errors[0],"div_ValidationSummary"))},function(){$(".preloader-it").delay(200).fadeOut("slow");MessageHelper.Instance().showError("Some Error has occurred!","div_ValidationSummary")})}static Instance(){return new i}}t.MobilNewForgotPassword=i})(i=t.Components||(t.Components={}))})(i=t.Compact||(t.Compact={}))})(t=n.Themes||(n.Themes={}))})(Unibase||(Unibase={}));
|
||||
Ссылка в новой задаче
Block a user