mirror of
https://github.com/levinsv/pgadmin3.git
synced 2026-05-15 14:15:49 -06:00
Add extend options in connstr.
Для сервера можно добавить дополнительные параметры подключения. В настройка сервера на закладке "Дополнительно" в поле "Connect str"
This commit is contained in:
parent
e23903504e
commit
0093e3676c
12 changed files with 80 additions and 30 deletions
|
|
@ -50,7 +50,7 @@ static void pgNoticeProcessor(void *arg, const char *message)
|
|||
}
|
||||
|
||||
pgConn::pgConn(const wxString &server, const wxString &service, const wxString &hostaddr, const wxString &database, const wxString &username, const wxString &password,
|
||||
int port, const wxString &rolename, int sslmode, OID oid, const wxString &applicationname,
|
||||
int port, const wxString &rolename, const wxString& addconnstr, int sslmode, OID oid, const wxString &applicationname,
|
||||
const wxString &sslcert, const wxString &sslkey, const wxString &sslrootcert, const wxString &sslcrl,
|
||||
const bool sslcompression) : m_cancelConn(NULL)
|
||||
{
|
||||
|
|
@ -64,6 +64,7 @@ pgConn::pgConn(const wxString &server, const wxString &service, const wxString &
|
|||
save_password = password;
|
||||
save_port = port;
|
||||
save_rolename = rolename;
|
||||
save_addconnstr = addconnstr;
|
||||
save_sslmode = sslmode;
|
||||
save_oid = oid;
|
||||
save_applicationname = applicationname;
|
||||
|
|
@ -122,7 +123,12 @@ pgConn::pgConn(const wxString &server, const wxString &service, const wxString &
|
|||
connstr.Append(wxT(" port="));
|
||||
connstr.Append(NumToStr((long)port));
|
||||
}
|
||||
|
||||
if (!addconnstr.IsEmpty())
|
||||
{
|
||||
connstr.Append(wxT(" "));
|
||||
connstr.Append(addconnstr);
|
||||
}
|
||||
|
||||
if (libpqVersion > 7.3)
|
||||
{
|
||||
switch (sslmode)
|
||||
|
|
@ -362,7 +368,7 @@ pgConn *pgConn::Duplicate(const wxString &_appName)
|
|||
{
|
||||
pgConn *res = new pgConn(wxString(save_server), wxString(save_service),
|
||||
wxString(save_hostaddr), wxString(save_database), wxString(save_username),
|
||||
wxString(save_password), save_port, save_rolename, save_sslmode, save_oid,
|
||||
wxString(save_password), save_port, save_rolename, save_addconnstr, save_sslmode, save_oid,
|
||||
_appName.IsEmpty() ? save_applicationname : _appName, save_sslcert, save_sslkey,
|
||||
save_sslrootcert, save_sslcrl, save_sslcompression);
|
||||
|
||||
|
|
|
|||
|
|
@ -269,14 +269,17 @@ pgConn *dlgSelectConnection::CreateConn(wxString &applicationname, bool &created
|
|||
|
||||
|
||||
int sslmode = remoteServer ? remoteServer->GetSSL() : 0;
|
||||
|
||||
return CreateConn(serv, db, user, port, role, sslmode, applicationname, true);
|
||||
wxString addconnstr;
|
||||
if (remoteServer) {
|
||||
addconnstr = remoteServer->GetConnStr();
|
||||
}
|
||||
return CreateConn(serv, db, user, port, role, addconnstr, sslmode, applicationname, true);
|
||||
}
|
||||
|
||||
pgConn *dlgSelectConnection::CreateConn(wxString &server, wxString &dbname, wxString &username, int port, wxString &rolename, int sslmode, wxString &applicationname, bool writeMRU)
|
||||
pgConn *dlgSelectConnection::CreateConn(wxString &server, wxString &dbname, wxString &username, int port, wxString &rolename, wxString &addconnstr, int sslmode, wxString &applicationname, bool writeMRU)
|
||||
{
|
||||
pgConn *newconn;
|
||||
newconn = new pgConn(server, wxEmptyString, wxEmptyString, dbname, username, wxT(""), port, rolename, sslmode, 0, applicationname);
|
||||
newconn = new pgConn(server, wxEmptyString, wxEmptyString, dbname, username, wxT(""), port, rolename, addconnstr, sslmode, 0, applicationname);
|
||||
if (newconn->GetStatus() != PGCONN_OK &&
|
||||
newconn->GetLastError().Cmp(wxString(PQnoPasswordSupplied, wxConvUTF8)) == 0)
|
||||
{
|
||||
|
|
@ -290,7 +293,7 @@ pgConn *dlgSelectConnection::CreateConn(wxString &server, wxString &dbname, wxSt
|
|||
if (dlg.Go() != wxID_OK)
|
||||
return NULL;
|
||||
|
||||
newconn = new pgConn(server, wxEmptyString, wxEmptyString, dbname, username, dlg.GetPassword(), port, rolename, sslmode, 0, applicationname);
|
||||
newconn = new pgConn(server, wxEmptyString, wxEmptyString, dbname, username, dlg.GetPassword(), port, rolename, addconnstr, sslmode, 0, applicationname);
|
||||
}
|
||||
|
||||
if (newconn)
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#define stStorePwd CTRL_STATIC("stStorePwd")
|
||||
#define chkStorePwd CTRL_CHECKBOX("chkStorePwd")
|
||||
#define txtRolename CTRL_TEXT("txtRolename")
|
||||
#define txtConnStr CTRL_TEXT("txtConnStr")
|
||||
#define stRestore CTRL_STATIC("stRestore")
|
||||
#define chkRestore CTRL_CHECKBOX("chkRestore")
|
||||
#define stPassword CTRL_STATIC("stPassword")
|
||||
|
|
@ -80,6 +81,7 @@ BEGIN_EVENT_TABLE(dlgServer, dlgProperty)
|
|||
EVT_TEXT(XRCID("txtPort") , dlgProperty::OnChange)
|
||||
EVT_TEXT(XRCID("txtUsername"), dlgProperty::OnChange)
|
||||
EVT_TEXT(XRCID("txtRolename"), dlgProperty::OnChange)
|
||||
EVT_TEXT(XRCID("txtConnStr"), dlgProperty::OnChange)
|
||||
EVT_TEXT(XRCID("txtDbRestriction"), dlgServer::OnChangeRestr)
|
||||
EVT_COMBOBOX(XRCID("cbSSL"), dlgProperty::OnChange)
|
||||
EVT_CHECKBOX(XRCID("chkStorePwd"), dlgProperty::OnChange)
|
||||
|
|
@ -231,6 +233,7 @@ void dlgServer::OnOK(wxCommandEvent &ev)
|
|||
server->iSetDatabase(cbDatabase->GetValue());
|
||||
server->iSetUsername(txtUsername->GetValue());
|
||||
server->iSetRolename(txtRolename->GetValue());
|
||||
server->iSetConnStr(txtConnStr->GetValue());
|
||||
server->iSetStorePwd(chkStorePwd->GetValue());
|
||||
server->iSetRestore(chkRestore->GetValue());
|
||||
server->iSetDbRestriction(txtDbRestriction->GetValue().Trim());
|
||||
|
|
@ -274,6 +277,7 @@ void dlgServer::OnOK(wxCommandEvent &ev)
|
|||
server->GetPort(),
|
||||
server->GetStorePwd(),
|
||||
server->GetRolename(),
|
||||
server->GetConnStr(),
|
||||
server->GetRestore(),
|
||||
server->GetSSL(),
|
||||
server->GetColour(),
|
||||
|
|
@ -466,6 +470,7 @@ int dlgServer::Go(bool modal)
|
|||
txtUsername->SetValue(server->GetUsername());
|
||||
chkStorePwd->SetValue(server->GetStorePwd());
|
||||
txtRolename->SetValue(server->GetRolename());
|
||||
txtConnStr->SetValue(server->GetConnStr());
|
||||
chkRestore->SetValue(server->GetRestore());
|
||||
txtDbRestriction->SetValue(server->GetDbRestriction());
|
||||
colourPicker->SetColour(server->GetColour());
|
||||
|
|
@ -517,6 +522,7 @@ int dlgServer::Go(bool modal)
|
|||
txtUsername->Disable();
|
||||
chkStorePwd->Disable();
|
||||
txtRolename->Disable();
|
||||
txtConnStr->Disable();
|
||||
chkRestore->Disable();
|
||||
txtDbRestriction->Disable();
|
||||
colourPicker->Disable();
|
||||
|
|
@ -579,7 +585,7 @@ pgObject *dlgServer::CreateObject(pgCollection *collection)
|
|||
txtService->GetValue(), cbDatabase->GetValue(),
|
||||
txtUsername->GetValue(), StrToLong(txtPort->GetValue()),
|
||||
chkTryConnect->GetValue() && chkStorePwd->GetValue(),
|
||||
txtRolename->GetValue(), chkRestore->GetValue(), cbSSL->GetCurrentSelection(),
|
||||
txtRolename->GetValue(), txtConnStr->GetValue(), chkRestore->GetValue(), cbSSL->GetCurrentSelection(),
|
||||
colourPicker->GetColourString(), cbGroup->GetValue(),
|
||||
chkSSHTunnel->GetValue(), txtTunnelHost->GetValue(), txtTunnelUsername->GetValue(),
|
||||
radioBtnPassword->GetValue(),
|
||||
|
|
@ -593,7 +599,7 @@ pgObject *dlgServer::CreateObject(pgCollection *collection)
|
|||
txtService->GetValue(), cbDatabase->GetValue(),
|
||||
txtUsername->GetValue(), StrToLong(txtPort->GetValue()),
|
||||
chkTryConnect->GetValue() && chkStorePwd->GetValue(),
|
||||
txtRolename->GetValue(), chkRestore->GetValue(), cbSSL->GetCurrentSelection(),
|
||||
txtRolename->GetValue(), txtConnStr->GetValue(), chkRestore->GetValue(), cbSSL->GetCurrentSelection(),
|
||||
colourPicker->GetColourString(), cbGroup->GetValue());
|
||||
}
|
||||
|
||||
|
|
@ -645,6 +651,7 @@ void dlgServer::CheckChange()
|
|||
|| cbSSL->GetCurrentSelection() != server->GetSSL()
|
||||
|| chkStorePwd->GetValue() != server->GetStorePwd()
|
||||
|| txtRolename->GetValue() != server->GetRolename()
|
||||
|| txtConnStr->GetValue() != server->GetConnStr()
|
||||
|| chkRestore->GetValue() != server->GetRestore()
|
||||
|| txtDbRestriction->GetValue() != server->GetDbRestriction()
|
||||
|| sColour != sColour2
|
||||
|
|
|
|||
|
|
@ -1304,6 +1304,7 @@ void frmMain::StoreServers()
|
|||
settings->WriteInt(key + wxT("Port"), server->GetPort());
|
||||
settings->WriteBool(key + wxT("StorePwd"), server->GetStorePwd());
|
||||
settings->Write(key + wxT("Rolename"), server->GetRolename());
|
||||
settings->Write(key + wxT("ConnStr"), server->GetConnStr());
|
||||
settings->WriteBool(key + wxT("Restore"), server->GetRestore());
|
||||
settings->Write(key + wxT("Database"), server->GetDatabaseName());
|
||||
settings->Write(key + wxT("Username"), server->GetUsername());
|
||||
|
|
|
|||
|
|
@ -592,7 +592,7 @@ void frmStatus::OnChangeDatabase(wxCommandEvent &ev)
|
|||
}
|
||||
|
||||
locks_connection = new pgConn(connection->GetHostName(), connection->GetService(), connection->GetHostAddr(), cbDatabase->GetValue(),
|
||||
connection->GetUser(), connection->GetPassword(), connection->GetPort(), connection->GetRole(), connection->GetSslMode(),
|
||||
connection->GetUser(), connection->GetPassword(), connection->GetPort(), connection->GetRole(),"", connection->GetSslMode(),
|
||||
0, connection->GetApplicationName(), connection->GetSSLCert(), connection->GetSSLKey(), connection->GetSSLRootCert(), connection->GetSSLCrl(),
|
||||
connection->GetSSLCompression());
|
||||
|
||||
|
|
@ -1253,7 +1253,7 @@ void frmStatus::OnCopyQuery(wxCommandEvent &ev)
|
|||
{
|
||||
pgConn *conn = new pgConn(connection->GetHostName(), connection->GetService(), connection->GetHostAddr(), dbname,
|
||||
connection->GetUser(), connection->GetPassword(),
|
||||
connection->GetPort(), connection->GetRole(), connection->GetSslMode(), connection->GetDbOid(),
|
||||
connection->GetPort(), connection->GetRole(),"", connection->GetSslMode(), connection->GetDbOid(),
|
||||
connection->GetApplicationName(),
|
||||
connection->GetSSLCert(), connection->GetSSLKey(), connection->GetSSLRootCert(), connection->GetSSLCrl(),
|
||||
connection->GetSSLCompression());
|
||||
|
|
@ -3437,6 +3437,7 @@ void frmStatus::OnCommit(wxCommandEvent &event)
|
|||
connection->GetPassword(),
|
||||
connection->GetPort(),
|
||||
connection->GetRole(),
|
||||
"",
|
||||
connection->GetSslMode(),
|
||||
0,
|
||||
connection->GetApplicationName(),
|
||||
|
|
@ -3494,6 +3495,7 @@ void frmStatus::OnRollback(wxCommandEvent &event)
|
|||
connection->GetPassword(),
|
||||
connection->GetPort(),
|
||||
connection->GetRole(),
|
||||
"",
|
||||
connection->GetSslMode(),
|
||||
0,
|
||||
connection->GetApplicationName(),
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class pgConn
|
|||
public:
|
||||
pgConn(const wxString &server = wxT(""), const wxString &service = wxT(""), const wxString &hostaddr = wxT(""),
|
||||
const wxString &database = wxT(""), const wxString &username = wxT(""), const wxString &password = wxT(""),
|
||||
int port = 5432, const wxString &rolename = wxT(""), int sslmode = 0, OID oid = 0,
|
||||
int port = 5432, const wxString &rolename = wxT(""), const wxString& addconnstr = wxT(""), int sslmode = 0, OID oid = 0,
|
||||
const wxString &applicationname = wxT("pgAdmin"),
|
||||
const wxString &sslcert = wxT(""), const wxString &sslkey = wxT(""), const wxString &sslrootcert = wxT(""), const wxString &sslcrl = wxT(""),
|
||||
const bool sslcompression = true);
|
||||
|
|
@ -178,6 +178,10 @@ public:
|
|||
{
|
||||
return save_sslkey;
|
||||
}
|
||||
wxString GetAddConnStr() const
|
||||
{
|
||||
return save_addconnstr;
|
||||
}
|
||||
wxString GetSSLRootCert() const
|
||||
{
|
||||
return save_sslrootcert;
|
||||
|
|
@ -303,7 +307,7 @@ private:
|
|||
wxString reservedNamespaces;
|
||||
wxString connstr;
|
||||
|
||||
wxString save_server, save_service, save_hostaddr, save_database, save_username, save_password, save_rolename, save_applicationname;
|
||||
wxString save_server, save_service, save_hostaddr, save_database, save_username, save_password, save_rolename, save_addconnstr, save_applicationname;
|
||||
wxString save_sslcert, save_sslkey, save_sslrootcert, save_sslcrl;
|
||||
int save_port, save_sslmode;
|
||||
bool save_sslcompression;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public:
|
|||
return remoteServer;
|
||||
}
|
||||
pgConn *CreateConn(wxString &applicationame, bool &createdNew);
|
||||
pgConn *CreateConn(wxString &server, wxString &dbname, wxString &username, int port, wxString &rolename, int sslmode, wxString &applicationame, bool writeMRU = false);
|
||||
pgConn *CreateConn(wxString &server, wxString &dbname, wxString &username, int port, wxString &rolename, wxString& addconnstr, int sslmode, wxString &applicationame, bool writeMRU = false);
|
||||
wxString GetServerName();
|
||||
wxString GetDatabase();
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class pgServer : public pgObject
|
|||
public:
|
||||
pgServer(const wxString &newServer = wxT(""), const wxString &newHostAddr = wxT(""), const wxString &newDescription = wxT(""),
|
||||
const wxString &newService = wxT(""), const wxString &newDatabase = wxT(""), const wxString &newUsername = wxT(""), int newPort = 5432,
|
||||
bool storePwd = false, const wxString &newRolename = wxT(""), bool restore = true, int sslMode = 0,
|
||||
bool storePwd = false, const wxString &newRolename = wxT(""), const wxString& newConnStr = wxT(""), bool restore = true, int sslMode = 0,
|
||||
const wxString &colour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW).GetAsString(wxC2S_HTML_SYNTAX), const wxString &group = wxEmptyString,
|
||||
bool sshTunnel = false, const wxString &newTunnelHost = wxEmptyString, const wxString &newTunnelUserName = wxEmptyString, bool authModePwd = true,
|
||||
const wxString &newTunnelPassword = wxEmptyString, const wxString &newPublicKey = wxEmptyString, const wxString &newIdentityFile = wxEmptyString,
|
||||
|
|
@ -112,6 +112,10 @@ public:
|
|||
{
|
||||
return rolename;
|
||||
}
|
||||
wxString GetConnStr() const
|
||||
{
|
||||
return connstr;
|
||||
}
|
||||
bool GetRestore() const
|
||||
{
|
||||
return restore;
|
||||
|
|
@ -308,6 +312,10 @@ public:
|
|||
{
|
||||
rolename = newVal;
|
||||
}
|
||||
void iSetConnStr(const wxString& newVal)
|
||||
{
|
||||
connstr = newVal;
|
||||
}
|
||||
void iSetRestore(const bool b)
|
||||
{
|
||||
restore = b;
|
||||
|
|
@ -534,7 +542,7 @@ private:
|
|||
pgConn *conn;
|
||||
long serverIndex;
|
||||
bool connected, passwordValid, autovacuumRunning;
|
||||
wxString service, hostaddr, database, username, password, rolename, ver, error;
|
||||
wxString service, hostaddr, database, username, password, rolename, connstr, ver, error;
|
||||
wxString lastDatabase, lastSchema, description, serviceId, discoveryId;
|
||||
wxDateTime upSince;
|
||||
int port, ssl;
|
||||
|
|
|
|||
|
|
@ -638,7 +638,8 @@ bool pgAdmin3::OnInit()
|
|||
winSplash->Show(false);
|
||||
dlgSelectConnection dlg(NULL, NULL);
|
||||
dlg.CenterOnParent();
|
||||
conn = dlg.CreateConn(host, database, username, port, rolename, sslmode, applicationname);
|
||||
wxString connstr = "";
|
||||
conn = dlg.CreateConn(host, database, username, port, rolename,connstr, sslmode, applicationname);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -822,7 +823,8 @@ bool pgAdmin3::OnInit()
|
|||
winSplash->Show(false);
|
||||
dlgSelectConnection dlg(NULL, NULL);
|
||||
dlg.CenterOnParent();
|
||||
conn = dlg.CreateConn(host, database, username, port, rolename, sslmode, applicationname);
|
||||
wxString connstr = "";
|
||||
conn = dlg.CreateConn(host, database, username, port, rolename, connstr, sslmode, applicationname);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -645,6 +645,7 @@ void pgRole::ReassignDropOwnedTo(frmMain *form)
|
|||
GetConnection()->GetPassword(),
|
||||
GetConnection()->GetPort(),
|
||||
GetConnection()->GetRole(),
|
||||
GetConnection()->GetAddConnStr(),
|
||||
GetConnection()->GetSslMode(),
|
||||
0,
|
||||
GetConnection()->GetApplicationName(),
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
#define DEFAULT_PG_DATABASE wxT("postgres")
|
||||
|
||||
pgServer::pgServer(const wxString &newName, const wxString &newHostAddr, const wxString &newDescription, const wxString &newService,
|
||||
const wxString &newDatabase, const wxString &newUsername, int newPort, bool _storePwd, const wxString &newRolename, bool _restore,
|
||||
const wxString &newDatabase, const wxString &newUsername, int newPort, bool _storePwd, const wxString &newRolename, const wxString& newConnStr, bool _restore,
|
||||
int _ssl, const wxString &_colour, const wxString &_group, bool _sshTunnel, const wxString &newTunnelHost, const wxString &newTunnelUserName,
|
||||
bool _authModePwd, const wxString &newTunnelPassword, const wxString &newPublicKey, const wxString &newIdentity, const int &sshPort)
|
||||
: pgObject(serverFactory, newName)
|
||||
|
|
@ -70,6 +70,7 @@ pgServer::pgServer(const wxString &newName, const wxString &newHostAddr, const w
|
|||
passwordValid = true;
|
||||
storePwd = _storePwd;
|
||||
rolename = newRolename;
|
||||
connstr = newConnStr;
|
||||
restore = _restore;
|
||||
superUser = false;
|
||||
createPrivilege = false;
|
||||
|
|
@ -232,12 +233,12 @@ pgConn *pgServer::CreateConn(wxString dbName, OID oid, wxString applicationname)
|
|||
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
|
||||
if(sshTunnel)
|
||||
{
|
||||
conn = new pgConn(local_listenhost, service, hostaddr, dbName, username, password, local_listenport, rolename, ssl, oid, applicationname, sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
conn = new pgConn(local_listenhost, service, hostaddr, dbName, username, password, local_listenport, rolename,connstr, ssl, oid, applicationname, sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
conn = new pgConn(GetName(), service, hostaddr, dbName, username, password, port, rolename, ssl, oid, applicationname, sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
conn = new pgConn(GetName(), service, hostaddr, dbName, username, password, port, rolename,connstr, ssl, oid, applicationname, sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
}
|
||||
|
||||
if (conn && conn->GetStatus() != PGCONN_OK)
|
||||
|
|
@ -807,21 +808,21 @@ int pgServer::Connect(frmMain *form, bool askPassword, const wxString &pwd, bool
|
|||
wxGetEnv(wxT("USERNAME"),&usr);
|
||||
if (database.IsEmpty())
|
||||
{
|
||||
conn = new pgConn(host, service, hostaddr, DEFAULT_PG_DATABASE, username, password, iPort, rolename, ssl, 0, appearanceFactory->GetLongAppName() +wxT(" - ")+ usr, sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
conn = new pgConn(host, service, hostaddr, DEFAULT_PG_DATABASE, username, password, iPort, rolename,connstr, ssl, 0, appearanceFactory->GetLongAppName() +wxT(" - ")+ usr, sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
if (conn->GetStatus() == PGCONN_OK)
|
||||
database = DEFAULT_PG_DATABASE;
|
||||
else if (conn->GetStatus() == PGCONN_BAD && conn->GetLastError().Find(
|
||||
wxT("database \"") DEFAULT_PG_DATABASE wxT("\" does not exist")) >= 0)
|
||||
{
|
||||
delete conn;
|
||||
conn = new pgConn(host, service, hostaddr, wxT("template1"), username, password, iPort, rolename, ssl, 0, appearanceFactory->GetLongAppName() + wxT(" - Browser"), sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
conn = new pgConn(host, service, hostaddr, wxT("template1"), username, password, iPort, rolename,connstr, ssl, 0, appearanceFactory->GetLongAppName() + wxT(" - Browser"), sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
if (conn && conn->GetStatus() == PGCONN_OK)
|
||||
database = wxT("template1");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
conn = new pgConn(host, service, hostaddr, database, username, password, iPort, rolename, ssl, 0, appearanceFactory->GetLongAppName() + _(" ")+usr, sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
conn = new pgConn(host, service, hostaddr, database, username, password, iPort, rolename,connstr, ssl, 0, appearanceFactory->GetLongAppName() + _(" ")+usr, sslcert, sslkey, sslrootcert, sslcrl, sslcompression);
|
||||
if (!conn)
|
||||
{
|
||||
form->EndMsg(false);
|
||||
|
|
@ -1252,6 +1253,8 @@ void pgServer::ShowTreeDetail(ctlTree *browser, frmMain *form, ctlListView *prop
|
|||
properties->AppendItem(_("Username"), GetUsername());
|
||||
if (!GetRolename().IsEmpty())
|
||||
properties->AppendItem(_("Default role"), GetRolename());
|
||||
if (!GetConnStr().IsEmpty())
|
||||
properties->AppendItem(_("Add connect str"), GetConnStr());
|
||||
|
||||
properties->AppendYesNoItem(_("Store password?"), GetStorePwd());
|
||||
properties->AppendYesNoItem(_("Restore environment?"), GetRestore());
|
||||
|
|
@ -1544,7 +1547,7 @@ pgObject *pgServerFactory::CreateObjects(pgCollection *obj, ctlTree *browser, co
|
|||
|
||||
long loop, port, ssl = 0;
|
||||
wxString key, servername, hostaddr, description, service, database, username, lastDatabase, lastSchema;
|
||||
wxString storePwd, rolename, restore, serviceID, discoveryID, dbRestriction, colour;
|
||||
wxString storePwd, rolename, connstr, restore, serviceID, discoveryID, dbRestriction, colour;
|
||||
wxString group, sslcert, sslkey, sslrootcert, sslcrl, sslcompression;
|
||||
|
||||
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
|
||||
|
|
@ -1575,6 +1578,7 @@ pgObject *pgServerFactory::CreateObjects(pgCollection *obj, ctlTree *browser, co
|
|||
settings->Read(key + wxT("Description"), &description, wxEmptyString);
|
||||
settings->Read(key + wxT("StorePwd"), &storePwd, wxEmptyString);
|
||||
settings->Read(key + wxT("Rolename"), &rolename, wxEmptyString);
|
||||
settings->Read(key + wxT("ConnStr"), &connstr, wxEmptyString);
|
||||
settings->Read(key + wxT("Restore"), &restore, wxT("true"));
|
||||
settings->Read(key + wxT("Port"), &port, 0);
|
||||
settings->Read(key + wxT("Database"), &database, wxEmptyString);
|
||||
|
|
@ -1631,7 +1635,7 @@ pgObject *pgServerFactory::CreateObjects(pgCollection *obj, ctlTree *browser, co
|
|||
|
||||
// Add the Server node
|
||||
#if defined(HAVE_OPENSSL_CRYPTO) || defined(HAVE_GCRYPT)
|
||||
server = new pgServer(servername, hostaddr, description, service, database, username, port, StrToBool(storePwd), rolename, StrToBool(restore), ssl,
|
||||
server = new pgServer(servername, hostaddr, description, service, database, username, port, StrToBool(storePwd), rolename, connstr, StrToBool(restore), ssl,
|
||||
colour, group, StrToBool(sshTunnel), tunnelHost, tunnelUserName, StrToBool(authModePwd), tunnelPassword, publicKeyFile, identityFile, tunnelPort);
|
||||
#else
|
||||
server = new pgServer(servername, hostaddr, description, service, database, username, port, StrToBool(storePwd), rolename, StrToBool(restore), ssl,
|
||||
|
|
@ -1723,7 +1727,7 @@ pgObject *pgServerFactory::CreateObjects(pgCollection *obj, ctlTree *browser, co
|
|||
svcKey->QueryValue(wxT("Port"), &tmpport);
|
||||
|
||||
// Add the Server node
|
||||
server = new pgServer(servername, wxEmptyString, description, wxEmptyString, database, username, (long)tmpport, false, wxEmptyString, false);
|
||||
server = new pgServer(servername, wxEmptyString, description, wxEmptyString, database, username, (long)tmpport, false, wxEmptyString, wxEmptyString, false);
|
||||
server->iSetDiscoveryID(svcName);
|
||||
server->iSetDiscovered(true);
|
||||
server->iSetServiceID(svcName);
|
||||
|
|
@ -1813,7 +1817,7 @@ pgObject *pgServerFactory::CreateObjects(pgCollection *obj, ctlTree *browser, co
|
|||
// Add the item, if it looks sane
|
||||
if (port != 0 && username != wxEmptyString)
|
||||
{
|
||||
server = new pgServer(servername, wxEmptyString, description, wxEmptyString, wxT("postgres"), username, port, false, rolename, 0);
|
||||
server = new pgServer(servername, wxEmptyString, description, wxEmptyString, wxT("postgres"), username, port, false, rolename, connstr, 0);
|
||||
server->iSetDiscoveryID(cnf->GetPath() + wxT("/") + version);
|
||||
server->iSetDiscovered(true);
|
||||
server->iSetGroup(group);
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@
|
|||
<cols>2</cols>
|
||||
<vgap>5</vgap>
|
||||
<hgap>5</hgap>
|
||||
<growablerows>4</growablerows>
|
||||
<growablerows>5</growablerows>
|
||||
<growablecols>1</growablecols>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticText" name="stHostAddr">
|
||||
|
|
@ -461,6 +461,18 @@
|
|||
<flag>wxEXPAND|wxTOP|wxLEFT|wxRIGHT</flag>
|
||||
<border>4</border>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticText" name="stConnStr">
|
||||
<label>Connect str</label>
|
||||
</object>
|
||||
<flag>wxALIGN_CENTRE_VERTICAL|wxTOP|wxLEFT|wxRIGHT</flag>
|
||||
<border>4</border>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxTextCtrl" name="txtConnStr"/>
|
||||
<flag>wxEXPAND|wxTOP|wxLEFT|wxRIGHT</flag>
|
||||
<border>4</border>
|
||||
</object>
|
||||
<object class="sizeritem">
|
||||
<object class="wxStaticText" name="stDbRestr">
|
||||
<label>DB restriction</label>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue