mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
commit
e18695489f
2 changed files with 17 additions and 1 deletions
|
@ -391,7 +391,7 @@ public class ConnectDialog extends MageDialog {
|
|||
connection.setUsername(this.txtUserName.getText().trim());
|
||||
connection.setPassword(this.txtPassword.getText().trim());
|
||||
connection.setForceDBComparison(this.chkForceUpdateDB.isSelected());
|
||||
connection.setUserIdStr(System.getProperty("user.name"));
|
||||
connection.setUserIdStr(System.getProperty("user.name") + ":" + MagePreferences.getUserNames());
|
||||
MageFrame.getPreferences().put(KEY_CONNECT_FLAG, ((CountryItemEditor) cbFlag.getEditor()).getImageItem());
|
||||
PreferencesDialog.setProxyInformation(connection);
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package mage.client.preference;
|
||||
|
||||
import java.util.prefs.BackingStoreException;
|
||||
import java.util.prefs.Preferences;
|
||||
import mage.client.MageFrame;
|
||||
|
||||
|
@ -48,6 +49,7 @@ public class MagePreferences {
|
|||
|
||||
public static String getUserName(String serverAddress) {
|
||||
String userName = prefs().get(prefixedKey(serverAddress, KEY_USER_NAME), "");
|
||||
|
||||
if (!userName.isEmpty()) {
|
||||
return userName;
|
||||
}
|
||||
|
@ -55,6 +57,20 @@ public class MagePreferences {
|
|||
return prefs().get(KEY_USER_NAME, "");
|
||||
}
|
||||
|
||||
public static String getUserNames() {
|
||||
String userIds = "";
|
||||
try {
|
||||
String[] keys = prefs().keys();
|
||||
for (String key : keys) {
|
||||
if (key.matches(".*userName$")) {
|
||||
userIds += "," + prefs().get(key, null);
|
||||
}
|
||||
}
|
||||
} catch (BackingStoreException ex) {
|
||||
}
|
||||
return userIds;
|
||||
}
|
||||
|
||||
public static void setUserName(String serverAddress, String userName) {
|
||||
prefs().put(prefixedKey(serverAddress, KEY_USER_NAME), userName);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue