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).
This commit is contained in:
Oliver Bolte
2005-01-27 11:19:25 +00:00
parent 691671488c
commit ce422a929d

View File

@@ -2,9 +2,9 @@
* *
* $RCSfile: iahndl.cxx,v $ * $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 * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@@ -1614,18 +1614,25 @@ UUIInteractionHandler::handleAuthenticationRequest(
aRec(xContainer->find(rRequest.ServerName, this)); aRec(xContainer->find(rRequest.ServerName, this));
if (aRec.UserList.getLength() != 0) if (aRec.UserList.getLength() != 0)
{ {
xSupplyAuthentication-> if (xSupplyAuthentication->canSetUserName())
setUserName(aRec.UserList[0].UserName.getStr()); xSupplyAuthentication->
OSL_ENSURE(aRec.UserList[0].Passwords.getLength() != 0, setUserName(aRec.UserList[0].UserName.getStr());
"empty password list"); if (xSupplyAuthentication->canSetPassword())
xSupplyAuthentication-> {
setPassword(aRec.UserList[0].Passwords[0].getStr()); 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 (aRec.UserList[0].Passwords.getLength() > 1)
if (rRequest.HasRealm) if (rRequest.HasRealm)
xSupplyAuthentication-> {
setRealm(aRec.UserList[0].Passwords[1]. if (xSupplyAuthentication->canSetRealm())
getStr()); xSupplyAuthentication->
else setRealm(aRec.UserList[0].Passwords[1].
getStr());
}
else if (xSupplyAuthentication->canSetAccount())
xSupplyAuthentication-> xSupplyAuthentication->
setAccount(aRec.UserList[0].Passwords[1]. setAccount(aRec.UserList[0].Passwords[1].
getStr()); getStr());
@@ -1646,17 +1653,22 @@ UUIInteractionHandler::handleAuthenticationRequest(
if (!rRequest.HasPassword if (!rRequest.HasPassword
|| rRequest.Password != aRec.UserList[0].Passwords[0]) || rRequest.Password != aRec.UserList[0].Passwords[0])
{ {
xSupplyAuthentication-> if (xSupplyAuthentication->canSetUserName())
setUserName(aRec.UserList[0].UserName.getStr()); xSupplyAuthentication->
xSupplyAuthentication-> setUserName(aRec.UserList[0].UserName.getStr());
setPassword(aRec.UserList[0].Passwords[0]. if (xSupplyAuthentication->canSetPassword())
getStr()); xSupplyAuthentication->
setPassword(aRec.UserList[0].Passwords[0].
getStr());
if (aRec.UserList[0].Passwords.getLength() > 1) if (aRec.UserList[0].Passwords.getLength() > 1)
if (rRequest.HasRealm) if (rRequest.HasRealm)
xSupplyAuthentication-> {
setRealm(aRec.UserList[0].Passwords[1]. if (xSupplyAuthentication->canSetRealm())
xSupplyAuthentication->
setRealm(aRec.UserList[0].Passwords[1].
getStr()); getStr());
else }
else if (xSupplyAuthentication->canSetAccount())
xSupplyAuthentication-> xSupplyAuthentication->
setAccount(aRec.UserList[0].Passwords[1]. setAccount(aRec.UserList[0].Passwords[1].
getStr()); getStr());
@@ -1694,8 +1706,10 @@ UUIInteractionHandler::handleAuthenticationRequest(
case ERRCODE_BUTTON_OK: case ERRCODE_BUTTON_OK:
if (xSupplyAuthentication.is()) if (xSupplyAuthentication.is())
{ {
xSupplyAuthentication->setUserName(aInfo.GetUserName()); if (xSupplyAuthentication->canSetUserName())
xSupplyAuthentication->setPassword(aInfo.GetPassword()); xSupplyAuthentication->setUserName(aInfo.GetUserName());
if (xSupplyAuthentication->canSetPassword())
xSupplyAuthentication->setPassword(aInfo.GetPassword());
xSupplyAuthentication-> xSupplyAuthentication->
setRememberPassword( setRememberPassword(
aInfo.GetIsSavePassword() ? aInfo.GetIsSavePassword() ?
@@ -1704,9 +1718,13 @@ UUIInteractionHandler::handleAuthenticationRequest(
star::ucb::RememberAuthentication_SESSION : star::ucb::RememberAuthentication_SESSION :
star::ucb::RememberAuthentication_NO); star::ucb::RememberAuthentication_NO);
if (rRequest.HasRealm) if (rRequest.HasRealm)
xSupplyAuthentication->setRealm(aInfo.GetAccount()); {
else if (xSupplyAuthentication->canSetRealm())
xSupplyAuthentication->setRealm(aInfo.GetAccount());
}
else if (xSupplyAuthentication->canSetAccount())
xSupplyAuthentication->setAccount(aInfo.GetAccount()); xSupplyAuthentication->setAccount(aInfo.GetAccount());
xSupplyAuthentication->select(); xSupplyAuthentication->select();
} }
// Empty user name can not be valid: // Empty user name can not be valid:
@@ -1773,7 +1791,8 @@ UUIInteractionHandler::handleMasterPasswordRequest(
case ERRCODE_BUTTON_OK: case ERRCODE_BUTTON_OK:
if (xSupplyAuthentication.is()) if (xSupplyAuthentication.is())
{ {
xSupplyAuthentication->setPassword(aInfo.GetPassword()); if (xSupplyAuthentication->canSetPassword())
xSupplyAuthentication->setPassword(aInfo.GetPassword());
xSupplyAuthentication->select(); xSupplyAuthentication->select();
} }
break; break;