Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 fba9982
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/providers/db2/qgsdb2dataitems.cpp
Expand Up @@ -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;
}
Expand Down
6 changes: 0 additions & 6 deletions src/providers/postgres/qgspostgresconn.cpp
Expand Up @@ -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() )
{
Expand Down

0 comments on commit fba9982

Please sign in to comment.