User tmpUser = this.getFromUserListByName(name); if (tmpUser == null) { Debug.println("login User" + name +" failed"); return null;
if (name != null && password != null) { User tmpUser = this.getFromUserListByName(name); if (tmpUser == null) { Debug.println("login User" + name + " failed"); return null; } else { if (tmpUser.getPassword().compareTo(password) == 0 && (!tmpUser.isLoggedIn())) { if (!tmpUser.isAdmin() && numCurrentUsers >= maxUsers) { return null; } else { tmpUser.setIsLoggedIn(true); return tmpUser; } } else { return null; } }
    public synchronized User loginUser(String name, String password) {        User tmpUser = this.getFromUserListByName(name);        if (tmpUser == null) {            Debug.println("login User" + name +" failed");            return null;        }        else {            if (tmpUser.getPassword().compareTo(password) == 0 && (!tmpUser.isLoggedIn())) {            	if(!tmpUser.isAdmin() && numCurrentUsers>=maxUsers) {            		return null;              	}            	else {            		tmpUser.setIsLoggedIn(true);            		return tmpUser;           		}            }            else { return null; }        }    }