fix ugly login error message

This commit is contained in:
Sebastian Sdorra
2012-06-14 21:42:49 +02:00
parent d9cedfd8b1
commit ebd0bdd92e

View File

@@ -38,6 +38,7 @@ Sonia.login.Form = Ext.extend(Ext.FormPanel,{
waitTitleText: 'Connecting',
WaitMsgText: 'Sending data...',
failedMsgText: 'Login failed!',
failedDescriptionText: 'Incorrect username, password or not enough permission. Please Try again.',
initComponent: function(){
@@ -88,7 +89,7 @@ Sonia.login.Form = Ext.extend(Ext.FormPanel,{
}]
};
this.addEvents('cancel');
this.addEvents('cancel', 'failure');
Ext.apply(this, Ext.apply(this.initialConfig, config));
Sonia.login.Form.superclass.initComponent.apply(this, arguments);
@@ -118,7 +119,13 @@ Sonia.login.Form = Ext.extend(Ext.FormPanel,{
if ( debug ){
console.debug( 'login failed' );
}
Ext.Msg.alert(this.failedMsgText);
this.fireEvent('failure');
Ext.Msg.show({
title: this.failedMsgText,
msg: this.failedDescriptionText,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.WARNING
});
form.reset();
}
});