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 53a25c7 commit 47f6faa322e31b839554d77f351746565dd82b09
Showing with 9 additions and 11 deletions.
  1. +9 −10 src/providers/db2/qgsdb2dataitems.cpp
  2. +0 −1 src/providers/postgres/qgspostgresconn.cpp
@@ -80,22 +80,21 @@ bool QgsDb2ConnectionItem::ConnInfoFromParameters(
+ "dbname='" + database + "' ";
}

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

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

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

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

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

0 comments on commit 47f6faa

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