Skip to content
Permalink
Browse files

[postgres][db2] username and authcfg are not mutually exclusive (foll…

…owup aae7a32)
  • Loading branch information
jef-n committed Jul 4, 2018
1 parent 761cdaf commit fba9982bebfeb9fec5e9d29169fb325f016fb707
Showing with 9 additions and 15 deletions.
  1. +9 −9 src/providers/db2/qgsdb2dataitems.cpp
  2. +0 −6 src/providers/postgres/qgspostgresconn.cpp
@@ -84,18 +84,18 @@ bool QgsDb2ConnectionItem::ConnInfoFromParameters(
{
connInfo += "authcfg='" + authcfg + "' ";
}
else // include user and password if authcfg is empty

if ( !password.isEmpty() )
{
if ( !username.isEmpty() )
{
connInfo += "user='" + username + "' ";
}
// include password if authcfg is empty
connInfo += "password='" + password + "' ";
}

if ( !password.isEmpty() )
{
connInfo += "password='" + password + "' ";
}
if ( !username.isEmpty() )
{
connInfo += "user='" + username + "' ";
}

QgsDebugMsg( "connInfo: '" + connInfo + "'" );
return true;
}
@@ -1788,12 +1788,6 @@ QgsDataSourceUri QgsPostgresConn::connUri( const QString &connName )

QString authcfg = settings.value( key + "/authcfg" ).toString();

if ( !authcfg.isEmpty() )
{
username.clear();
password.clear();
}

QgsDataSourceUri uri;
if ( !service.isEmpty() )
{

0 comments on commit fba9982

Please sign in to comment.
You can’t perform that action at this time.