436 case 'login_failure': |
436 case 'login_failure': |
437 // Rid ourselves of any loading windows |
437 // Rid ourselves of any loading windows |
438 ajaxLoginSetStatus(AJAX_STATUS_DESTROY); |
438 ajaxLoginSetStatus(AJAX_STATUS_DESTROY); |
439 document.getElementById('messageBox').style.backgroundColor = '#C0C0C0'; |
439 document.getElementById('messageBox').style.backgroundColor = '#C0C0C0'; |
440 var mb_parent = document.getElementById('messageBox').parentNode; |
440 var mb_parent = document.getElementById('messageBox').parentNode; |
441 $(mb_parent).effect("shake", {}, 200); |
441 var do_respawn = ( typeof(response.respawn) == 'boolean' && response.respawn == true ) || typeof(response.respawn) != 'boolean'; |
442 setTimeout(function() |
442 if ( do_respawn ) |
443 { |
443 { |
444 document.getElementById('messageBox').style.backgroundColor = '#FFF'; |
444 $(mb_parent).effect("shake", {}, 200); |
445 ajaxLoginBuildForm(response.respawn_info); |
445 setTimeout(function() |
446 ajaxLoginShowFriendlyError(response); |
446 { |
447 }, 2500); |
447 document.getElementById('messageBox').style.backgroundColor = '#FFF'; |
|
448 |
|
449 ajaxLoginBuildForm(response.respawn_info); |
|
450 ajaxLoginShowFriendlyError(response); |
|
451 }, 2500); |
|
452 } |
|
453 else |
|
454 { |
|
455 ajaxLoginShowFriendlyError(response); |
|
456 } |
448 break; |
457 break; |
449 case 'login_success_reset': |
458 case 'login_success_reset': |
450 var conf = confirm($lang.get('user_login_ajax_msg_used_temp_pass')); |
459 var conf = confirm($lang.get('user_login_ajax_msg_used_temp_pass')); |
451 if ( conf ) |
460 if ( conf ) |
452 { |
461 { |
771 { |
780 { |
772 alert('BUG: AES self-test failed'); |
781 alert('BUG: AES self-test failed'); |
773 login_cache.mb_object.destroy(); |
782 login_cache.mb_object.destroy(); |
774 return false; |
783 return false; |
775 } |
784 } |
776 // Early submit hook |
|
777 eval(setHook('login_submit_early')); |
|
778 // Hide the error message and captcha |
785 // Hide the error message and captcha |
779 if ( document.getElementById('ajax_login_error_box') ) |
786 if ( document.getElementById('ajax_login_error_box') ) |
780 { |
787 { |
781 document.getElementById('ajax_login_error_box').parentNode.removeChild(document.getElementById('ajax_login_error_box')); |
788 document.getElementById('ajax_login_error_box').parentNode.removeChild(document.getElementById('ajax_login_error_box')); |
782 } |
789 } |
939 ajaxLoginSetStatus(AJAX_STATUS_ERROR); |
952 ajaxLoginSetStatus(AJAX_STATUS_ERROR); |
940 console.error('Exception caught in login process; backtrace follows'); |
953 console.error('Exception caught in login process; backtrace follows'); |
941 console.debug(e); |
954 console.debug(e); |
942 return false; |
955 return false; |
943 } |
956 } |
|
957 // reset this... |
|
958 window.logindata.early_submit_run = false; |
944 ajaxLoginPerformRequest(json_packet); |
959 ajaxLoginPerformRequest(json_packet); |
945 } |
960 } |
946 |
961 |
947 window.ajaxLoginShowFriendlyError = function(response) |
962 window.ajaxLoginShowFriendlyError = function(response) |
948 { |
963 { |