//Initialize raas options var raasoption = {}; raasoption.apikey = RaasDetails.api_key; raasoption.appName = RaasDetails.sitename; raasoption.emailVerificationUrl = RaasDetails.emailVerificationUrl; raasoption.forgotPasswordUrl = RaasDetails.forgotPasswordUrl; raasoption.inFormvalidationMessage = true; // Disable Email Verification if ('1' == RaasDetails.disable_email_verify) { raasoption.DisabledEmailVerification = true; } // Optional Email Verification if ('1' == RaasDetails.optional_email_verify) { raasoption.OptionalEmailVerification = true; } // Enable V2recaptcha V2 by default raasoption.V2RecaptchaSiteKey = RaasDetails.v2RecaptchaSiteKey; if ('' == raasoption.V2RecaptchaSiteKey || undefined == raasoption.V2RecaptchaSiteKey) { console.log('The V2recaptcha Site Key is required. Please obtain this key from https://www.google.com/recaptcha and enter the site key in the User Registration settings. Please also update your LoginRadius account with your V2recaptcha account info.') } // recaptcha V1 has been deprecated // To enable V1 comment out below line // recaptcha V1 not compatible with raas popup raasoption.V2Recaptcha = true; //// Enable login on Email Verification if (RaasDetails.enable_email_verify_login == '1') { raasoption.enableLoginOnEmailVerification = true; } // Ask for email for unverified social login if ('1' == RaasDetails.enable_ask_email_for_unverified) { raasoption.askEmailAlwaysForUnverified = true; } // Ask for password for social logins if ('1' == RaasDetails.enable_ask_for_password) { raasoption.promptPasswordOnSocialLogin = true; } // Enable UserName feature if ('1' == RaasDetails.enable_username) { raasoption.enableUserName = true; } // Email Verification Template if ('' != RaasDetails.emailVerificationTemplate) { raasoption.emailVerificationTemplate = RaasDetails.emailVerificationTemplate; } // Forgot Password Template if ('' != RaasDetails.forgotPasswordTemplate) { raasoption.emailVerificationTemplate = RaasDetails.forgotPasswordTemplate; } raasoption.templatename = "loginradiuscustom_raas_tmpl"; raasoption.hashTemplate = true; if ("" != RaasDetails.storageVariable) { sessionStorage.setItem('lr-user-uid', RaasDetails.storageVariable); } LoginRadiusRaaS.CustomInterface(".interfacecontainerdiv", raasoption); jQuery(document).ready(function () { initializeRaasForms(); jQuery(".lrraas_signup").click(function () { ShowformbyId("reg_from"); }); jQuery(".lrraas_forgetpassowrd").click(function () { ShowformbyId("forgot_from"); }); jQuery(".lrraas_signin").click(function () { ShowformbyId("login-container"); }); jQuery(document).on('click', '.lr_fade', function () { jQuery('.lr_fade').hide(); }); jQuery('body').on('click', ".lrsociallogin", function () { handleResponse(true, ""); }); jQuery('body').on('focus', ".loginradius-raas-birthdate", function () { var maxYear = new Date().getFullYear(); var minYear = maxYear - 100; jQuery('.loginradius-raas-birthdate').datepicker({ dateFormat: 'mm-dd-yy', maxDate: new Date(), minDate: "-100y", changeMonth: true, changeYear: true, yearRange: (minYear + ":" + maxYear) }); jQuery('.loginradius-raas-birthdate').datepicker(jQuery.datepicker.regional[ "es" ]); }); }); function ShowformbyId(currentform) { jQuery("#" + currentform).show(); } function HideAllForms() { jQuery('#registration-container,#resetpassword-container,#login-container,#reontainer,#forgotpassword-container,#changepasswordbox,#setpasswordbox').hide(); } function redirect(token) { if (0 == jQuery('.lr_fade').length) { jQuery('body').append(RaasDetails.spinner); } jQuery('.lr_fade').show(); handleResponse(true, ''); var form = document.createElement('form'); form.action = window.location.href; form.method = 'POST'; var hiddenToken = document.createElement('input'); hiddenToken.type = 'hidden'; hiddenToken.value = token; hiddenToken.name = 'token'; form.appendChild(hiddenToken); document.body.appendChild(form); form.submit(); } function handleResponse(isSuccess, message) { if (message != null && message != "") { jQuery('.lr_fade').hide(); var msg_color = 'success'; if (false == isSuccess) { msg_color = 'error'; } jQuery('.messageinfo').html('