From fc5470f1de4632246e6ef94bd5659d48b76935ab Mon Sep 17 00:00:00 2001 From: "bcoles@gmail.com" Date: Sat, 1 Oct 2011 08:26:37 +0000 Subject: [PATCH] Patched load mask error on login/authentication page git-svn-id: https://beef.googlecode.com/svn/trunk@1334 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- .../media/javascript/ui/authentication.js | 48 +++++++++---------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/extensions/admin_ui/media/javascript/ui/authentication.js b/extensions/admin_ui/media/javascript/ui/authentication.js index 57a7c5b5e..fa37b514b 100644 --- a/extensions/admin_ui/media/javascript/ui/authentication.js +++ b/extensions/admin_ui/media/javascript/ui/authentication.js @@ -14,44 +14,43 @@ // limitations under the License. // Ext.onReady(function() { - + submitAuthForm = function() { + + login_mask.show(); login_form.getForm().submit({ success: function() { window.location.href = '/ui/panel' }, failure: function() { - if(Ext.get('loginError') == null){ - Ext.DomHelper.insertAfter('loadingError', {id:'loginError', html: 'ERROR: invalid username or password'}); - } - login_form.mask.hide(); + if(Ext.get('loginError') == null) { + Ext.DomHelper.insertAfter('loadingError', {id:'loginError', html: 'ERROR: invalid username or password'}); + } + login_mask.hide(); } }); } var login_form = new Ext.form.FormPanel({ - + url: 'authentication/login', formId: 'login_form', labelWidth: 125, - frame: true, - title: 'Authentication', - bodyStyle:'padding:5px 5px 0', - width: 350, - - + frame: true, + title: 'Authentication', + bodyStyle:'padding:5px 5px 0', + width: 350, defaults: { - width: 175, - inputType: 'password' - }, - - defaultType: 'textfield', + width: 175, + inputType: 'password' + }, + defaultType: 'textfield', items: [{ fieldLabel: 'Username', name: 'username-cfrm', - inputType: 'textfield', + inputType: 'textfield', id: 'user', listeners: { specialkey: function(field,e) { @@ -76,17 +75,16 @@ Ext.onReady(function() { buttons: [{ text: 'Login', - id: 'loginButton', - handler: function() { - login_form.mask = new Ext.LoadMask('login_form', {msg:"Authenticating to BeEF..."}); - login_form.mask.show(); + id: 'loginButton', + handler: function() { submitAuthForm(); } }] }); - + + var login_mask = new Ext.LoadMask(Ext.getBody(), {msg:"Authenticating to BeEF..."}); login_form.render('centered'); - Ext.DomHelper.append('login_form', {tag: 'div', id: 'loadingError'}); + Ext.DomHelper.append('login_form', {tag: 'div', id: 'loadingError'}); document.getElementById('user').focus(); - + });