}
public boolean doLogin(GraphicManager graphicManager) {
if (Environment.getStandAlone()){
// graphicManager.getFrame().setVisible(true);
Environment.setUser(new DefaultUser());
return true;
}
credentials.put("serverUrl",serverUrl);
getCredentials();
Environment.setNewLook(true);
int badLoginCount = 0;
while (true) { // until a good login or exit because of too many bad
// graphicManager.getFrame().setVisible(true);
if (login==null||password==null || badLoginCount > 0){
URL loginUrl=null;
if (login==null||password==null){
try {
loginUrl=new URL(serverUrl+"/login");
} catch (MalformedURLException e) {}
}
LoginForm form = LoginDialog.doLogin(graphicManager.getFrame(),loginUrl); // it's actually a singleton
if (form.isCancelled())
System.exit(-1);
if (form.isUseMenus())
Environment.setNewLook(false);
login=form.getLogin();
password=form.getPassword();
}
if ("_SA".equals(login)||Environment.getStandAlone()) {// for testing purposes!
Environment.setStandAlone(true);
Environment.setUser(new DefaultUser());
break;
} else {
credentials.put("login",login);
credentials.put("password",password);