Skip to content

Commit

Permalink
[postgres][db2] username and authcfg are not mutually exclusive (foll…
Browse files Browse the repository at this point in the history
…owup aae7a32)
  • Loading branch information
jef-n committed Jul 4, 2018
1 parent 53a25c7 commit 47f6faa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
19 changes: 9 additions & 10 deletions src/providers/db2/qgsdb2dataitems.cpp
Expand Up @@ -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;
}
Expand Down
1 change: 0 additions & 1 deletion src/providers/postgres/qgspostgresconn.cpp
Expand Up @@ -1790,7 +1790,6 @@ QgsDataSourceUri QgsPostgresConn::connUri( const QString &connName )

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

Expand Down

0 comments on commit 47f6faa

Please sign in to comment.