1/* login singup and forget password action */ 2 3jQuery(document).on('submit','form#login', function(e){ 4 e.preventDefault(); 5 6 var $this = jQuery(this); 7 8 $this.find('p.status').show().html(ajax_login_object.loadingmessage); 9 isCaptcha = jQuery(this).data('lp-recaptcha'); 10 siteKey = jQuery(this).data('lp-recaptcha-sitekey'); 11 token = ''; 12 if ( (isCaptcha == '' || isCaptcha === null) || (siteKey == '' || siteKey === null) ) { 13 jQuery.ajax({ 14 type: 'POST', 15 dataType: 'json', 16 url: ajax_login_object.ajaxurl, 17 data: { 18 'action': 'ajaxlogin', //calls wp_ajax_nopriv_ajaxlogin 19 'username': $this.find('#lpusername').val(), 20 'password': $this.find('#lppassword').val(), 21 'security': $this.find('#security').val(), 22 }, 23 success: function(data){ 24 25 $this.find('p.status').html(data.message); 26 if (data.loggedin == true){ 27 document.location.href = ajax_login_object.redirecturl; 28 } 29 } 30 }); 31 }else{ 32 grecaptcha.ready(function() { 33 grecaptcha.execute(siteKey, {action: 'lp_login'}).then(function(token) { 34 jQuery.ajax({ 35 type: 'POST', 36 dataType: 'json', 37 url: ajax_login_object.ajaxurl, 38 data: { 39 'action': 'ajaxlogin', //calls wp_ajax_nopriv_ajaxlogin 40 'username': $this.find('#lpusername').val(), 41 'password': $this.find('#lppassword').val(), 42 'security': jQuery('form#login #security').val(), 43 'token': token, 44 'recaptha-action': 'lp_login', 45 }, 46 success: function(data){ 47 48 jQuery('form#login p.status').html(data.message); 49 if (data.loggedin == true){ 50 document.location.href = ajax_login_object.redirecturl; 51 } 52 } 53 }); 54 }) 55 }); 56 } 57 58 59 60}); 61 62// Perform AJAX login on from listing login template 63jQuery(document).on('submit','form#lp-login-temp', function(e){ 64 e.preventDefault(); 65 jQuery('form#lp-login-temp p.status').show().html(ajax_login_object.loadingmessage); 66 67 isCaptcha = jQuery(this).data('lp-recaptcha'); 68 siteKey = jQuery(this).data('lp-recaptcha-sitekey'); 69 token = ''; 70 if ( (isCaptcha == '' || isCaptcha === null) || (siteKey == '' || siteKey === null) ) { 71 72 jQuery.ajax({ 73 type: 'POST', 74 dataType: 'json', 75 url: ajax_login_object.ajaxurl, 76 data: { 77 'action': 'ajaxlogin', //calls wp_ajax_nopriv_ajaxlogin 78 'username': jQuery('form#lp-login-temp #lpusernameT').val(), 79 'password': jQuery('form#lp-login-temp #lppasswordT').val(), 80 'security': jQuery('form#lp-login-temp #lpsecurityT').val(), 81 }, 82 success: function(data){ 83 84 85 jQuery('form#lp-login-temp p.status').html(data.message); 86 if (data.loggedin == true){ 87 document.location.href = ajax_login_object.redirecturl; 88 } 89 } 90 }); 91 }else{ 92 93 grecaptcha.ready(function() { 94 grecaptcha.execute(siteKey, {action: 'lp_login'}).then(function(token) { 95 jQuery.ajax({ 96 type: 'POST', 97 dataType: 'json', 98 url: ajax_login_object.ajaxurl, 99 data: { 100 'action': 'ajaxlogin', //calls wp_ajax_nopriv_ajaxlogin 101 'username': jQuery('form#lp-login-temp #lpusernameT').val(), 102 'password': jQuery('form#lp-login-temp #lppasswordT').val(), 103 'security': jQuery('form#lp-login-temp #lpsecurityT').val(), 104 'token': token, 105 'recaptha-action': 'lp_login', 106 }, 107 success: function(data){ 108 109 jQuery('form#lp-login-temp p.status').html(data.message); 110 if (data.loggedin == true){ 111 document.location.href = ajax_login_object.redirecturl; 112 } 113 } 114 }); 115 }); 116 }); 117 } 118 119}); 120 121// Perform AJAX login on form submit 122jQuery(document).on('submit', 'form#register' , function(e){ 123 var $this = jQuery(this); 124 125 jQuery('form#register p.status').show().html(ajax_login_object.loadingmessage); 126 isCaptcha = jQuery(this).data('lp-recaptcha'); 127 siteKey = jQuery(this).data('lp-recaptcha-sitekey'); 128 token = ''; 129 130 if ( (isCaptcha == '' || isCaptcha === null) || (siteKey == '' || siteKey === null) ) { 131 132 jQuery.ajax({ 133 type: 'POST', 134 dataType: 'json', 135 url: ajax_login_object.ajaxurl, 136 data: { 137 'action': 'ajax_register', //calls wp_ajax_nopriv_ajaxregister 138 'username': $this.find('#username2').val(), 139 'email': $this.find('#email').val(), 140 'upassword': $this.find('#upassword').val(), 141 'security': $this.find('#security2').val(), 142 }, 143 144 success: function(data){ 145 146 $this.find('p.status').html(data.message); 147 var timer = ''; 148 function flipItNow(){ 149 jQuery('.forgetpasswordcontainer').fadeOut(); 150 jQuery('.siginupcontainer').fadeOut(); 151 jQuery('.siginincontainer').fadeIn(); 152 clearTimeout(timer); 153 } 154 if (data.password){ 155 document.location.href = ajax_login_object.redirecturl; 156 }else{ 157 if (data.register){ 158 timer = setTimeout(flipItNow, 5000); 159 } 160 } 161 } 162 }); 163 }else{ 164 165 grecaptcha.ready(function() { 166 grecaptcha.execute(siteKey, {action: 'lp_register'}).then(function(token) { 167 168 jQuery.ajax({ 169 type: 'POST', 170 dataType: 'json', 171 url: ajax_login_object.ajaxurl, 172 data: { 173 'action': 'ajax_register', //calls wp_ajax_nopriv_ajaxregister 174 'username': $this.find('#username2').val(), 175 'email': $this.find('#email').val(), 176 'upassword': $this.find('#upassword').val(), 177 'security': $this.find('#security2').val(), 178 'token': token, 179 'recaptha-action': 'lp_register', 180 }, 181 182 success: function(data){ 183 184 jQuery('form#register p.status').html(data.message); 185 var timer = ''; 186 function flipItNow(){ 187 jQuery('.forgetpasswordcontainer').fadeOut(); 188 jQuery('.siginupcontainer').fadeOut(); 189 jQuery('.siginincontainer').fadeIn(); 190 clearTimeout(timer); 191 } 192 if (data.password){ 193 document.location.href = ajax_login_object.redirecturl; 194 }else{ 195 if (data.register){ 196 timer = setTimeout(flipItNow, 5000); 197 } 198 } 199 200 } 201 }); 202 203 204 }); 205 }) 206 207 208 } 209 e.preventDefault(); 210}); 211 212jQuery(document).on('submit','form#registertmp', function(e){ 213 jQuery('form#registertmp p.status').show().html(ajax_login_object.loadingmessage); 214 215 isCaptcha = jQuery(this).data('lp-recaptcha'); 216 siteKey = jQuery(this).data('lp-recaptcha-sitekey'); 217 token = ''; 218 if ( (isCaptcha == '' || isCaptcha === null) || (siteKey == '' || siteKey === null) ) { 219 220 jQuery.ajax({ 221 type: 'POST', 222 dataType: 'json', 223 url: ajax_login_object.ajaxurl, 224 data: { 225 'action': 'ajax_register', //calls wp_ajax_nopriv_ajaxregister 226 'username': jQuery('form#registertmp #username2T').val(), 227 'email': jQuery('form#registertmp #emailT').val(), 228 'upassword': jQuery('form#registertmp #upasswordT').val(), 229 'security': jQuery('form#registertmp #lpsecurityregT').val(), 230 231 }, 232 233 success: function(data){ 234 if (jQuery("form#registertmp .g-recaptcha-response").length){ 235 lp_reset_grecaptcha(); 236 } 237 jQuery('form#registertmp p.status').html(data.message); 238 var timer = ''; 239 function flipItNow(){ 240 jQuery('.forgetpasswordcontainer').fadeOut(); 241 jQuery('.siginupcontainer').fadeOut(); 242 jQuery('.siginincontainer').fadeIn(); 243 clearTimeout(timer); 244 } 245 if (data.register){ 246 timer = setTimeout(flipItNow, 5000); 247 } 248 249 } 250 }); 251 }else{ 252 grecaptcha.ready(function() { 253 grecaptcha.execute(siteKey, {action: 'lp_register'}).then(function(token) { 254 255 jQuery.ajax({ 256 type: 'POST', 257 dataType: 'json', 258 url: ajax_login_object.ajaxurl, 259 data: { 260 'action': 'ajax_register', //calls wp_ajax_nopriv_ajaxregister 261 'username': jQuery('form#registertmp #username2T').val(), 262 'email': jQuery('form#registertmp #emailT').val(), 263 'upassword': jQuery('form#registertmp #upasswordT').val(), 264 'security': jQuery('form#registertmp #lpsecurityregT').val(), 265 'token': token, 266 'recaptha-action': 'lp_register', 267 268 }, 269 270 success: function(data){ 271 if (jQuery("form#registertmp .g-recaptcha-response").length){ 272 lp_reset_grecaptcha(); 273 } 274 jQuery('form#registertmp p.status').html(data.message); 275 var timer = ''; 276 function flipItNow(){ 277 jQuery('.forgetpasswordcontainer').fadeOut(); 278 jQuery('.siginupcontainer').fadeOut(); 279 jQuery('.siginincontainer').fadeIn(); 280 clearTimeout(timer); 281 } 282 if (data.register){ 283 timer = setTimeout(flipItNow, 5000); 284 } 285 286 } 287 }); 288 289 }); 290 }) 291 } 292 e.preventDefault(); 293}); 294 295 296// Perform AJAX forget password 297jQuery(document).on('submit','form#lp_forget_pass_form', function(e){ 298 jQuery('form#lp_forget_pass_form p.status').show().html(ajax_login_object.loadingmessage); 299 jQuery.ajax({ 300 type: 'POST', 301 dataType: 'json', 302 url: ajax_login_object.ajaxurl, 303 data: { 304 'action': 'ajax_forget_pass', //calls wp_ajax_nopriv_ajaxregister 305 'email': jQuery('form#lp_forget_pass_form #email3').val(), 306 'security': jQuery('form#lp_forget_pass_form #security3').val() }, 307 308 success: function(data){ 309 //grecaptcha.reset(); 310 jQuery('form#lp_forget_pass_form p.status').html(data.message); 311 } 312 }); 313 e.preventDefault(); 314}); 315 316// Perform AJAX forget password 317 318jQuery(document).on('submit','form#lp_forget_pass_formm', function(e){ 319 320 jQuery('form#lp_forget_pass_formm p.status').show().html(ajax_login_object.loadingmessage); 321 322 jQuery.ajax({ 323 324 type: 'POST', 325 326 dataType: 'json', 327 328 url: ajax_login_object.ajaxurl, 329 330 data: { 331 332 'action': 'ajax_forget_pass', //calls wp_ajax_nopriv_ajaxregister 333 334 'email': jQuery('form#lp_forget_pass_formm #email2').val(), 335 336 'security': jQuery('form#lp_forget_pass_formm #security4').val() }, 337 338 success: function(data){ 339 340 //grecaptcha.reset(); 341 342 jQuery('form#lp_forget_pass_formm p.status').html(data.message); 343 344 } 345 346 }); 347 348 e.preventDefault(); 349 350}); 351 352// logins ends
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.