Patched load mask error on login/authentication page
git-svn-id: https://beef.googlecode.com/svn/trunk@1334 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -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: '<b>ERROR</b>: invalid username or password'});
|
||||
}
|
||||
login_form.mask.hide();
|
||||
if(Ext.get('loginError') == null) {
|
||||
Ext.DomHelper.insertAfter('loadingError', {id:'loginError', html: '<b>ERROR</b>: 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();
|
||||
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user