When a username/password auth fails, restore the username/password dialog instead...
[citadel.git] / webcit / static / authmethods.js
index ef800dd4ea668604975fcbea93f8e8878a128054..a80543fdbbbedcff21bee5c02313ef7e80c8ad6a 100644 (file)
@@ -61,6 +61,7 @@ function authtoggle(show_which_div) {
        $('authbox_google').style.display = 'none';
        $('authbox_yahoo').style.display = 'none';
        $('authbox_aol').style.display = 'none';
+       $('authbox_success').style.display = 'none';
        $(show_which_div).style.display = 'block';
 }
 
@@ -84,6 +85,7 @@ function do_auth_popout(popout_url) {
 function ajax_try_username_and_password() {
 
        $('login_errmsg').innerHTML = "";
+       authtoggle('authbox_success');
         $('ajax_username_password_form').request({
                onSuccess: function(ctdlresult) {
                        if (ctdlresult.responseText.substr(0,1) == '2') {
@@ -91,6 +93,7 @@ function ajax_try_username_and_password() {
                        }
                        else {
                                $('login_errmsg').innerHTML = ctdlresult.responseText.substr(4) ;
+                               authtoggle('authbox_userpass');
                        }
                }
        });
@@ -125,6 +128,7 @@ function ajax_try_newuser() {
         $('ajax_newuser_form').request({
                onSuccess: function(ctdlresult) {
                        if (ctdlresult.responseText.substr(0,1) == '2') {
+                               authtoggle('authbox_success');
                                window.location = 'pop';
                        }
                        else {