diff options
author | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-07 13:23:46 +0200 |
---|---|---|
committer | Thomas Lange [tl] <tl@openoffice.org> | 2010-06-07 13:23:46 +0200 |
commit | 4be38c879b1684bd7e0444d86451d94f5dd10775 (patch) | |
tree | afee44d9444d341709a41e55dde85edf609d7951 /uui | |
parent | 928c651b68ccb995482edf00d27e825b880132bd (diff) | |
parent | f8e7afbac976ca862a801b9648fd95b2107757b2 (diff) |
cws tl79: merge with DEV300_m80
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/iahndl-authentication.cxx | 125 |
1 files changed, 74 insertions, 51 deletions
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 81f79c1b75e4..4183b852735e 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -81,8 +81,10 @@ executeLoginDialog( nFlags |= LF_NO_ACCOUNT; if (!(rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_USER_NAME)) nFlags |= LF_USERNAME_READONLY; + if (!bSavePassword) nFlags |= LF_NO_SAVEPASSWORD; + if (!bCanUseSysCreds) nFlags |= LF_NO_USESYSCREDS; @@ -137,8 +139,7 @@ executeLoginDialog( } } -void -getRememberModes( +void getRememberModes( uno::Sequence< ucb::RememberAuthentication > const & rRememberModes, ucb::RememberAuthentication & rPreferredMode, ucb::RememberAuthentication & rAlternateMode ) @@ -276,7 +277,7 @@ handleAuthenticationRequest_( ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT); aInfo.SetCanUseSystemCredentials(bCanUseSystemCredentials); - aInfo.SetIsUseSystemCredentials(bDefaultUseSystemCredentials); + aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials ); aInfo.SetModifyAccount(rRequest.HasAccount && xSupplyAuthentication.is() && xSupplyAuthentication->canSetAccount()); @@ -331,54 +332,76 @@ handleAuthenticationRequest_( ////////////////////////// // Third, store credentials in password container. - if (aInfo.GetIsUseSystemCredentials()) - { - if (aInfo.GetIsRememberPassword() || - (eAlternateRememberMode == ucb::RememberAuthentication_SESSION)) - { - if (!aPwContainerHelper.addRecord( - rURL.getLength() ? rURL : rRequest.ServerName, - rtl::OUString(), // empty u/p -> sys creds - uno::Sequence< rtl::OUString >(), - xIH, - !aInfo.GetIsRememberPassword() - ? false /* SESSION */ - : ePreferredRememberMode - == ucb::RememberAuthentication_PERSISTENT)) - { - xSupplyAuthentication->setRememberPassword( - ucb::RememberAuthentication_NO); - } - } - } - // Empty user name can not be valid: - else if (aInfo.GetUserName().Len() != 0) - { - if (aInfo.GetIsRememberPassword() || - (eAlternateRememberMode == ucb::RememberAuthentication_SESSION)) - { - uno::Sequence< rtl::OUString > - aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); - aPassList[0] = aInfo.GetPassword(); - if (aInfo.GetAccount().Len() != 0) - aPassList[1] = aInfo.GetAccount(); - - if (!aPwContainerHelper.addRecord( - rURL.getLength() ? rURL : rRequest.ServerName, - aInfo.GetUserName(), - aPassList, - xIH, - !aInfo.GetIsRememberPassword() - ? false /* SESSION */ - : ePreferredRememberMode - == ucb::RememberAuthentication_PERSISTENT)) - { - xSupplyAuthentication->setRememberPassword( - ucb::RememberAuthentication_NO); - } - } - } - break; + if ( aInfo.GetIsUseSystemCredentials() ) + { + if (aInfo.GetIsRememberPassword()) + { + if (!aPwContainerHelper.addRecord( + rURL.getLength() ? rURL : rRequest.ServerName, + rtl::OUString(), // empty u/p -> sys creds + uno::Sequence< rtl::OUString >(), + xIH, + ePreferredRememberMode + == ucb::RememberAuthentication_PERSISTENT)) + { + xSupplyAuthentication->setRememberPassword( + ucb::RememberAuthentication_NO); + } + } + else if (eAlternateRememberMode + == ucb::RememberAuthentication_SESSION) + { + if (!aPwContainerHelper.addRecord( + rURL.getLength() ? rURL : rRequest.ServerName, + rtl::OUString(), // empty u/p -> sys creds + uno::Sequence< rtl::OUString >(), + xIH, + false /* SESSION */)) + { + xSupplyAuthentication->setRememberPassword( + ucb::RememberAuthentication_NO); + } + } + } + // Empty user name can not be valid: + else if (aInfo.GetUserName().Len() != 0) + { + uno::Sequence< rtl::OUString > + aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); + aPassList[0] = aInfo.GetPassword(); + if (aInfo.GetAccount().Len() != 0) + aPassList[1] = aInfo.GetAccount(); + + if (aInfo.GetIsRememberPassword()) + { + if (!aPwContainerHelper.addRecord( + rURL.getLength() ? rURL : rRequest.ServerName, + aInfo.GetUserName(), + aPassList, + xIH, + ePreferredRememberMode + == ucb::RememberAuthentication_PERSISTENT)) + { + xSupplyAuthentication->setRememberPassword( + ucb::RememberAuthentication_NO); + } + } + else if (eAlternateRememberMode + == ucb::RememberAuthentication_SESSION) + { + if (!aPwContainerHelper.addRecord( + rURL.getLength() ? rURL : rRequest.ServerName, + aInfo.GetUserName(), + aPassList, + xIH, + false /* SESSION */)) + { + xSupplyAuthentication->setRememberPassword( + ucb::RememberAuthentication_NO); + } + } + } + break; case ERRCODE_BUTTON_RETRY: if (xRetry.is()) |