diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-01-27 11:19:25 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-01-27 11:19:25 +0000 |
commit | ce422a929dc0f924fb86c003dedb63d62b762f93 (patch) | |
tree | c86a58ee7b45bd237c361e8c8f04b233c83653f2 /uui | |
parent | 691671488c0a93fba73bdf3d7a4c58305ab73c95 (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')
-rw-r--r-- | uui/source/iahndl.cxx | 69 |
1 files changed, 44 insertions, 25 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 7ce1f4a4350e..0526718aae37 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 @@ -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; |