Skip to content
Permalink
Browse files
[bugfix][backport] Apply authentication configuration to xyz layers
  • Loading branch information
elpaso committed Mar 24, 2017
1 parent 23e2202 commit 918c47c403123efad4aa9aa9057dfd0b55f12047
Showing with 16 additions and 19 deletions.
  1. +16 −19 src/providers/wms/qgswmscapabilities.cpp
@@ -41,6 +41,22 @@ bool QgsWmsSettings::parseUri( const QString& uriString )
QgsDataSourceURI uri;
uri.setEncodedUri( uriString );

// Setup authentication
mAuth.mUserName = uri.param( "username" );
QgsDebugMsg( "set username to " + mAuth.mUserName );

mAuth.mPassword = uri.param( "password" );
QgsDebugMsg( "set password to " + mAuth.mPassword );

if ( uri.hasParam( "authcfg" ) )
{
mAuth.mAuthCfg = uri.param( "authcfg" );
}
QgsDebugMsg( "set authcfg to " + mAuth.mAuthCfg );

mAuth.mReferer = uri.param( "referer" );
QgsDebugMsg( "set referer to " + mAuth.mReferer );

mXyz = false; // assume WMS / WMTS

if ( uri.param( "type" ) == "xyz" )
@@ -54,10 +70,6 @@ bool QgsWmsSettings::parseUri( const QString& uriString )
mMaxHeight = 0;
mHttpUri = uri.param( "url" );
mBaseUrl = mHttpUri;
mAuth.mUserName.clear();
mAuth.mPassword.clear();
mAuth.mReferer.clear();
mAuth.mAuthCfg.clear();
mIgnoreGetMapUrl = false;
mIgnoreGetFeatureInfoUrl = false;
mSmoothPixmapTransform = true;
@@ -87,21 +99,6 @@ bool QgsWmsSettings::parseUri( const QString& uriString )

mDpiMode = uri.hasParam( "dpiMode" ) ? static_cast< QgsWmsDpiMode >( uri.param( "dpiMode" ).toInt() ) : dpiAll;

mAuth.mUserName = uri.param( "username" );
QgsDebugMsg( "set username to " + mAuth.mUserName );

mAuth.mPassword = uri.param( "password" );
QgsDebugMsg( "set password to " + mAuth.mPassword );

if ( uri.hasParam( "authcfg" ) )
{
mAuth.mAuthCfg = uri.param( "authcfg" );
}
QgsDebugMsg( "set authcfg to " + mAuth.mAuthCfg );

mAuth.mReferer = uri.param( "referer" );
QgsDebugMsg( "set referer to " + mAuth.mReferer );

mActiveSubLayers = uri.params( "layers" );
mActiveSubStyles = uri.params( "styles" );
QgsDebugMsg( "Entering: layers:" + mActiveSubLayers.join( ", " ) + ", styles:" + mActiveSubStyles.join( ", " ) );

0 comments on commit 918c47c

Please sign in to comment.