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 9ce55ca)
  • Loading branch information
jef-n committed Jul 4, 2018
1 parent 7ee252e commit aefcc55
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/providers/db2/qgsdb2dataitems.cpp
Expand Up @@ -81,22 +81,20 @@ 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 + "' ";
}
connInfo += "password='" + password + "' ";
}

QgsDebugMsg( "connInfo: '" + connInfo + "'" );
return true;
}
Expand Down
1 change: 0 additions & 1 deletion src/providers/postgres/qgspostgresconn.cpp
Expand Up @@ -1728,7 +1728,6 @@ QgsDataSourceURI QgsPostgresConn::connUri( const QString& theConnName )

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

Expand Down

0 comments on commit aefcc55

Please sign in to comment.