mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
connection: disabled outdated proxy settings (#13323)
This commit is contained in:
parent
19269b22b0
commit
62ba9f02ba
5 changed files with 40 additions and 19 deletions
|
|
@ -365,12 +365,17 @@ public class ConnectDialog extends JDialog {
|
|||
connection.setPort(Integer.parseInt(this.txtPort.getText()));
|
||||
connection.setAdminPassword(new String(txtPassword.getPassword()));
|
||||
connection.setUsername(SessionImpl.ADMIN_NAME);
|
||||
connection.setProxyType((ProxyType) this.cbProxyType.getSelectedItem());
|
||||
if (!this.cbProxyType.getSelectedItem().equals(ProxyType.NONE)) {
|
||||
connection.setProxyHost(this.txtProxyServer.getText());
|
||||
connection.setProxyPort(Integer.parseInt(this.txtProxyPort.getText()));
|
||||
connection.setProxyUsername(this.txtProxyUserName.getText());
|
||||
connection.setProxyPassword(new String(this.txtPasswordField.getPassword()));
|
||||
|
||||
if (false) { // TODO: delete proxy at all after few releases, 2025-02-09
|
||||
connection.setProxyType((ProxyType) this.cbProxyType.getSelectedItem());
|
||||
if (!this.cbProxyType.getSelectedItem().equals(ProxyType.NONE)) {
|
||||
connection.setProxyHost(this.txtProxyServer.getText());
|
||||
connection.setProxyPort(Integer.parseInt(this.txtProxyPort.getText()));
|
||||
connection.setProxyUsername(this.txtProxyUserName.getText());
|
||||
connection.setProxyPassword(new String(this.txtPasswordField.getPassword()));
|
||||
}
|
||||
} else {
|
||||
connection.setProxyType(ProxyType.NONE);
|
||||
}
|
||||
|
||||
logger.debug("connecting: " + connection.getProxyType() + ' ' + connection.getProxyHost() + ' ' + connection.getProxyPort());
|
||||
|
|
|
|||
|
|
@ -101,13 +101,18 @@ public class ConsoleFrame extends javax.swing.JFrame implements MageClient {
|
|||
newConnection.setPort(ConsoleFrame.getPreferences().getInt("serverPort", 17171));
|
||||
newConnection.setUsername(SessionImpl.ADMIN_NAME);
|
||||
newConnection.setAdminPassword(ConsoleFrame.getPreferences().get("password", ""));
|
||||
newConnection.setProxyType(Connection.ProxyType.valueOf(ConsoleFrame.getPreferences().get("proxyType", "NONE").toUpperCase(Locale.ENGLISH)));
|
||||
if (!newConnection.getProxyType().equals(Connection.ProxyType.NONE)) {
|
||||
newConnection.setProxyHost(ConsoleFrame.getPreferences().get("proxyAddress", ""));
|
||||
newConnection.setProxyPort(ConsoleFrame.getPreferences().getInt("proxyPort", 0));
|
||||
newConnection.setProxyUsername(ConsoleFrame.getPreferences().get("proxyUsername", ""));
|
||||
newConnection.setProxyPassword(ConsoleFrame.getPreferences().get("proxyPassword", ""));
|
||||
if (false) { // TODO: delete proxy at all after few releases, 2025-02-09
|
||||
newConnection.setProxyType(Connection.ProxyType.valueOf(ConsoleFrame.getPreferences().get("proxyType", "NONE").toUpperCase(Locale.ENGLISH)));
|
||||
if (!newConnection.getProxyType().equals(Connection.ProxyType.NONE)) {
|
||||
newConnection.setProxyHost(ConsoleFrame.getPreferences().get("proxyAddress", ""));
|
||||
newConnection.setProxyPort(ConsoleFrame.getPreferences().getInt("proxyPort", 0));
|
||||
newConnection.setProxyUsername(ConsoleFrame.getPreferences().get("proxyUsername", ""));
|
||||
newConnection.setProxyPassword(ConsoleFrame.getPreferences().get("proxyPassword", ""));
|
||||
}
|
||||
} else {
|
||||
newConnection.setProxyType(Connection.ProxyType.NONE);
|
||||
}
|
||||
|
||||
status = connect(newConnection);
|
||||
}
|
||||
return status;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue