summaryrefslogtreecommitdiff
path: root/uui/source/iahndl.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-01-27 11:19:25 +0000
committerOliver Bolte <obo@openoffice.org>2005-01-27 11:19:25 +0000
commitbc73a6140c6d3d1588eb39d5fb222630a0e4ee1d (patch)
tree5a82ccf71fe4f4f5fd811d5bca65b916d33e0445 /uui/source/iahndl.cxx
parent5b3dc1c6d2839e9eb92332c115a8aee1004aef58 (diff)
INTEGRATION: CWS kso13 (1.44.14); FILE MERGED
2004/12/16 16:30:24 kso 1.44.14.1: #i39147# - AuthenticationRequest: Only call setXXX methods if setting is allowed (now we do a canSetXXX before).
Diffstat (limited to 'uui/source/iahndl.cxx')
-rw-r--r--uui/source/iahndl.cxx77
1 files changed, 48 insertions, 29 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index 888108ce0a..a461823298 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: iahndl.cxx,v $
*
- * $Revision: 1.44 $
+ * $Revision: 1.45 $
*
- * last change: $Author: kz $ $Date: 2004-10-04 18:07:35 $
+ * last change: $Author: obo $ $Date: 2005-01-27 12:19:25 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -245,10 +245,10 @@
#endif
#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_MERGERECOVERYREQUEST_HPP_
#include <com/sun/star/configuration/backend/MergeRecoveryRequest.hpp>
-#endif
+#endif
#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_STRATUMCREATIONEXCEPTION_HPP_
#include <com/sun/star/configuration/backend/StratumCreationException.hpp>
-#endif
+#endif
#ifndef _OSL_DIAGNOSE_H_
#include "osl/diagnose.h"
#endif
@@ -603,7 +603,7 @@ UUIInteractionHandler::handle(
rRequest->getContinuations());
return;
}
-
+
star::ucb::AuthenticationRequest aAuthenticationRequest;
if (aAnyRequest >>= aAuthenticationRequest)
{
@@ -1614,18 +1614,25 @@ UUIInteractionHandler::handleAuthenticationRequest(
aRec(xContainer->find(rRequest.ServerName, this));
if (aRec.UserList.getLength() != 0)
{
- xSupplyAuthentication->
- setUserName(aRec.UserList[0].UserName.getStr());
- OSL_ENSURE(aRec.UserList[0].Passwords.getLength() != 0,
- "empty password list");
- xSupplyAuthentication->
- setPassword(aRec.UserList[0].Passwords[0].getStr());
+ if (xSupplyAuthentication->canSetUserName())
+ xSupplyAuthentication->
+ setUserName(aRec.UserList[0].UserName.getStr());
+ if (xSupplyAuthentication->canSetPassword())
+ {
+ OSL_ENSURE(aRec.UserList[0].Passwords.getLength() != 0,
+ "empty password list");
+ xSupplyAuthentication->
+ setPassword(aRec.UserList[0].Passwords[0].getStr());
+ }
if (aRec.UserList[0].Passwords.getLength() > 1)
if (rRequest.HasRealm)
- xSupplyAuthentication->
- setRealm(aRec.UserList[0].Passwords[1].
- getStr());
- else
+ {
+ if (xSupplyAuthentication->canSetRealm())
+ xSupplyAuthentication->
+ setRealm(aRec.UserList[0].Passwords[1].
+ getStr());
+ }
+ else if (xSupplyAuthentication->canSetAccount())
xSupplyAuthentication->
setAccount(aRec.UserList[0].Passwords[1].
getStr());
@@ -1646,17 +1653,22 @@ UUIInteractionHandler::handleAuthenticationRequest(
if (!rRequest.HasPassword
|| rRequest.Password != aRec.UserList[0].Passwords[0])
{
- xSupplyAuthentication->
- setUserName(aRec.UserList[0].UserName.getStr());
- xSupplyAuthentication->
- setPassword(aRec.UserList[0].Passwords[0].
- getStr());
+ if (xSupplyAuthentication->canSetUserName())
+ xSupplyAuthentication->
+ setUserName(aRec.UserList[0].UserName.getStr());
+ if (xSupplyAuthentication->canSetPassword())
+ xSupplyAuthentication->
+ setPassword(aRec.UserList[0].Passwords[0].
+ getStr());
if (aRec.UserList[0].Passwords.getLength() > 1)
if (rRequest.HasRealm)
- xSupplyAuthentication->
- setRealm(aRec.UserList[0].Passwords[1].
+ {
+ if (xSupplyAuthentication->canSetRealm())
+ xSupplyAuthentication->
+ setRealm(aRec.UserList[0].Passwords[1].
getStr());
- else
+ }
+ else if (xSupplyAuthentication->canSetAccount())
xSupplyAuthentication->
setAccount(aRec.UserList[0].Passwords[1].
getStr());
@@ -1694,8 +1706,10 @@ UUIInteractionHandler::handleAuthenticationRequest(
case ERRCODE_BUTTON_OK:
if (xSupplyAuthentication.is())
{
- xSupplyAuthentication->setUserName(aInfo.GetUserName());
- xSupplyAuthentication->setPassword(aInfo.GetPassword());
+ if (xSupplyAuthentication->canSetUserName())
+ xSupplyAuthentication->setUserName(aInfo.GetUserName());
+ if (xSupplyAuthentication->canSetPassword())
+ xSupplyAuthentication->setPassword(aInfo.GetPassword());
xSupplyAuthentication->
setRememberPassword(
aInfo.GetIsSavePassword() ?
@@ -1704,9 +1718,13 @@ UUIInteractionHandler::handleAuthenticationRequest(
star::ucb::RememberAuthentication_SESSION :
star::ucb::RememberAuthentication_NO);
if (rRequest.HasRealm)
- xSupplyAuthentication->setRealm(aInfo.GetAccount());
- else
+ {
+ if (xSupplyAuthentication->canSetRealm())
+ xSupplyAuthentication->setRealm(aInfo.GetAccount());
+ }
+ else if (xSupplyAuthentication->canSetAccount())
xSupplyAuthentication->setAccount(aInfo.GetAccount());
+
xSupplyAuthentication->select();
}
// Empty user name can not be valid:
@@ -1773,7 +1791,8 @@ UUIInteractionHandler::handleMasterPasswordRequest(
case ERRCODE_BUTTON_OK:
if (xSupplyAuthentication.is())
{
- xSupplyAuthentication->setPassword(aInfo.GetPassword());
+ if (xSupplyAuthentication->canSetPassword())
+ xSupplyAuthentication->setPassword(aInfo.GetPassword());
xSupplyAuthentication->select();
}
break;
@@ -1995,7 +2014,7 @@ UUIInteractionHandler::handleNoSuchFilterRequest( star::document::NoSuchFilterRe
{
::comphelper::SequenceAsHashMap lProps(xFilters->nextElement());
uui::FilterNamePair aPair;
-
+
aPair.sInternal = lProps.getUnpackedValueOrDefault(rtl::OUString::createFromAscii("Name"), ::rtl::OUString());
aPair.sUI = lProps.getUnpackedValueOrDefault(rtl::OUString::createFromAscii("UIName"), ::rtl::OUString());
if (