re-login after auth. failed contains wrong account id. - Fixed

cusax-fix
Yana Stamcheva 21 years ago
parent 97754c45f1
commit 2b84ec20de

@ -5,7 +5,7 @@ all=All
alwaysOnTop=Always on top
appearance=Appearance
application=Application
authenticationFailed=Authentication failed
authenticationFailed=Authentication failed. The UIN or password you entered are not valid.
callList=Call list
cancel=Cancel
close=Close

@ -38,6 +38,8 @@ public class LoginManager implements RegistrationStateChangeListener {
private BundleContext bc;
private Hashtable accountManagersMap = new Hashtable();
private Hashtable loginWindows = new Hashtable();
private AccountID accountID;
@ -125,6 +127,8 @@ private void showLoginWindow(MainFrame parent,
accoundManager);
loginWindow.setLoginManager(this);
this.loginWindows.put(protocolName, loginWindow);
loginWindow.showWindow();
}
@ -133,9 +137,12 @@ private class MySecurityAuthority implements SecurityAuthority {
}
public void registrationStateChanged(RegistrationStateChangeEvent evt) {
String protocolName = evt.getProvider().getProtocolName();
if(evt.getNewState().equals(RegistrationState.REGISTERED)){
((LoginWindow)this.loginWindows.get(protocolName)).dispose();
Map supportedOpSets
= evt.getProvider().getSupportedOperationSets();
@ -158,8 +165,8 @@ else if(evt.getNewState()
Messages.getString("authenticationFailed"),
Messages.getString("authenticationFailed"),
JOptionPane.ERROR_MESSAGE);
this.showLoginWindows(this.mainFrame);
((LoginWindow)this.loginWindows.get(protocolName)).showWindow();
}
else if(evt.getNewState()
.equals(RegistrationState.CONNECTION_FAILED)){

@ -38,6 +38,7 @@
import net.java.sip.communicator.impl.gui.main.utils.AntialiasingManager;
import net.java.sip.communicator.impl.gui.main.utils.Constants;
import net.java.sip.communicator.impl.gui.main.utils.ImageLoader;
import net.java.sip.communicator.service.protocol.AccountID;
import net.java.sip.communicator.service.protocol.AccountManager;
public class LoginWindow extends JDialog
@ -73,7 +74,6 @@ public class LoginWindow extends JDialog
public LoginWindow( MainFrame mainFrame,
String protocolName,
AccountManager accountManager){
super(mainFrame);
this.accountManager = accountManager;
@ -102,9 +102,8 @@ public LoginWindow( MainFrame mainFrame,
}
private void init() {
this.uinComboBox = new JComboBox(this.accountManager
.getRegisteredAcounts().toArray());
this.uinComboBox = new JComboBox();
this.passwdField.setEchoChar('*');
this.uinComboBox.setEditable(true);
@ -145,10 +144,10 @@ private void setTransparent(boolean transparent){
}
public void showWindow(){
this.setWindowLocation();
this.setVisible(true);
if(!this.isVisible()){
this.setWindowLocation();
this.setVisible(true);
}
}
private void setWindowLocation(){
@ -176,8 +175,6 @@ public void actionPerformed(ActionEvent e) {
this.loginManager.login(accountManager,
uinComboBox.getSelectedItem().toString(),
new String(passwdField.getPassword()));
this.dispose();
}
else{
this.dispose();

Loading…
Cancel
Save