1 /* login singup and forget password action */ 2 3 jQuery(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': jQuery('form#login #lpusername').val(), 41 'password': jQuery('form#login #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 63 jQuery(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 122 jQuery(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 timer = setTimeout(flipItNow, 5000); 158 } 159 } 160 }); 161 }else{ 162 163 grecaptcha.ready(function() { 164 grecaptcha.execute(siteKey, {action: 'lp_register'}).then(function(token) { 165 166 jQuery.ajax({ 167 type: 'POST', 168 dataType: 'json', 169 url: ajax_login_object.ajaxurl, 170 data: { 171 'action': 'ajax_register', //calls wp_ajax_nopriv_ajaxregister 172 'username': jQuery('form#register #username2').val(), 173 'email': jQuery('form#register #email').val(), 174 'upassword': jQuery('form#register #upassword').val(), 175 'security': jQuery('form#register #security2').val(), 176 'token': token, 177 'recaptha-action': 'lp_register', 178 }, 179 180 success: function(data){ 181 182 jQuery('form#register p.status').html(data.message); 183 var timer = ''; 184 function flipItNow(){ 185 jQuery('.forgetpasswordcontainer').fadeOut(); 186 jQuery('.siginupcontainer').fadeOut(); 187 jQuery('.siginincontainer').fadeIn(); 188 clearTimeout(timer); 189 } 190 if (data.password){ 191 document.location.href = ajax_login_object.redirecturl; 192 }else{ 193 timer = setTimeout(flipItNow, 5000); 194 } 195 196 } 197 }); 198 199 200 }); 201 }) 202 203 204 } 205 e.preventDefault(); 206 }); 207 208 jQuery(document).on('submit','form#registertmp', function(e){ 209 jQuery('form#registertmp p.status').show().html(ajax_login_object.loadingmessage); 210 211 isCaptcha = jQuery(this).data('lp-recaptcha'); 212 siteKey = jQuery(this).data('lp-recaptcha-sitekey'); 213 token = ''; 214 if ( (isCaptcha == '' || isCaptcha === null) || (siteKey == '' || siteKey === null) ) { 215 216 jQuery.ajax({ 217 type: 'POST', 218 dataType: 'json', 219 url: ajax_login_object.ajaxurl, 220 data: { 221 'action': 'ajax_register', //calls wp_ajax_nopriv_ajaxregister 222 'username': jQuery('form#registertmp #username2T').val(), 223 'email': jQuery('form#registertmp #emailT').val(), 224 'upassword': jQuery('form#registertmp #upasswordT').val(), 225 'security': jQuery('form#registertmp #lpsecurityregT').val(), 226 227 }, 228 229 success: function(data){ 230 if (jQuery("form#registertmp .g-recaptcha-response").length){ 231 lp_reset_grecaptcha(); 232 } 233 jQuery('form#registertmp p.status').html(data.message); 234 var timer = ''; 235 function flipItNow(){ 236 jQuery('.forgetpasswordcontainer').fadeOut(); 237 jQuery('.siginupcontainer').fadeOut(); 238 jQuery('.siginincontainer').fadeIn(); 239 clearTimeout(timer); 240 } 241 timer = setTimeout(flipItNow, 5000); 242 243 } 244 }); 245 }else{ 246 grecaptcha.ready(function() { 247 grecaptcha.execute(siteKey, {action: 'lp_register'}).then(function(token) { 248 249 jQuery.ajax({ 250 type: 'POST', 251 dataType: 'json', 252 url: ajax_login_object.ajaxurl, 253 data: { 254 'action': 'ajax_register', //calls wp_ajax_nopriv_ajaxregister 255 'username': jQuery('form#registertmp #username2T').val(), 256 'email': jQuery('form#registertmp #emailT').val(), 257 'upassword': jQuery('form#registertmp #upasswordT').val(), 258 'security': jQuery('form#registertmp #lpsecurityregT').val(), 259 'token': token, 260 'recaptha-action': 'lp_register', 261 262 }, 263 264 success: function(data){ 265 if (jQuery("form#registertmp .g-recaptcha-response").length){ 266 lp_reset_grecaptcha(); 267 } 268 jQuery('form#registertmp p.status').html(data.message); 269 var timer = ''; 270 function flipItNow(){ 271 jQuery('.forgetpasswordcontainer').fadeOut(); 272 jQuery('.siginupcontainer').fadeOut(); 273 jQuery('.siginincontainer').fadeIn(); 274 clearTimeout(timer); 275 } 276 timer = setTimeout(flipItNow, 5000); 277 278 } 279 }); 280 281 }); 282 }) 283 } 284 e.preventDefault(); 285 }); 286 287 288 // Perform AJAX forget password 289 jQuery(document).on('submit','form#lp_forget_pass_form', function(e){ 290 jQuery('form#lp_forget_pass_form p.status').show().html(ajax_login_object.loadingmessage); 291 jQuery.ajax({ 292 type: 'POST', 293 dataType: 'json', 294 url: ajax_login_object.ajaxurl, 295 data: { 296 'action': 'ajax_forget_pass', //calls wp_ajax_nopriv_ajaxregister 297 'email': jQuery('form#lp_forget_pass_form #email3').val(), 298 'security': jQuery('form#lp_forget_pass_form #security3').val() }, 299 300 success: function(data){ 301 //grecaptcha.reset(); 302 jQuery('form#lp_forget_pass_form p.status').html(data.message); 303 } 304 }); 305 e.preventDefault(); 306 }); 307 308 // Perform AJAX forget password 309 310 jQuery(document).on('submit','form#lp_forget_pass_formm', function(e){ 311 312 jQuery('form#lp_forget_pass_formm p.status').show().html(ajax_login_object.loadingmessage); 313 314 jQuery.ajax({ 315 316 type: 'POST', 317 318 dataType: 'json', 319 320 url: ajax_login_object.ajaxurl, 321 322 data: { 323 324 'action': 'ajax_forget_pass', //calls wp_ajax_nopriv_ajaxregister 325 326 'email': jQuery('form#lp_forget_pass_formm #email2').val(), 327 328 'security': jQuery('form#lp_forget_pass_formm #security4').val() }, 329 330 success: function(data){ 331 332 //grecaptcha.reset(); 333 334 jQuery('form#lp_forget_pass_formm p.status').html(data.message); 335 336 } 337 338 }); 339 340 e.preventDefault(); 341 342 }); 343 344// logins ends 345
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.