From 34e224f6783d92e0a75d070a0e5b5fa65822462b Mon Sep 17 00:00:00 2001 From: Dirk Völzke Date: Mon, 23 Nov 2009 13:51:12 +0000 Subject: #i106373# Removed unused code --- uui/source/iahndl.cxx | 3 +++ uui/source/iahndl.hxx | 3 +++ 2 files changed, 6 insertions(+) (limited to 'uui') diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 996fd24e531d..4fbbb7f75c26 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -2630,6 +2630,8 @@ UUIInteractionHelper::handleCertificateValidationRequest( */ } +// @@@ Todo #i29340#: activate! +#if 0 namespace { enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE }; @@ -2729,6 +2731,7 @@ UUIInteractionHelper::handleNameClashResolveRequest( break; } } +#endif void UUIInteractionHelper::handleMasterPasswordRequest( diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index bea53e436c6d..6c16769406c5 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -267,6 +267,8 @@ private: rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); +// @@@ Todo #i29340#: activate! +#if 0 void handleNameClashResolveRequest( com::sun::star::ucb::NameClashResolveRequest const & rRequest, @@ -274,6 +276,7 @@ private: com::sun::star::task::XInteractionContinuation > > const & rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); +#endif void handleMasterPasswordRequest( -- cgit From 5f4789aa21fb16982d4e744d6eb1f2198f36154e Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Wed, 3 Mar 2010 16:36:43 +0100 Subject: #109634# password to modify dialog --- uui/source/cookiedg.cxx | 0 uui/source/cookiedg.hxx | 0 uui/source/iahndl-authentication.cxx | 46 +++++-- uui/source/ids.hrc | 257 ++++++++++++++++++----------------- uui/source/passworddlg.cxx | 30 ++-- uui/source/passworddlg.hxx | 2 +- uui/source/passworddlg.src | 12 +- uui/source/passworderrs.src | 9 +- 8 files changed, 199 insertions(+), 157 deletions(-) mode change 100644 => 100755 uui/source/cookiedg.cxx mode change 100644 => 100755 uui/source/cookiedg.hxx mode change 100644 => 100755 uui/source/iahndl-authentication.cxx mode change 100644 => 100755 uui/source/ids.hrc mode change 100644 => 100755 uui/source/passworddlg.cxx mode change 100644 => 100755 uui/source/passworddlg.hxx mode change 100644 => 100755 uui/source/passworddlg.src mode change 100644 => 100755 uui/source/passworderrs.src (limited to 'uui') diff --git a/uui/source/cookiedg.cxx b/uui/source/cookiedg.cxx old mode 100644 new mode 100755 diff --git a/uui/source/cookiedg.hxx b/uui/source/cookiedg.hxx old mode 100644 new mode 100755 diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx old mode 100644 new mode 100755 index 9154122187ea..18c8d94b573a --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -29,6 +29,7 @@ ************************************************************************/ #include "com/sun/star/task/DocumentPasswordRequest.hpp" +#include "com/sun/star/task/DocumentPasswordRequest2.hpp" #include "com/sun/star/task/DocumentMSPasswordRequest.hpp" #include "com/sun/star/task/MasterPasswordRequest.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" @@ -37,6 +38,7 @@ #include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp" #include "com/sun/star/ucb/URLAuthenticationRequest.hpp" +#include "osl/diagnose.h" #include "rtl/digest.h" #include "vos/mutex.hxx" #include "tools/errcode.hxx" @@ -561,28 +563,46 @@ UUIInteractionHelper::handlePasswordRequest( uno::Reference< task::XInteractionRequest > const & rRequest) SAL_THROW((uno::RuntimeException)) { + // parameters to be filled for the call to handlePasswordRequest_ + Window * pParent = getParentProperty(); + task::PasswordRequestMode nMode = task::PasswordRequestMode_PASSWORD_ENTER; + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations = rRequest->getContinuations(); + ::rtl::OUString aDocumentName; + bool bMSCryptoMode = false; + bool bIsPasswordToModify = false; + + bool bDoHandleRequest = false; + uno::Any aAnyRequest(rRequest->getRequest()); task::DocumentPasswordRequest aDocumentPasswordRequest; - if (aAnyRequest >>= aDocumentPasswordRequest) + if (!bDoHandleRequest && (aAnyRequest >>= aDocumentPasswordRequest)) { - handlePasswordRequest_(getParentProperty(), - aDocumentPasswordRequest.Mode, - rRequest->getContinuations(), - aDocumentPasswordRequest.Name, - false /* bool bMSCryptoMode */); - return true; + nMode = aDocumentPasswordRequest.Mode; + aDocumentName = aDocumentPasswordRequest.Name; + OSL_ENSURE( bMSCryptoMode == false, "bMSCryptoMode should be false" ); + OSL_ENSURE( bIsPasswordToModify == false, "bIsPasswordToModify should be false" ); + + bDoHandleRequest = true; } task::DocumentMSPasswordRequest aDocumentMSPasswordRequest; - if (aAnyRequest >>= aDocumentMSPasswordRequest) + if (!bDoHandleRequest && (aAnyRequest >>= aDocumentMSPasswordRequest)) + { + nMode = aDocumentMSPasswordRequest.Mode; + aDocumentName = aDocumentMSPasswordRequest.Name; + bMSCryptoMode = true; + OSL_ENSURE( bIsPasswordToModify == false, "bIsPasswordToModify should be false" ); + + bDoHandleRequest = true; + } + + if (bDoHandleRequest) { - handlePasswordRequest_(getParentProperty(), - aDocumentMSPasswordRequest.Mode, - rRequest->getContinuations(), - aDocumentMSPasswordRequest.Name, - true /* bool bMSCryptoMode */); + handlePasswordRequest_( pParent, nMode, rContinuations, aDocumentName, bMSCryptoMode ); return true; } + return false; } + diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc old mode 100644 new mode 100755 index 28de301fe775..c02d9d6e419f --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -38,126 +38,129 @@ #include "tools/errcode.hxx" #endif -#define RID_KEEP_PASSWORD (RID_UUI_START + 0) -#define RID_SAVE_PASSWORD (RID_UUI_START + 1) -#define DLG_UUI_LOGIN (RID_UUI_START + 2) -#define DLG_COOKIES (RID_UUI_START + 3) -#define STR_COOKIES_RECV_START (RID_UUI_START + 4) -#define STR_COOKIES_RECV_COOKIES (RID_UUI_START + 5) -#define STR_COOKIES_RECV_TITLE (RID_UUI_START + 6) -#define STR_COOKIES_SEND_START (RID_UUI_START + 7) -#define STR_COOKIES_SEND_COOKIES (RID_UUI_START + 8) -#define STR_COOKIES_SEND_TITLE (RID_UUI_START + 9) -#define DLG_FILTER_SELECT (RID_UUI_START + 10) +#define RID_KEEP_PASSWORD (RID_UUI_START + 0) +#define RID_SAVE_PASSWORD (RID_UUI_START + 1) +#define DLG_UUI_LOGIN (RID_UUI_START + 2) +#define DLG_COOKIES (RID_UUI_START + 3) +#define STR_COOKIES_RECV_START (RID_UUI_START + 4) +#define STR_COOKIES_RECV_COOKIES (RID_UUI_START + 5) +#define STR_COOKIES_RECV_TITLE (RID_UUI_START + 6) +#define STR_COOKIES_SEND_START (RID_UUI_START + 7) +#define STR_COOKIES_SEND_COOKIES (RID_UUI_START + 8) +#define STR_COOKIES_SEND_TITLE (RID_UUI_START + 9) +#define DLG_FILTER_SELECT (RID_UUI_START + 10) // RID_UUI_START + 11 moved to ERRCODE_UUI_WRONGMEDIUM -#define DLG_UUI_MASTERPASSWORD (RID_UUI_START + 12) -#define STR_ERROR_PASSWORDS_NOT_IDENTICAL (RID_UUI_START + 13) -#define STR_ERROR_MASTERPASSWORD_WRONG (RID_UUI_START + 14) +#define DLG_UUI_MASTERPASSWORD (RID_UUI_START + 12) +#define STR_ERROR_PASSWORDS_NOT_IDENTICAL (RID_UUI_START + 13) +#define STR_ERROR_MASTERPASSWORD_WRONG (RID_UUI_START + 14) // RID_UUI_START + 15, 16, 17 are misused by syncaccess/source/ui/resids.hrc -#define RID_UUI_ERRHDL (RID_UUI_START + 20) -#define DLG_UUI_MASTERPASSWORD_CRT (RID_UUI_START + 21) -#define DLG_UUI_PASSWORD (RID_UUI_START + 22) -#define DLG_UUI_PASSWORD_CRT (RID_UUI_START + 23) -#define STR_ERROR_PASSWORD_WRONG (RID_UUI_START + 24) -#define STR_WARNING_BROKENSIGNATURE_TITLE (RID_UUI_START + 25) -#define DLG_UUI_UNKNOWNAUTH (RID_UUI_START + 26) -#define DLG_UUI_UNKNOWNAUTH_CRT (RID_UUI_START + 27) -#define DLG_UUI_SSLWARN (RID_UUI_START + 28) -#define DLG_UUI_SSLWARN_CRT (RID_UUI_START + 29) -#define RID_XMLSECDLG_MACROWARN (RID_UUI_START + 30) -#define STR_UNKNOWNUSER (RID_UUI_START + 31) -#define STR_OPENLOCKED_TITLE (RID_UUI_START + 32) -#define STR_OPENLOCKED_MSG (RID_UUI_START + 33) -#define STR_OPENLOCKED_OPENREADONLY_BTN (RID_UUI_START + 34) -#define STR_OPENLOCKED_OPENCOPY_BTN (RID_UUI_START + 35) -#define STR_FILECHANGED_TITLE (RID_UUI_START + 36) -#define STR_FILECHANGED_MSG (RID_UUI_START + 37) -#define STR_FILECHANGED_SAVEANYWAY_BTN (RID_UUI_START + 38) -#define STR_ALREADYOPEN_TITLE (RID_UUI_START + 39) -#define STR_ALREADYOPEN_MSG (RID_UUI_START + 40) -#define STR_ALREADYOPEN_READONLY_BTN (RID_UUI_START + 41) -#define STR_ALREADYOPEN_OPEN_BTN (RID_UUI_START + 42) -#define STR_LOCKFAILED_TITLE (RID_UUI_START + 43) -#define STR_LOCKFAILED_MSG (RID_UUI_START + 44) -#define STR_LOCKFAILED_DONTSHOWAGAIN (RID_UUI_START + 45) -#define STR_TRYLATER_TITLE (RID_UUI_START + 46) -#define STR_TRYLATER_MSG (RID_UUI_START + 47) -#define STR_TRYLATER_RETRYSAVING_BTN (RID_UUI_START + 48) -#define STR_TRYLATER_SAVEAS_BTN (RID_UUI_START + 49) -#define STR_ALREADYOPEN_SAVE_MSG (RID_UUI_START + 50) -#define STR_ALREADYOPEN_RETRY_SAVE_BTN (RID_UUI_START + 51) -#define STR_ALREADYOPEN_SAVE_BTN (RID_UUI_START + 52) -#define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 53) -#define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE (RID_UUI_START + 54) +#define RID_UUI_ERRHDL (RID_UUI_START + 20) +#define DLG_UUI_MASTERPASSWORD_CRT (RID_UUI_START + 21) +#define DLG_UUI_PASSWORD (RID_UUI_START + 22) +#define DLG_UUI_PASSWORD_CRT (RID_UUI_START + 23) +#define STR_ERROR_PASSWORD_TO_OPEN_WRONG (RID_UUI_START + 24) +#define STR_ERROR_PASSWORD_TO_MODIFY_WRONG (RID_UUI_START + 25) +#define DLG_UUI_UNKNOWNAUTH (RID_UUI_START + 26) +#define DLG_UUI_UNKNOWNAUTH_CRT (RID_UUI_START + 27) +#define DLG_UUI_SSLWARN (RID_UUI_START + 28) +#define DLG_UUI_SSLWARN_CRT (RID_UUI_START + 29) +#define RID_XMLSECDLG_MACROWARN (RID_UUI_START + 30) +#define STR_UNKNOWNUSER (RID_UUI_START + 31) +#define STR_OPENLOCKED_TITLE (RID_UUI_START + 32) +#define STR_OPENLOCKED_MSG (RID_UUI_START + 33) +#define STR_OPENLOCKED_OPENREADONLY_BTN (RID_UUI_START + 34) +#define STR_OPENLOCKED_OPENCOPY_BTN (RID_UUI_START + 35) +#define STR_FILECHANGED_TITLE (RID_UUI_START + 36) +#define STR_FILECHANGED_MSG (RID_UUI_START + 37) +#define STR_FILECHANGED_SAVEANYWAY_BTN (RID_UUI_START + 38) +#define STR_ALREADYOPEN_TITLE (RID_UUI_START + 39) +#define STR_ALREADYOPEN_MSG (RID_UUI_START + 40) +#define STR_ALREADYOPEN_READONLY_BTN (RID_UUI_START + 41) +#define STR_ALREADYOPEN_OPEN_BTN (RID_UUI_START + 42) +#define STR_LOCKFAILED_TITLE (RID_UUI_START + 43) +#define STR_LOCKFAILED_MSG (RID_UUI_START + 44) +#define STR_LOCKFAILED_DONTSHOWAGAIN (RID_UUI_START + 45) +#define STR_TRYLATER_TITLE (RID_UUI_START + 46) +#define STR_TRYLATER_MSG (RID_UUI_START + 47) +#define STR_TRYLATER_RETRYSAVING_BTN (RID_UUI_START + 48) +#define STR_TRYLATER_SAVEAS_BTN (RID_UUI_START + 49) +#define STR_ALREADYOPEN_SAVE_MSG (RID_UUI_START + 50) +#define STR_ALREADYOPEN_RETRY_SAVE_BTN (RID_UUI_START + 51) +#define STR_ALREADYOPEN_SAVE_BTN (RID_UUI_START + 52) +#define RID_DLG_NEWER_VERSION_WARNING (RID_UUI_START + 53) +#define STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE (RID_UUI_START + 54) +#define STR_WARNING_BROKENSIGNATURE_TITLE (RID_UUI_START + 55) +#define STR_ENTER_PASSWORD_TO_OPEN (RID_UUI_START + 56) +#define STR_ENTER_PASSWORD_TO_MODIFY (RID_UUI_START + 57) -#define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0) -#define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1) -#define ERRCODE_UUI_IO_ALREADYEXISTS (ERRCODE_AREA_UUI + 2) -#define ERRCODE_UUI_IO_BADCRC (ERRCODE_AREA_UUI + 3) -#define ERRCODE_UUI_IO_CANTCREATE (ERRCODE_AREA_UUI + 4) -#define ERRCODE_UUI_IO_CANTREAD (ERRCODE_AREA_UUI + 5) -#define ERRCODE_UUI_IO_CANTSEEK (ERRCODE_AREA_UUI + 6) -#define ERRCODE_UUI_IO_CANTTELL (ERRCODE_AREA_UUI + 7) -#define ERRCODE_UUI_IO_CANTWRITE (ERRCODE_AREA_UUI + 8) -#define ERRCODE_UUI_IO_CURRENTDIR (ERRCODE_AREA_UUI + 9) -#define ERRCODE_UUI_IO_NOTREADY (ERRCODE_AREA_UUI + 10) -#define ERRCODE_UUI_IO_NOTSAMEDEVICE (ERRCODE_AREA_UUI + 11) -#define ERRCODE_UUI_IO_GENERAL (ERRCODE_AREA_UUI + 12) -#define ERRCODE_UUI_IO_INVALIDACCESS (ERRCODE_AREA_UUI + 13) -#define ERRCODE_UUI_IO_INVALIDCHAR (ERRCODE_AREA_UUI + 14) -#define ERRCODE_UUI_IO_INVALIDDEVICE (ERRCODE_AREA_UUI + 15) -#define ERRCODE_UUI_IO_INVALIDLENGTH (ERRCODE_AREA_UUI + 16) -#define ERRCODE_UUI_IO_INVALIDPARAMETER (ERRCODE_AREA_UUI + 17) -#define ERRCODE_UUI_IO_ISWILDCARD (ERRCODE_AREA_UUI + 18) -#define ERRCODE_UUI_IO_LOCKVIOLATION (ERRCODE_AREA_UUI + 19) -#define ERRCODE_UUI_IO_MISPLACEDCHAR (ERRCODE_AREA_UUI + 20) -#define ERRCODE_UUI_IO_NAMETOOLONG (ERRCODE_AREA_UUI + 21) -#define ERRCODE_UUI_IO_NOTEXISTS (ERRCODE_AREA_UUI + 22) -#define ERRCODE_UUI_IO_NOTEXISTSPATH (ERRCODE_AREA_UUI + 23) -#define ERRCODE_UUI_IO_NOTSUPPORTED (ERRCODE_AREA_UUI + 24) -#define ERRCODE_UUI_IO_NOTADIRECTORY (ERRCODE_AREA_UUI + 25) -#define ERRCODE_UUI_IO_NOTAFILE (ERRCODE_AREA_UUI + 26) -#define ERRCODE_UUI_IO_OUTOFSPACE (ERRCODE_AREA_UUI + 27) -#define ERRCODE_UUI_IO_TOOMANYOPENFILES (ERRCODE_AREA_UUI + 28) -#define ERRCODE_UUI_IO_OUTOFMEMORY (ERRCODE_AREA_UUI + 29) -#define ERRCODE_UUI_IO_PENDING (ERRCODE_AREA_UUI + 30) -#define ERRCODE_UUI_IO_RECURSIVE (ERRCODE_AREA_UUI + 31) -#define ERRCODE_UUI_IO_UNKNOWN (ERRCODE_AREA_UUI + 32) -#define ERRCODE_UUI_IO_WRITEPROTECTED (ERRCODE_AREA_UUI + 33) -#define ERRCODE_UUI_IO_WRONGFORMAT (ERRCODE_AREA_UUI + 34) -#define ERRCODE_UUI_IO_WRONGVERSION (ERRCODE_AREA_UUI + 35) -#define ERRCODE_UUI_IO_NOTEXISTS_VOLUME (ERRCODE_AREA_UUI + 36) -#define ERRCODE_UUI_IO_NOTEXISTS_FOLDER (ERRCODE_AREA_UUI + 37) -#define ERRCODE_UUI_WRONGJAVA (ERRCODE_AREA_UUI + 38) -#define ERRCODE_UUI_WRONGJAVA_VERSION (ERRCODE_AREA_UUI + 39) -#define ERRCODE_UUI_WRONGJAVA_MIN (ERRCODE_AREA_UUI + 40) -#define ERRCODE_UUI_WRONGJAVA_VERSION_MIN (ERRCODE_AREA_UUI + 41) -#define ERRCODE_UUI_BADPARTNERSHIP (ERRCODE_AREA_UUI + 42) -#define ERRCODE_UUI_BADPARTNERSHIP_NAME (ERRCODE_AREA_UUI + 43) -#define ERRCODE_UUI_IO_NOTREADY_VOLUME (ERRCODE_AREA_UUI + 44) -#define ERRCODE_UUI_IO_NOTREADY_REMOVABLE (ERRCODE_AREA_UUI + 45) -#define ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE (ERRCODE_AREA_UUI + 46) -#define ERRCODE_UUI_WRONGMEDIUM (ERRCODE_AREA_UUI + 47) -#define ERRCODE_UUI_IO_CANTCREATE_NONAME (ERRCODE_AREA_UUI + 48) -#define ERRCODE_UUI_IO_TARGETALREADYEXISTS (ERRCODE_AREA_UUI + 49) -#define ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE (ERRCODE_AREA_UUI + 50) -#define ERRCODE_UUI_IO_BROKENPACKAGE (ERRCODE_AREA_UUI + 51) -#define ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR (ERRCODE_AREA_UUI + 52) -#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE (ERRCODE_AREA_UUI + 53) -#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE (ERRCODE_AREA_UUI + 54) -#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING (ERRCODE_AREA_UUI + 55) -#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER (ERRCODE_AREA_UUI + 56) -#define ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA (ERRCODE_AREA_UUI + 57) -#define ERRCODE_UUI_IO_MODULESIZEEXCEEDED (ERRCODE_AREA_UUI + 58) -#define ERRCODE_UUI_LOCKING_LOCKED (ERRCODE_AREA_UUI + 59) -#define ERRCODE_UUI_LOCKING_LOCKED_SELF (ERRCODE_AREA_UUI + 60) -#define ERRCODE_UUI_LOCKING_NOT_LOCKED (ERRCODE_AREA_UUI + 61) -#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED (ERRCODE_AREA_UUI + 62) +#define ERRCODE_UUI_IO_ABORT (ERRCODE_AREA_UUI + 0) +#define ERRCODE_UUI_IO_ACCESSDENIED (ERRCODE_AREA_UUI + 1) +#define ERRCODE_UUI_IO_ALREADYEXISTS (ERRCODE_AREA_UUI + 2) +#define ERRCODE_UUI_IO_BADCRC (ERRCODE_AREA_UUI + 3) +#define ERRCODE_UUI_IO_CANTCREATE (ERRCODE_AREA_UUI + 4) +#define ERRCODE_UUI_IO_CANTREAD (ERRCODE_AREA_UUI + 5) +#define ERRCODE_UUI_IO_CANTSEEK (ERRCODE_AREA_UUI + 6) +#define ERRCODE_UUI_IO_CANTTELL (ERRCODE_AREA_UUI + 7) +#define ERRCODE_UUI_IO_CANTWRITE (ERRCODE_AREA_UUI + 8) +#define ERRCODE_UUI_IO_CURRENTDIR (ERRCODE_AREA_UUI + 9) +#define ERRCODE_UUI_IO_NOTREADY (ERRCODE_AREA_UUI + 10) +#define ERRCODE_UUI_IO_NOTSAMEDEVICE (ERRCODE_AREA_UUI + 11) +#define ERRCODE_UUI_IO_GENERAL (ERRCODE_AREA_UUI + 12) +#define ERRCODE_UUI_IO_INVALIDACCESS (ERRCODE_AREA_UUI + 13) +#define ERRCODE_UUI_IO_INVALIDCHAR (ERRCODE_AREA_UUI + 14) +#define ERRCODE_UUI_IO_INVALIDDEVICE (ERRCODE_AREA_UUI + 15) +#define ERRCODE_UUI_IO_INVALIDLENGTH (ERRCODE_AREA_UUI + 16) +#define ERRCODE_UUI_IO_INVALIDPARAMETER (ERRCODE_AREA_UUI + 17) +#define ERRCODE_UUI_IO_ISWILDCARD (ERRCODE_AREA_UUI + 18) +#define ERRCODE_UUI_IO_LOCKVIOLATION (ERRCODE_AREA_UUI + 19) +#define ERRCODE_UUI_IO_MISPLACEDCHAR (ERRCODE_AREA_UUI + 20) +#define ERRCODE_UUI_IO_NAMETOOLONG (ERRCODE_AREA_UUI + 21) +#define ERRCODE_UUI_IO_NOTEXISTS (ERRCODE_AREA_UUI + 22) +#define ERRCODE_UUI_IO_NOTEXISTSPATH (ERRCODE_AREA_UUI + 23) +#define ERRCODE_UUI_IO_NOTSUPPORTED (ERRCODE_AREA_UUI + 24) +#define ERRCODE_UUI_IO_NOTADIRECTORY (ERRCODE_AREA_UUI + 25) +#define ERRCODE_UUI_IO_NOTAFILE (ERRCODE_AREA_UUI + 26) +#define ERRCODE_UUI_IO_OUTOFSPACE (ERRCODE_AREA_UUI + 27) +#define ERRCODE_UUI_IO_TOOMANYOPENFILES (ERRCODE_AREA_UUI + 28) +#define ERRCODE_UUI_IO_OUTOFMEMORY (ERRCODE_AREA_UUI + 29) +#define ERRCODE_UUI_IO_PENDING (ERRCODE_AREA_UUI + 30) +#define ERRCODE_UUI_IO_RECURSIVE (ERRCODE_AREA_UUI + 31) +#define ERRCODE_UUI_IO_UNKNOWN (ERRCODE_AREA_UUI + 32) +#define ERRCODE_UUI_IO_WRITEPROTECTED (ERRCODE_AREA_UUI + 33) +#define ERRCODE_UUI_IO_WRONGFORMAT (ERRCODE_AREA_UUI + 34) +#define ERRCODE_UUI_IO_WRONGVERSION (ERRCODE_AREA_UUI + 35) +#define ERRCODE_UUI_IO_NOTEXISTS_VOLUME (ERRCODE_AREA_UUI + 36) +#define ERRCODE_UUI_IO_NOTEXISTS_FOLDER (ERRCODE_AREA_UUI + 37) +#define ERRCODE_UUI_WRONGJAVA (ERRCODE_AREA_UUI + 38) +#define ERRCODE_UUI_WRONGJAVA_VERSION (ERRCODE_AREA_UUI + 39) +#define ERRCODE_UUI_WRONGJAVA_MIN (ERRCODE_AREA_UUI + 40) +#define ERRCODE_UUI_WRONGJAVA_VERSION_MIN (ERRCODE_AREA_UUI + 41) +#define ERRCODE_UUI_BADPARTNERSHIP (ERRCODE_AREA_UUI + 42) +#define ERRCODE_UUI_BADPARTNERSHIP_NAME (ERRCODE_AREA_UUI + 43) +#define ERRCODE_UUI_IO_NOTREADY_VOLUME (ERRCODE_AREA_UUI + 44) +#define ERRCODE_UUI_IO_NOTREADY_REMOVABLE (ERRCODE_AREA_UUI + 45) +#define ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE (ERRCODE_AREA_UUI + 46) +#define ERRCODE_UUI_WRONGMEDIUM (ERRCODE_AREA_UUI + 47) +#define ERRCODE_UUI_IO_CANTCREATE_NONAME (ERRCODE_AREA_UUI + 48) +#define ERRCODE_UUI_IO_TARGETALREADYEXISTS (ERRCODE_AREA_UUI + 49) +#define ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE (ERRCODE_AREA_UUI + 50) +#define ERRCODE_UUI_IO_BROKENPACKAGE (ERRCODE_AREA_UUI + 51) +#define ERRCODE_UUI_IO_BROKENPACKAGE_CANTREPAIR (ERRCODE_AREA_UUI + 52) +#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE (ERRCODE_AREA_UUI + 53) +#define ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE (ERRCODE_AREA_UUI + 54) +#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING (ERRCODE_AREA_UUI + 55) +#define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER (ERRCODE_AREA_UUI + 56) +#define ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA (ERRCODE_AREA_UUI + 57) +#define ERRCODE_UUI_IO_MODULESIZEEXCEEDED (ERRCODE_AREA_UUI + 58) +#define ERRCODE_UUI_LOCKING_LOCKED (ERRCODE_AREA_UUI + 59) +#define ERRCODE_UUI_LOCKING_LOCKED_SELF (ERRCODE_AREA_UUI + 60) +#define ERRCODE_UUI_LOCKING_NOT_LOCKED (ERRCODE_AREA_UUI + 61) +#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED (ERRCODE_AREA_UUI + 62) -#define ERRCODE_AREA_UUI_UNKNOWNAUTH 25000 -#define SSLWARN_TYPE_DOMAINMISMATCH 10 -#define SSLWARN_TYPE_EXPIRED 20 -#define SSLWARN_TYPE_INVALID 30 +#define ERRCODE_AREA_UUI_UNKNOWNAUTH 25000 +#define SSLWARN_TYPE_DOMAINMISMATCH 10 +#define SSLWARN_TYPE_EXPIRED 20 +#define SSLWARN_TYPE_INVALID 30 #define ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED (ERRCODE_AREA_UUI_UNKNOWNAUTH + 1) @@ -170,17 +173,17 @@ #define ERRCODE_UUI_SSLWARN_INVALID_1 (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 1) #define TITLE_UUI_SSLWARN_INVALID (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 3) -#define HID_DLG_LOGIN (HID_UUI_START + 0) -#define HID_DLG_COOKIES (HID_UUI_START + 1) -#define HID_DLG_MASTERPASSWORD_UUI (HID_UUI_START+2) -#define HID_DLG_MASTERPASSWORD_CRT (HID_UUI_START+3) -#define HID_DLG_FILTER_SELECT (HID_UUI_START+4) -#define HID_DLG_PASSWORD_UUI (HID_UUI_START+5) -#define HID_DLG_PASSWORD_CRT (HID_UUI_START+6) -#define HID_DLG_UNKNOWNAUTH_UUI (HID_UUI_START+7) -#define HID_DLG_SSLWARN_UUI (HID_UUI_START+8) -#define HID_XMLSECDLG_MACROWARN (HID_UUI_START+9) -#define HID_DLG_NEWERVERSIONWARNING (HID_UUI_START+10) +#define HID_DLG_LOGIN (HID_UUI_START + 0) +#define HID_DLG_COOKIES (HID_UUI_START + 1) +#define HID_DLG_MASTERPASSWORD_UUI (HID_UUI_START + 2) +#define HID_DLG_MASTERPASSWORD_CRT (HID_UUI_START + 3) +#define HID_DLG_FILTER_SELECT (HID_UUI_START + 4) +#define HID_DLG_PASSWORD_UUI (HID_UUI_START + 5) +#define HID_DLG_PASSWORD_CRT (HID_UUI_START + 6) +#define HID_DLG_UNKNOWNAUTH_UUI (HID_UUI_START + 7) +#define HID_DLG_SSLWARN_UUI (HID_UUI_START + 8) +#define HID_XMLSECDLG_MACROWARN (HID_UUI_START + 9) +#define HID_DLG_NEWERVERSIONWARNING (HID_UUI_START +10) // HID_UUI_END (aka HID_CHAOS_NEW_DATABASE) is reserved in // sfx2/util/hidother.src diff --git a/uui/source/passworddlg.cxx b/uui/source/passworddlg.cxx old mode 100644 new mode 100755 index 4a2c584cf123..eaba330c85ec --- a/uui/source/passworddlg.cxx +++ b/uui/source/passworddlg.cxx @@ -51,30 +51,34 @@ IMPL_LINK( PasswordDialog, OKHdl_Impl, OKButton *, EMPTYARG ) // ----------------------------------------------------------------------- -PasswordDialog::PasswordDialog -( +PasswordDialog::PasswordDialog( Window* _pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, - rtl::OUString& aDocURL - ) + rtl::OUString& aDocURL, + bool bOpenToModify ) + :ModalDialog( _pParent, ResId( DLG_UUI_PASSWORD, *pResMgr ) ) - ,aFTPassword ( this, ResId( FT_PASSWORD, *pResMgr ) ) - ,aEDPassword ( this, ResId( ED_PASSWORD, *pResMgr ) ) - ,aOKBtn ( this, ResId( BTN_PASSWORD_OK, *pResMgr ) ) - ,aCancelBtn ( this, ResId( BTN_PASSWORD_CANCEL, *pResMgr ) ) - ,aHelpBtn ( this, ResId( BTN_PASSWORD_HELP, *pResMgr ) ) - ,aFixedLine1 ( this, ResId( FL_FIXED_LINE_1, *pResMgr ) ) - ,nDialogMode ( nDlgMode ) - ,pResourceMgr ( pResMgr ) + ,aFTPassword( this, ResId( FT_PASSWORD, *pResMgr )) + ,aEDPassword( this, ResId( ED_PASSWORD, *pResMgr )) + ,aOKBtn ( this, ResId( BTN_PASSWORD_OK, *pResMgr )) + ,aCancelBtn ( this, ResId( BTN_PASSWORD_CANCEL, *pResMgr )) + ,aHelpBtn ( this, ResId( BTN_PASSWORD_HELP, *pResMgr )) + ,aFixedLine1( this, ResId( FL_FIXED_LINE_1, *pResMgr )) + ,nDialogMode( nDlgMode ) + ,pResourceMgr ( pResMgr ) { if( nDialogMode == ::com::sun::star::task::PasswordRequestMode_PASSWORD_REENTER ) { - String aErrorMsg( ResId( STR_ERROR_PASSWORD_WRONG, *pResourceMgr )); + USHORT nErrStrId = bOpenToModify ? STR_ERROR_PASSWORD_TO_MODIFY_WRONG : STR_ERROR_PASSWORD_TO_OPEN_WRONG; + String aErrorMsg( ResId( nErrStrId, *pResourceMgr )); ErrorBox aErrorBox( _pParent, WB_OK, aErrorMsg ); aErrorBox.Execute(); } + USHORT nStrId = bOpenToModify ? STR_ENTER_PASSWORD_TO_MODIFY : STR_ENTER_PASSWORD_TO_OPEN; + aFTPassword.SetText( String( ResId( nStrId, *pResourceMgr ) ) ); + FreeResource(); aFTPassword.SetText( aFTPassword.GetText() + aDocURL ); diff --git a/uui/source/passworddlg.hxx b/uui/source/passworddlg.hxx old mode 100644 new mode 100755 index 75f65b456ac7..c5cb136022da --- a/uui/source/passworddlg.hxx +++ b/uui/source/passworddlg.hxx @@ -53,7 +53,7 @@ class PasswordDialog : public ModalDialog DECL_LINK( OKHdl_Impl, OKButton * ); public: - PasswordDialog( Window* pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, ::rtl::OUString& aDocURL ); + PasswordDialog( Window* pParent, ::com::sun::star::task::PasswordRequestMode nDlgMode, ResMgr * pResMgr, ::rtl::OUString& aDocURL, bool bOpenToModify = false ); String GetPassword() const { return aEDPassword.GetText(); } diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src old mode 100644 new mode 100755 index c9b8dfe0847e..682d8921cf5b --- a/uui/source/passworddlg.src +++ b/uui/source/passworddlg.src @@ -46,11 +46,11 @@ ModalDialog DLG_UUI_PASSWORD SVLook = TRUE ; Size = MAP_APPFONT( 145, 75 ); Text [ en-US ] = "Enter password"; + FixedText FT_PASSWORD { Pos = MAP_APPFONT( 3, 4 ); Size = MAP_APPFONT( 139, 28 ); - Text [ en-US ] = "Enter password to open file: \n"; WordBreak = TRUE; }; @@ -87,5 +87,15 @@ ModalDialog DLG_UUI_PASSWORD Pos = MAP_APPFONT( 0, 50 ); Size = MAP_APPFONT( 145, 6 ); }; + + String STR_ENTER_PASSWORD_TO_OPEN + { + Text [ en-US ] = "Enter password to open file: \n"; + }; + + String STR_ENTER_PASSWORD_TO_MODIFY + { + Text [ en-US ] = "Enter password to modify file: \n"; + }; }; diff --git a/uui/source/passworderrs.src b/uui/source/passworderrs.src old mode 100644 new mode 100755 index 90aa5688610e..1573cfbc8bb3 --- a/uui/source/passworderrs.src +++ b/uui/source/passworderrs.src @@ -34,9 +34,14 @@ #include #endif -String STR_ERROR_PASSWORD_WRONG +String STR_ERROR_PASSWORD_TO_OPEN_WRONG { - Text [ en-US ] = "The password is incorrect. The document cannot be opened."; + Text [ en-US ] = "The password is incorrect. The file cannot be opened."; +}; + +String STR_ERROR_PASSWORD_TO_MODIFY_WRONG +{ + Text [ en-US ] = "The password is incorrect. The file cannot be modified."; }; String STR_ERROR_MASTERPASSWORD_WRONG -- cgit From 8a44a90d32ee4dd2e9b3813e485ed4c0fe30cb12 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 4 Mar 2010 16:14:56 +0100 Subject: #i109634# password to open/modify dialog --- uui/source/iahndl-authentication.cxx | 92 +++++++++++++++++++++--------------- uui/source/loginerr.hxx | 12 +++++ 2 files changed, 66 insertions(+), 38 deletions(-) mode change 100644 => 100755 uui/source/loginerr.hxx (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 18c8d94b573a..e910d27d1132 100755 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -31,6 +31,7 @@ #include "com/sun/star/task/DocumentPasswordRequest.hpp" #include "com/sun/star/task/DocumentPasswordRequest2.hpp" #include "com/sun/star/task/DocumentMSPasswordRequest.hpp" +#include "com/sun/star/task/DocumentMSPasswordRequest2.hpp" #include "com/sun/star/task/MasterPasswordRequest.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" #include "com/sun/star/task/XInteractionPassword.hpp" @@ -43,6 +44,7 @@ #include "vos/mutex.hxx" #include "tools/errcode.hxx" #include "vcl/msgbox.hxx" +#include "vcl/abstdlg.hxx" #include "vcl/svapp.hxx" #include "ids.hrc" @@ -72,10 +74,8 @@ executeLoginDialog( { vos::OGuard aGuard(Application::GetSolarMutex()); - bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) - != 0; - bool bSavePassword = rInfo.GetIsPersistentPassword() - || rInfo.GetIsSavePassword(); + bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) != 0; + bool bSavePassword = rInfo.GetIsPersistentPassword() || rInfo.GetIsSavePassword(); bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials(); sal_uInt16 nFlags = 0; @@ -94,15 +94,10 @@ executeLoginDialog( if (!bCanUseSysCreds) nFlags |= LF_NO_USESYSCREDS; - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + std::auto_ptr< ResMgr > xManager( ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); UniString aRealm(rRealm); std::auto_ptr< LoginDialog > xDialog( - new LoginDialog(pParent, - nFlags, - rInfo.GetServer(), - &aRealm, - xManager.get())); + new LoginDialog( pParent, nFlags, rInfo.GetServer(), &aRealm, xManager.get())); if (rInfo.GetErrorText().Len() != 0) xDialog->SetErrorText(rInfo.GetErrorText()); xDialog->SetName(rInfo.GetUserName()); @@ -114,17 +109,14 @@ executeLoginDialog( if (bSavePassword) { - xDialog-> - SetSavePasswordText(ResId(rInfo.GetIsPersistentPassword() ? - RID_SAVE_PASSWORD : - RID_KEEP_PASSWORD, - *xManager.get())); + sal_uInt32 nResId = rInfo.GetIsPersistentPassword() ? + RID_SAVE_PASSWORD : RID_KEEP_PASSWORD; + xDialog->SetSavePasswordText( ResId( nResId, *xManager.get()) ); xDialog->SetSavePassword(rInfo.GetIsSavePassword()); } if ( bCanUseSysCreds ) - xDialog->SetUseSystemCredentials( - rInfo.GetIsUseSystemCredentials() ); + xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() ); rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); @@ -423,7 +415,8 @@ executePasswordDialog( LoginErrorInfo & rInfo, task::PasswordRequestMode nMode, ::rtl::OUString aDocName, - bool bMSCryptoMode) + bool bMSCryptoMode, + bool bIsPasswordToModify ) SAL_THROW((uno::RuntimeException)) { try @@ -434,23 +427,25 @@ executePasswordDialog( ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) { - std::auto_ptr< PasswordCreateDialog > xDialog( - new PasswordCreateDialog(pParent, - xManager.get(), - bMSCryptoMode)); + const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length - rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); + VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create(); + std::auto_ptr< AbstractPasswordToOpenModifyDialog > pDialog( + pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen ) ); + + rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); + rInfo.SetPasswordToOpen( pDialog->GetPasswordToOpen() ); + rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() ); + rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() ); } else { - std::auto_ptr< PasswordDialog > xDialog( - new PasswordDialog(pParent, nMode, xManager.get(), aDocName)); + std::auto_ptr< PasswordDialog > pDialog( + new PasswordDialog( pParent, nMode, xManager.get(), aDocName, bIsPasswordToModify ) ); - rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); + rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); + rInfo.SetPasswordToOpen( bIsPasswordToModify ? String() : pDialog->GetPassword() ); + rInfo.SetPasswordToModify( bIsPasswordToModify ? pDialog->GetPassword() : String() ); } } catch (std::bad_alloc const &) @@ -468,7 +463,8 @@ handlePasswordRequest_( uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations, ::rtl::OUString aDocumentName, - bool bMSCryptoMode ) + bool bMSCryptoMode, + bool bIsPasswordToModify ) SAL_THROW((uno::RuntimeException)) { uno::Reference< task::XInteractionRetry > xRetry; @@ -477,11 +473,8 @@ handlePasswordRequest_( getContinuations(rContinuations, &xRetry, &xAbort, &xPassword); LoginErrorInfo aInfo; - executePasswordDialog(pParent, - aInfo, - nMode, - aDocumentName, - bMSCryptoMode); + executePasswordDialog( pParent, aInfo, nMode, + aDocumentName, bMSCryptoMode, bIsPasswordToModify ); switch (aInfo.GetResult()) { @@ -575,6 +568,17 @@ UUIInteractionHelper::handlePasswordRequest( uno::Any aAnyRequest(rRequest->getRequest()); + task::DocumentPasswordRequest2 aDocumentPasswordRequest2; + if (!bDoHandleRequest && (aAnyRequest >>= aDocumentPasswordRequest2)) + { + nMode = aDocumentPasswordRequest2.Mode; + aDocumentName = aDocumentPasswordRequest2.Name; + OSL_ENSURE( bMSCryptoMode == false, "bMSCryptoMode should be false" ); + bIsPasswordToModify = aDocumentPasswordRequest2.IsRequestPasswordToModify; + + bDoHandleRequest = true; + } + task::DocumentPasswordRequest aDocumentPasswordRequest; if (!bDoHandleRequest && (aAnyRequest >>= aDocumentPasswordRequest)) { @@ -586,6 +590,17 @@ UUIInteractionHelper::handlePasswordRequest( bDoHandleRequest = true; } + task::DocumentMSPasswordRequest2 aDocumentMSPasswordRequest2; + if (!bDoHandleRequest && (aAnyRequest >>= aDocumentMSPasswordRequest2)) + { + nMode = aDocumentMSPasswordRequest2.Mode; + aDocumentName = aDocumentMSPasswordRequest2.Name; + bMSCryptoMode = true; + bIsPasswordToModify = aDocumentPasswordRequest2.IsRequestPasswordToModify; + + bDoHandleRequest = true; + } + task::DocumentMSPasswordRequest aDocumentMSPasswordRequest; if (!bDoHandleRequest && (aAnyRequest >>= aDocumentMSPasswordRequest)) { @@ -599,7 +614,8 @@ UUIInteractionHelper::handlePasswordRequest( if (bDoHandleRequest) { - handlePasswordRequest_( pParent, nMode, rContinuations, aDocumentName, bMSCryptoMode ); + handlePasswordRequest_( pParent, nMode, rContinuations, + aDocumentName, bMSCryptoMode, bIsPasswordToModify ); return true; } diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx old mode 100644 new mode 100755 index 6fc00c3b1eac..c09917ae04fe --- a/uui/source/loginerr.hxx +++ b/uui/source/loginerr.hxx @@ -50,10 +50,13 @@ private: String _aAccount; String _aUserName; String _aPassword; + String _aPasswordToOpen; + String _aPasswordToModify; String _aPath; String _aErrorText; BYTE _nFlags; USHORT _nRet; + bool _bRecommendToOpenReadonly; public: LoginErrorInfo() @@ -67,6 +70,9 @@ public: const String& GetAccount() const { return _aAccount; } const String& GetUserName() const { return _aUserName; } const String& GetPassword() const { return _aPassword; } + const String& GetPasswordToOpen() const { return _aPasswordToOpen; } + const String& GetPasswordToModify() const { return _aPasswordToModify; } + const bool IsRecommendToOpenReadonly() const { return _bRecommendToOpenReadonly; } const String& GetPath() const { return _aPath; } const String& GetErrorText() const { return _aErrorText; } BOOL GetIsPersistentPassword() const @@ -91,6 +97,12 @@ public: { _aUserName = aUserName; } void SetPassword( const String& aPassword ) { _aPassword = aPassword; } + void SetPasswordToOpen( const String& aPassword ) + { _aPasswordToOpen = aPassword; } + void SetPasswordToModify( const String& aPassword ) + { _aPasswordToModify = aPassword; } + void SetRecommendToOpenReadonly( bool bVal ) + { _bRecommendToOpenReadonly = bVal; } void SetPath( const String& aPath ) { _aPath = aPath; } void SetErrorText( const String& aErrorText ) -- cgit From 790814ab03bed7d1a05f36ce560292c5f25896a1 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Thu, 11 Mar 2010 15:22:09 +0100 Subject: #i110048# rearranging controls of the password dialog --- uui/source/logindlg.cxx | 153 +++++++++++++++++++--------------------- uui/source/logindlg.hrc | 16 +++-- uui/source/logindlg.hxx | 43 +++++------- uui/source/logindlg.src | 181 +++++++++++++++++++++++------------------------- 4 files changed, 188 insertions(+), 205 deletions(-) mode change 100644 => 100755 uui/source/logindlg.cxx mode change 100644 => 100755 uui/source/logindlg.hrc mode change 100644 => 100755 uui/source/logindlg.hxx mode change 100644 => 100755 uui/source/logindlg.src (limited to 'uui') diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx old mode 100644 new mode 100755 index 53ea243c9577..941c6c2558c8 --- a/uui/source/logindlg.cxx +++ b/uui/source/logindlg.cxx @@ -47,6 +47,14 @@ //............................................................................ //............................................................................ +static void lcl_Move( Window &rWin, long nOffset ) +{ + Point aTmp( rWin.GetPosPixel() ); + aTmp.Y() -= nOffset; + rWin.SetPosPixel( aTmp ); +} + + void LoginDialog::HideControls_Impl( USHORT nFlags ) { FASTBOOL bPathHide = FALSE; @@ -91,7 +99,8 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) if ( ( nFlags & LF_NO_ERRORTEXT ) == LF_NO_ERRORTEXT ) { aErrorInfo.Hide(); - aErrorGB.Hide(); + aErrorFT.Hide(); + aLogin1FL.Hide(); bErrorHide = TRUE; } @@ -110,53 +119,28 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) if ( bErrorHide ) { - long nOffset = aLoginGB.GetPosPixel().Y() - - aErrorGB.GetPosPixel().Y(); - Point aNewPnt = aRequestInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aRequestInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPathFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathFT.SetPosPixel( aNewPnt ); - aNewPnt = aPathED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathED.SetPosPixel( aNewPnt ); - aNewPnt = aPathInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPathBtn.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPathBtn.SetPosPixel( aNewPnt ); - aNewPnt = aNameFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameFT.SetPosPixel( aNewPnt ); - aNewPnt = aNameED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameED.SetPosPixel( aNewPnt ); - aNewPnt = aNameInfo.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aNameInfo.SetPosPixel( aNewPnt ); - aNewPnt = aPasswordFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPasswordFT.SetPosPixel( aNewPnt ); - aNewPnt = aPasswordED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aPasswordED.SetPosPixel( aNewPnt ); - aNewPnt = aAccountFT.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aAccountFT.SetPosPixel( aNewPnt ); - aNewPnt = aAccountED.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aAccountED.SetPosPixel( aNewPnt ); - aNewPnt = aSavePasswdBtn.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aNewPnt ); - aNewPnt = aUseSysCredsCB.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aUseSysCredsCB.SetPosPixel( aNewPnt ); - aNewPnt = aLoginGB.GetPosPixel(); - aNewPnt.Y() -= nOffset; - aLoginGB.SetPosPixel( aNewPnt ); + long nOffset = aRequestInfo.GetPosPixel().Y() - + aErrorFT.GetPosPixel().Y(); + lcl_Move( aRequestInfo, nOffset ); + lcl_Move( aLogin2FL, nOffset ); + lcl_Move( aPathFT, nOffset ); + lcl_Move( aPathED, nOffset ); + lcl_Move( aPathInfo, nOffset ); + lcl_Move( aPathBtn, nOffset ); + lcl_Move( aNameFT, nOffset ); + lcl_Move( aNameED, nOffset ); + lcl_Move( aNameInfo, nOffset ); + lcl_Move( aPasswordFT, nOffset ); + lcl_Move( aPasswordED, nOffset ); + lcl_Move( aAccountFT, nOffset ); + lcl_Move( aAccountED, nOffset ); + lcl_Move( aSavePasswdBtn, nOffset ); + lcl_Move( aUseSysCredsCB, nOffset ); + lcl_Move( aButtonsFL, nOffset ); + lcl_Move( aOKBtn, nOffset ); + lcl_Move( aCancelBtn, nOffset ); + lcl_Move( aHelpBtn, nOffset ); + Size aNewSiz = GetSizePixel(); aNewSiz.Height() -= nOffset; SetSizePixel( aNewSiz ); @@ -166,24 +150,20 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) { long nOffset = aNameED.GetPosPixel().Y() - aPathED.GetPosPixel().Y(); + lcl_Move( aNameFT, nOffset ); + lcl_Move( aNameED, nOffset ); + lcl_Move( aNameInfo, nOffset ); + lcl_Move( aPasswordFT, nOffset ); + lcl_Move( aPasswordED, nOffset ); + lcl_Move( aAccountFT, nOffset ); + lcl_Move( aAccountED, nOffset ); + lcl_Move( aSavePasswdBtn, nOffset ); + lcl_Move( aUseSysCredsCB, nOffset ); + lcl_Move( aButtonsFL, nOffset ); + lcl_Move( aOKBtn, nOffset ); + lcl_Move( aCancelBtn, nOffset ); + lcl_Move( aHelpBtn, nOffset ); - Point aTmpPnt1 = aNameFT.GetPosPixel(); - Point aTmpPnt2 = aPasswordFT.GetPosPixel(); - aNameFT.SetPosPixel( aPathFT.GetPosPixel() ); - aPasswordFT.SetPosPixel( aTmpPnt1 ); - aAccountFT.SetPosPixel( aTmpPnt2 ); - aTmpPnt1 = aNameED.GetPosPixel(); - aTmpPnt2 = aPasswordED.GetPosPixel(); - aNameED.SetPosPixel( aPathED.GetPosPixel() ); - aPasswordED.SetPosPixel( aTmpPnt1 ); - aAccountED.SetPosPixel( aTmpPnt2 ); - aNameInfo.SetPosPixel( aPathInfo.GetPosPixel() ); - aTmpPnt1 = aSavePasswdBtn.GetPosPixel(); - aTmpPnt1.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aTmpPnt1 ); - aTmpPnt1 = aUseSysCredsCB.GetPosPixel(); - aTmpPnt1.Y() -= nOffset; - aUseSysCredsCB.SetPosPixel( aTmpPnt1 ); Size aNewSz = GetSizePixel(); aNewSz.Height() -= nOffset; SetSizePixel( aNewSz ); @@ -191,14 +171,15 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) if ( bAccountHide ) { - long nOffset = aAccountED.GetPosPixel().Y() - aPasswordED.GetPosPixel().Y(); - - Point aTmpPnt = aSavePasswdBtn.GetPosPixel(); - aTmpPnt.Y() -= nOffset; - aSavePasswdBtn.SetPosPixel( aTmpPnt ); - aTmpPnt = aUseSysCredsCB.GetPosPixel(); - aTmpPnt.Y() -= nOffset; - aUseSysCredsCB.SetPosPixel( aTmpPnt ); + long nOffset = aAccountED.GetPosPixel().Y() - + aPasswordED.GetPosPixel().Y(); + lcl_Move( aSavePasswdBtn, nOffset ); + lcl_Move( aUseSysCredsCB, nOffset ); + lcl_Move( aButtonsFL, nOffset ); + lcl_Move( aOKBtn, nOffset ); + lcl_Move( aCancelBtn, nOffset ); + lcl_Move( aHelpBtn, nOffset ); + Size aNewSz = GetSizePixel(); aNewSz.Height() -= nOffset; SetSizePixel( aNewSz ); @@ -208,6 +189,10 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) { long nOffset = aUseSysCredsCB.GetPosPixel().Y() - aSavePasswdBtn.GetPosPixel().Y(); + lcl_Move( aButtonsFL, nOffset ); + lcl_Move( aOKBtn, nOffset ); + lcl_Move( aCancelBtn, nOffset ); + lcl_Move( aHelpBtn, nOffset ); Size aNewSz = GetSizePixel(); aNewSz.Height() -= nOffset; @@ -219,7 +204,7 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) void LoginDialog::EnableUseSysCredsControls_Impl( BOOL bUseSysCredsEnabled ) { aErrorInfo.Enable( !bUseSysCredsEnabled ); - aErrorGB.Enable( !bUseSysCredsEnabled ); + aErrorFT.Enable( !bUseSysCredsEnabled ); aRequestInfo.Enable( !bUseSysCredsEnabled ); aPathFT.Enable( !bUseSysCredsEnabled ); aPathED.Enable( !bUseSysCredsEnabled ); @@ -282,23 +267,25 @@ LoginDialog::LoginDialog ModalDialog( pParent, ResId( DLG_UUI_LOGIN, *pResMgr ) ), - aErrorInfo ( this, ResId( INFO_LOGIN_ERROR, *pResMgr ) ), - aErrorGB ( this, ResId( GB_LOGIN_ERROR, *pResMgr ) ), - aRequestInfo ( this, ResId( INFO_LOGIN_REQUEST, *pResMgr ) ), + aErrorFT ( this, ResId( FT_LOGIN_ERROR, *pResMgr ) ), + aErrorInfo ( this, ResId( FT_INFO_LOGIN_ERROR, *pResMgr ) ), + aLogin1FL ( this, ResId( FL_LOGIN_1, *pResMgr ) ), + aRequestInfo ( this, ResId( FT_INFO_LOGIN_REQUEST, *pResMgr ) ), + aLogin2FL ( this, ResId( FL_LOGIN_2, *pResMgr ) ), aPathFT ( this, ResId( FT_LOGIN_PATH, *pResMgr ) ), aPathED ( this, ResId( ED_LOGIN_PATH, *pResMgr ) ), - aPathInfo ( this, ResId( INFO_LOGIN_PATH, *pResMgr ) ), + aPathInfo ( this, ResId( FT_INFO_LOGIN_PATH, *pResMgr ) ), aPathBtn ( this, ResId( BTN_LOGIN_PATH, *pResMgr ) ), aNameFT ( this, ResId( FT_LOGIN_USERNAME, *pResMgr ) ), aNameED ( this, ResId( ED_LOGIN_USERNAME, *pResMgr ) ), - aNameInfo ( this, ResId( INFO_LOGIN_USERNAME, *pResMgr ) ), + aNameInfo ( this, ResId( FT_INFO_LOGIN_USERNAME, *pResMgr ) ), aPasswordFT ( this, ResId( FT_LOGIN_PASSWORD, *pResMgr ) ), aPasswordED ( this, ResId( ED_LOGIN_PASSWORD, *pResMgr ) ), aAccountFT ( this, ResId( FT_LOGIN_ACCOUNT, *pResMgr ) ), aAccountED ( this, ResId( ED_LOGIN_ACCOUNT, *pResMgr ) ), aSavePasswdBtn ( this, ResId( CB_LOGIN_SAVEPASSWORD, *pResMgr ) ), aUseSysCredsCB ( this, ResId( CB_LOGIN_USESYSCREDS, *pResMgr ) ), - aLoginGB ( this, ResId( GB_LOGIN_LOGIN, *pResMgr ) ), + aButtonsFL ( this, ResId( FL_BUTTONS, *pResMgr ) ), aOKBtn ( this, ResId( BTN_LOGIN_OK, *pResMgr ) ), aCancelBtn ( this, ResId( BTN_LOGIN_CANCEL, *pResMgr ) ), aHelpBtn ( this, ResId( BTN_LOGIN_HELP, *pResMgr ) ) @@ -333,6 +320,12 @@ LoginDialog::LoginDialog // ----------------------------------------------------------------------- +LoginDialog::~LoginDialog() +{ +} + +// ----------------------------------------------------------------------- + void LoginDialog::SetName( const String& rNewName ) { aNameED.SetText( rNewName ); diff --git a/uui/source/logindlg.hrc b/uui/source/logindlg.hrc old mode 100644 new mode 100755 index 68162fb620cd..b6e1f52444fd --- a/uui/source/logindlg.hrc +++ b/uui/source/logindlg.hrc @@ -30,24 +30,26 @@ //============================================================================ -#define INFO_LOGIN_ERROR 10 -#define GB_LOGIN_ERROR 11 +#define FT_INFO_LOGIN_ERROR 10 +#define FT_LOGIN_ERROR 11 -#define INFO_LOGIN_REQUEST 20 +#define FT_INFO_LOGIN_REQUEST 20 #define FT_LOGIN_PATH 21 #define ED_LOGIN_PATH 22 -#define INFO_LOGIN_PATH 23 +#define FT_INFO_LOGIN_PATH 23 #define BTN_LOGIN_PATH 24 #define FT_LOGIN_USERNAME 25 #define ED_LOGIN_USERNAME 26 -#define INFO_LOGIN_USERNAME 27 +#define FT_INFO_LOGIN_USERNAME 27 #define FT_LOGIN_PASSWORD 28 #define ED_LOGIN_PASSWORD 29 #define FT_LOGIN_ACCOUNT 30 #define ED_LOGIN_ACCOUNT 31 #define CB_LOGIN_SAVEPASSWORD 32 -#define GB_LOGIN_LOGIN 33 -#define CB_LOGIN_USESYSCREDS 34 +#define CB_LOGIN_USESYSCREDS 33 +#define FL_LOGIN_1 34 +#define FL_LOGIN_2 35 +#define FL_BUTTONS 36 #define BTN_LOGIN_OK 50 #define BTN_LOGIN_CANCEL 51 diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx old mode 100644 new mode 100755 index 0a4637d89251..04ea8eb7523d --- a/uui/source/logindlg.hxx +++ b/uui/source/logindlg.hxx @@ -53,9 +53,11 @@ //============================================================================ class LoginDialog : public ModalDialog { + FixedText aErrorFT; FixedInfo aErrorInfo; - FixedLine aErrorGB; + FixedLine aLogin1FL; FixedInfo aRequestInfo; + FixedLine aLogin2FL; FixedText aPathFT; Edit aPathED; FixedInfo aPathInfo; @@ -69,7 +71,7 @@ class LoginDialog : public ModalDialog Edit aAccountED; CheckBox aSavePasswdBtn; CheckBox aUseSysCredsCB; - FixedLine aLoginGB; + FixedLine aButtonsFL; OKButton aOKBtn; CancelButton aCancelBtn; HelpButton aHelpBtn; @@ -85,32 +87,23 @@ public: LoginDialog( Window* pParent, USHORT nFlags, const String& rServer, const String* pRealm, ResMgr * pResMgr ); + virtual ~LoginDialog(); - String GetPath() const { return aPathED.GetText(); } - void SetPath( const String& rNewPath ) - { aPathED.SetText( rNewPath ); - aPathInfo.SetText( rNewPath );} - String GetName() const { return aNameED.GetText(); } + String GetPath() const { return aPathED.GetText(); } + void SetPath( const String& rNewPath ) { aPathED.SetText( rNewPath ); aPathInfo.SetText( rNewPath ); } + String GetName() const { return aNameED.GetText(); } void SetName( const String& rNewName ); - String GetPassword() const { return aPasswordED.GetText(); } - void SetPassword( const String& rNew ) - { aPasswordED.SetText( rNew ); } - String GetAccount() const { return aAccountED.GetText(); } - void SetAccount( const String& rNew ) - { aAccountED.SetText( rNew ); } - BOOL IsSavePassword() const - { return aSavePasswdBtn.IsChecked(); } - void SetSavePassword( BOOL bSave ) - { aSavePasswdBtn.Check( bSave ); } - void SetSavePasswordText( const String& rTxt ) - { aSavePasswdBtn.SetText( rTxt ); } - BOOL IsUseSystemCredentials() const - { return aUseSysCredsCB.IsChecked(); } + String GetPassword() const { return aPasswordED.GetText(); } + void SetPassword( const String& rNew ) { aPasswordED.SetText( rNew ); } + String GetAccount() const { return aAccountED.GetText(); } + void SetAccount( const String& rNew ) { aAccountED.SetText( rNew ); } + BOOL IsSavePassword() const { return aSavePasswdBtn.IsChecked(); } + void SetSavePassword( BOOL bSave ) { aSavePasswdBtn.Check( bSave ); } + void SetSavePasswordText( const String& rTxt ) { aSavePasswdBtn.SetText( rTxt ); } + BOOL IsUseSystemCredentials() const { return aUseSysCredsCB.IsChecked(); } void SetUseSystemCredentials( BOOL bUse ); - void SetErrorText( const String& rTxt ) - { aErrorInfo.SetText( rTxt ); } - void SetLoginRequestText( const String& rTxt ) - { aRequestInfo.SetText( rTxt ); } + void SetErrorText( const String& rTxt ) { aErrorInfo.SetText( rTxt ); } + void SetLoginRequestText( const String& rTxt ) { aRequestInfo.SetText( rTxt ); } void ClearPassword(); void ClearAccount(); }; diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src old mode 100644 new mode 100755 index ce998f4945be..f997fb7b7f34 --- a/uui/source/logindlg.src +++ b/uui/source/logindlg.src @@ -16,7 +16,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). + *(a copy is included in the LICENSE file that accompanied this code). * * You should have received a copy of the GNU Lesser General Public License * version 3 along with OpenOffice.org. If not, see @@ -42,166 +42,161 @@ ModalDialog DLG_UUI_LOGIN Moveable = TRUE ; OutputSize = TRUE ; SVLook = TRUE ; - Size = MAP_APPFONT ( 265 , 170 ) ; - FixedText INFO_LOGIN_ERROR + Size = MAP_APPFONT( 177 , 247 ) ; + Text [ en-US ] = "Authentication Required" ; + + FixedText FT_LOGIN_ERROR + { + Pos = MAP_APPFONT( 6 , 6 ) ; + Size = MAP_APPFONT( 165 , 8 ) ; + Text [ en-US ] = "Message from server:" ; + }; + + FixedText FT_INFO_LOGIN_ERROR { - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 185 , 18 ) ; + Pos = MAP_APPFONT( 6 , 14 ) ; + Size = MAP_APPFONT( 185 , 3*8 ) ; WordBreak = TRUE ; }; - FixedLine GB_LOGIN_ERROR + + FixedLine FL_LOGIN_1 { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 197 , 8 ) ; - Text [ en-US ] = "Message from server" ; + Pos = MAP_APPFONT( 6 , 41 ) ; + Size = MAP_APPFONT( 165 , 8 ) ; }; - FixedText INFO_LOGIN_REQUEST + + FixedText FT_INFO_LOGIN_REQUEST { - Pos = MAP_APPFONT ( 12 , 55 ) ; - Size = MAP_APPFONT ( 185 , 18 ) ; + Pos = MAP_APPFONT( 6 , 52 ) ; + Size = MAP_APPFONT( 185 , 2*8 ) ; WordBreak = TRUE ; - Text [ en-US ] = "Enter the user name and password for %1 here." ; + Text [ en-US ] = "Enter user name and password for: \n%1" ; + }; + + String STR_LOGIN_REALM + { + Text [ en-US ] = "Enter user name and password for: \n\"%2\" on %1" ; + }; + + FixedLine FL_LOGIN_2 + { + Pos = MAP_APPFONT( 6 , 71 ) ; + Size = MAP_APPFONT( 165 , 8 ) ; }; + FixedText FT_LOGIN_PATH { - Pos = MAP_APPFONT ( 12 , 77 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; + Pos = MAP_APPFONT( 6 , 84 ) ; + Size = MAP_APPFONT( 112 , 8 ) ; Text [ en-US ] = "~Path" ; }; + Edit ED_LOGIN_PATH { Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 76 ) ; - Size = MAP_APPFONT ( 108 , 12 ) ; + Pos = MAP_APPFONT( 6 , 95 ) ; + Size = MAP_APPFONT( 112 , 12 ) ; }; - FixedText INFO_LOGIN_PATH + FixedText FT_INFO_LOGIN_PATH // used instead of ED_LOGIN_PATH when LF_PATH_READONLY is set { Hide = TRUE ; - Pos = MAP_APPFONT ( 72 , 77 ) ; - Size = MAP_APPFONT ( 125 , 10 ) ; + Pos = MAP_APPFONT( 6 , 97 ) ; + Size = MAP_APPFONT( 112 , 8 ) ; }; PushButton BTN_LOGIN_PATH { - Pos = MAP_APPFONT ( 183 , 75 ) ; - Size = MAP_APPFONT ( 14 , 14 ) ; - Text = "~..." ; + Pos = MAP_APPFONT( 121 , 94 ) ; + Size = MAP_APPFONT( 50 , 14 ) ; + Text = "~Browse..." ; }; + FixedText FT_LOGIN_USERNAME { - Pos = MAP_APPFONT ( 12 , 92 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; + Pos = MAP_APPFONT( 6 , 110 ) ; + Size = MAP_APPFONT( 106 , 8 ) ; Text [ en-US ] = "~User name" ; }; + Edit ED_LOGIN_USERNAME { Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 91 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; + Pos = MAP_APPFONT( 6 , 121 ) ; + Size = MAP_APPFONT( 165 , 12 ) ; }; - FixedText INFO_LOGIN_USERNAME + FixedText FT_INFO_LOGIN_USERNAME // used instead of ED_LOGIN_USERNAME when LF_USERNAME_READONLY is set { Hide = TRUE ; - Pos = MAP_APPFONT ( 72 , 92 ) ; - Size = MAP_APPFONT ( 125 , 10 ) ; + Pos = MAP_APPFONT( 6 , 123 ) ; + Size = MAP_APPFONT( 165 , 8 ) ; }; + FixedText FT_LOGIN_PASSWORD { - Pos = MAP_APPFONT ( 12 , 107 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; + Pos = MAP_APPFONT( 6 , 136 ) ; + Size = MAP_APPFONT( 165 , 8 ) ; Text [ en-US ] = "Pass~word" ; }; + Edit ED_LOGIN_PASSWORD { Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 106 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; + Pos = MAP_APPFONT( 6 , 147 ) ; + Size = MAP_APPFONT( 165 , 12 ) ; PassWord = TRUE ; }; + FixedText FT_LOGIN_ACCOUNT { - Pos = MAP_APPFONT ( 12 , 122 ) ; - Size = MAP_APPFONT ( 57 , 10 ) ; + Pos = MAP_APPFONT( 6 , 162 ) ; + Size = MAP_APPFONT( 165 , 8 ) ; Text [ en-US ] = "A~ccount"; }; + Edit ED_LOGIN_ACCOUNT { Border = TRUE ; - Pos = MAP_APPFONT ( 72 , 121 ) ; - Size = MAP_APPFONT ( 125 , 12 ) ; + Pos = MAP_APPFONT( 6 , 173 ) ; + Size = MAP_APPFONT( 165 , 12 ) ; PassWord = TRUE ; }; + CheckBox CB_LOGIN_SAVEPASSWORD { - Pos = MAP_APPFONT ( 12 , 136 ) ; - Size = MAP_APPFONT ( 185 , 10 ) ; - Text [ en-US ] = "~Save password" ; + Pos = MAP_APPFONT( 6 , 190 ) ; + Size = MAP_APPFONT( 165 , 10 ) ; + Text [ en-US ] = "~Remember password" ; }; + CheckBox CB_LOGIN_USESYSCREDS { - Pos = MAP_APPFONT ( 12 , 148 ) ; - Size = MAP_APPFONT ( 185 , 10 ) ; - Text [ en-US ] = "~Use System Credentials" ; + Pos = MAP_APPFONT( 6 , 203 ) ; + Size = MAP_APPFONT( 165 , 10 ) ; + Text [ en-US ] = "~Use system credentials" ; }; - FixedLine GB_LOGIN_LOGIN + + FixedLine FL_BUTTONS { - Pos = MAP_APPFONT ( 7 , 44 ) ; - Size = MAP_APPFONT ( 197 , 8 ) ; - Text [ en-US ] = "Log in" ; + Pos = MAP_APPFONT( 0 , 216 ) ; + Size = MAP_APPFONT( 177 , 8 ) ; }; + OKButton BTN_LOGIN_OK { - Pos = MAP_APPFONT ( 209 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT( 6 , 227 ) ; + Size = MAP_APPFONT( 50 , 14 ) ; DefButton = TRUE ; }; + CancelButton BTN_LOGIN_CANCEL { - Pos = MAP_APPFONT ( 209 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; + Pos = MAP_APPFONT( 66 , 227 ) ; + Size = MAP_APPFONT( 50 , 14 ) ; }; + HelpButton BTN_LOGIN_HELP { - Pos = MAP_APPFONT ( 209 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - }; - String STR_LOGIN_REALM - { - Text [ en-US ] = "Please enter user name and password for \"%2\" on %1 here." ; + Pos = MAP_APPFONT( 121 , 227 ) ; + Size = MAP_APPFONT( 50 , 14 ) ; }; - Text [ en-US ] = "User Name and Password Required" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- cgit From 3fa4688994df161df3742fcb75a54cc059276259 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 16 Mar 2010 11:35:19 +0100 Subject: cws tl79: #i110048# further changes to the LoginDialog --- uui/source/logindlg.cxx | 31 +++++++------------------------ uui/source/logindlg.hrc | 26 ++++++++++++-------------- uui/source/logindlg.hxx | 9 +++++---- uui/source/logindlg.src | 18 +++--------------- 4 files changed, 27 insertions(+), 57 deletions(-) (limited to 'uui') diff --git a/uui/source/logindlg.cxx b/uui/source/logindlg.cxx index 941c6c2558c8..d7ded58b5dde 100755 --- a/uui/source/logindlg.cxx +++ b/uui/source/logindlg.cxx @@ -57,10 +57,10 @@ static void lcl_Move( Window &rWin, long nOffset ) void LoginDialog::HideControls_Impl( USHORT nFlags ) { - FASTBOOL bPathHide = FALSE; - FASTBOOL bErrorHide = FALSE; - FASTBOOL bAccountHide = FALSE; - FASTBOOL bUseSysCredsHide = FALSE; + bool bPathHide = FALSE; + bool bErrorHide = FALSE; + bool bAccountHide = FALSE; + bool bUseSysCredsHide = FALSE; if ( ( nFlags & LF_NO_PATH ) == LF_NO_PATH ) { @@ -71,9 +71,8 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) } else if ( ( nFlags & LF_PATH_READONLY ) == LF_PATH_READONLY ) { - aPathED.Hide(); - aPathInfo.Show(); - aPathBtn.Hide(); + aPathED.Enable( FALSE ); + aPathBtn.Enable( FALSE ); } if ( ( nFlags & LF_NO_USERNAME ) == LF_NO_USERNAME ) @@ -83,8 +82,7 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) } else if ( ( nFlags & LF_USERNAME_READONLY ) == LF_USERNAME_READONLY ) { - aNameED.Hide(); - aNameInfo.Show(); + aNameED.Enable( FALSE ); } if ( ( nFlags & LF_NO_PASSWORD ) == LF_NO_PASSWORD ) @@ -125,11 +123,9 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) lcl_Move( aLogin2FL, nOffset ); lcl_Move( aPathFT, nOffset ); lcl_Move( aPathED, nOffset ); - lcl_Move( aPathInfo, nOffset ); lcl_Move( aPathBtn, nOffset ); lcl_Move( aNameFT, nOffset ); lcl_Move( aNameED, nOffset ); - lcl_Move( aNameInfo, nOffset ); lcl_Move( aPasswordFT, nOffset ); lcl_Move( aPasswordED, nOffset ); lcl_Move( aAccountFT, nOffset ); @@ -152,7 +148,6 @@ void LoginDialog::HideControls_Impl( USHORT nFlags ) aPathED.GetPosPixel().Y(); lcl_Move( aNameFT, nOffset ); lcl_Move( aNameED, nOffset ); - lcl_Move( aNameInfo, nOffset ); lcl_Move( aPasswordFT, nOffset ); lcl_Move( aPasswordED, nOffset ); lcl_Move( aAccountFT, nOffset ); @@ -208,11 +203,9 @@ void LoginDialog::EnableUseSysCredsControls_Impl( BOOL bUseSysCredsEnabled ) aRequestInfo.Enable( !bUseSysCredsEnabled ); aPathFT.Enable( !bUseSysCredsEnabled ); aPathED.Enable( !bUseSysCredsEnabled ); - aPathInfo.Enable( !bUseSysCredsEnabled ); aPathBtn.Enable( !bUseSysCredsEnabled ); aNameFT.Enable( !bUseSysCredsEnabled ); aNameED.Enable( !bUseSysCredsEnabled ); - aNameInfo.Enable( !bUseSysCredsEnabled ); aPasswordFT.Enable( !bUseSysCredsEnabled ); aPasswordED.Enable( !bUseSysCredsEnabled ); aAccountFT.Enable( !bUseSysCredsEnabled ); @@ -274,11 +267,9 @@ LoginDialog::LoginDialog aLogin2FL ( this, ResId( FL_LOGIN_2, *pResMgr ) ), aPathFT ( this, ResId( FT_LOGIN_PATH, *pResMgr ) ), aPathED ( this, ResId( ED_LOGIN_PATH, *pResMgr ) ), - aPathInfo ( this, ResId( FT_INFO_LOGIN_PATH, *pResMgr ) ), aPathBtn ( this, ResId( BTN_LOGIN_PATH, *pResMgr ) ), aNameFT ( this, ResId( FT_LOGIN_USERNAME, *pResMgr ) ), aNameED ( this, ResId( ED_LOGIN_USERNAME, *pResMgr ) ), - aNameInfo ( this, ResId( FT_INFO_LOGIN_USERNAME, *pResMgr ) ), aPasswordFT ( this, ResId( FT_LOGIN_PASSWORD, *pResMgr ) ), aPasswordED ( this, ResId( ED_LOGIN_PASSWORD, *pResMgr ) ), aAccountFT ( this, ResId( FT_LOGIN_ACCOUNT, *pResMgr ) ), @@ -326,14 +317,6 @@ LoginDialog::~LoginDialog() // ----------------------------------------------------------------------- -void LoginDialog::SetName( const String& rNewName ) -{ - aNameED.SetText( rNewName ); - aNameInfo.SetText( rNewName ); -} - -// ----------------------------------------------------------------------- - void LoginDialog::SetUseSystemCredentials( BOOL bUse ) { if ( aUseSysCredsCB.IsVisible() ) diff --git a/uui/source/logindlg.hrc b/uui/source/logindlg.hrc index b6e1f52444fd..b541740bd768 100755 --- a/uui/source/logindlg.hrc +++ b/uui/source/logindlg.hrc @@ -36,20 +36,18 @@ #define FT_INFO_LOGIN_REQUEST 20 #define FT_LOGIN_PATH 21 #define ED_LOGIN_PATH 22 -#define FT_INFO_LOGIN_PATH 23 -#define BTN_LOGIN_PATH 24 -#define FT_LOGIN_USERNAME 25 -#define ED_LOGIN_USERNAME 26 -#define FT_INFO_LOGIN_USERNAME 27 -#define FT_LOGIN_PASSWORD 28 -#define ED_LOGIN_PASSWORD 29 -#define FT_LOGIN_ACCOUNT 30 -#define ED_LOGIN_ACCOUNT 31 -#define CB_LOGIN_SAVEPASSWORD 32 -#define CB_LOGIN_USESYSCREDS 33 -#define FL_LOGIN_1 34 -#define FL_LOGIN_2 35 -#define FL_BUTTONS 36 +#define BTN_LOGIN_PATH 23 +#define FT_LOGIN_USERNAME 24 +#define ED_LOGIN_USERNAME 25 +#define FT_LOGIN_PASSWORD 26 +#define ED_LOGIN_PASSWORD 27 +#define FT_LOGIN_ACCOUNT 28 +#define ED_LOGIN_ACCOUNT 29 +#define CB_LOGIN_SAVEPASSWORD 30 +#define CB_LOGIN_USESYSCREDS 31 +#define FL_LOGIN_1 32 +#define FL_LOGIN_2 33 +#define FL_BUTTONS 34 #define BTN_LOGIN_OK 50 #define BTN_LOGIN_CANCEL 51 diff --git a/uui/source/logindlg.hxx b/uui/source/logindlg.hxx index 04ea8eb7523d..05ba8e8d55d4 100755 --- a/uui/source/logindlg.hxx +++ b/uui/source/logindlg.hxx @@ -60,11 +60,9 @@ class LoginDialog : public ModalDialog FixedLine aLogin2FL; FixedText aPathFT; Edit aPathED; - FixedInfo aPathInfo; PushButton aPathBtn; FixedText aNameFT; Edit aNameED; - FixedInfo aNameInfo; FixedText aPasswordFT; Edit aPasswordED; FixedText aAccountFT; @@ -90,9 +88,9 @@ public: virtual ~LoginDialog(); String GetPath() const { return aPathED.GetText(); } - void SetPath( const String& rNewPath ) { aPathED.SetText( rNewPath ); aPathInfo.SetText( rNewPath ); } + void SetPath( const String& rNewPath ) { aPathED.SetText( rNewPath ); } String GetName() const { return aNameED.GetText(); } - void SetName( const String& rNewName ); + void SetName( const String& rNewName ) { aNameED.SetText( rNewName ); } String GetPassword() const { return aPasswordED.GetText(); } void SetPassword( const String& rNew ) { aPasswordED.SetText( rNew ); } String GetAccount() const { return aAccountED.GetText(); } @@ -108,6 +106,9 @@ public: void ClearAccount(); }; +// ----------------------------------------------------------------------- + + //............................................................................ //............................................................................ diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src index f997fb7b7f34..c2683ea3d94c 100755 --- a/uui/source/logindlg.src +++ b/uui/source/logindlg.src @@ -55,7 +55,7 @@ ModalDialog DLG_UUI_LOGIN FixedText FT_INFO_LOGIN_ERROR { Pos = MAP_APPFONT( 6 , 14 ) ; - Size = MAP_APPFONT( 185 , 3*8 ) ; + Size = MAP_APPFONT( 165 , 3*8 ) ; WordBreak = TRUE ; }; @@ -68,7 +68,7 @@ ModalDialog DLG_UUI_LOGIN FixedText FT_INFO_LOGIN_REQUEST { Pos = MAP_APPFONT( 6 , 52 ) ; - Size = MAP_APPFONT( 185 , 2*8 ) ; + Size = MAP_APPFONT( 165 , 2*8 ) ; WordBreak = TRUE ; Text [ en-US ] = "Enter user name and password for: \n%1" ; }; @@ -97,12 +97,6 @@ ModalDialog DLG_UUI_LOGIN Pos = MAP_APPFONT( 6 , 95 ) ; Size = MAP_APPFONT( 112 , 12 ) ; }; - FixedText FT_INFO_LOGIN_PATH // used instead of ED_LOGIN_PATH when LF_PATH_READONLY is set - { - Hide = TRUE ; - Pos = MAP_APPFONT( 6 , 97 ) ; - Size = MAP_APPFONT( 112 , 8 ) ; - }; PushButton BTN_LOGIN_PATH { Pos = MAP_APPFONT( 121 , 94 ) ; @@ -113,7 +107,7 @@ ModalDialog DLG_UUI_LOGIN FixedText FT_LOGIN_USERNAME { Pos = MAP_APPFONT( 6 , 110 ) ; - Size = MAP_APPFONT( 106 , 8 ) ; + Size = MAP_APPFONT( 165 , 8 ) ; Text [ en-US ] = "~User name" ; }; @@ -123,12 +117,6 @@ ModalDialog DLG_UUI_LOGIN Pos = MAP_APPFONT( 6 , 121 ) ; Size = MAP_APPFONT( 165 , 12 ) ; }; - FixedText FT_INFO_LOGIN_USERNAME // used instead of ED_LOGIN_USERNAME when LF_USERNAME_READONLY is set - { - Hide = TRUE ; - Pos = MAP_APPFONT( 6 , 123 ) ; - Size = MAP_APPFONT( 165 , 8 ) ; - }; FixedText FT_LOGIN_PASSWORD { -- cgit From a84618d8076b877ca77c217d33aa7457ee95fc1b Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 17 Mar 2010 08:53:20 +0100 Subject: whitespace cleanup. --- uui/source/loginerr.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'uui') diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx index c8cbba96564b..14cce88e0534 100644 --- a/uui/source/loginerr.hxx +++ b/uui/source/loginerr.hxx @@ -32,10 +32,10 @@ //========================================================================= -#define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1 -#define LOGINERROR_FLAG_MODIFY_ACCOUNT 2 -#define LOGINERROR_FLAG_MODIFY_USER_NAME 4 -#define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8 +#define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1 +#define LOGINERROR_FLAG_MODIFY_ACCOUNT 2 +#define LOGINERROR_FLAG_MODIFY_USER_NAME 4 +#define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8 #define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16 #define LOGINERROR_FLAG_IS_USE_SYSCREDS 32 -- cgit From 52a1c736c09537fdf0de42c13100f2616c8305f1 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 18 Mar 2010 11:11:15 +0100 Subject: #i110213# - credentials handling improvements. --- uui/source/iahndl-authentication.cxx | 194 +++++++++++++++++++++++++---------- uui/source/loginerr.hxx | 55 ++++++---- uui/source/passwordcontainer.cxx | 13 ++- 3 files changed, 184 insertions(+), 78 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index f31397f1ef92..81f79c1b75e4 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -67,10 +67,9 @@ executeLoginDialog( { vos::OGuard aGuard(Application::GetSolarMutex()); - bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) - != 0; - bool bSavePassword = rInfo.GetIsPersistentPassword() - || rInfo.GetIsSavePassword(); + bool bAccount + = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) != 0; + bool bSavePassword = rInfo.GetCanRememberPassword(); bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials(); sal_uInt16 nFlags = 0; @@ -82,10 +81,8 @@ 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; @@ -109,12 +106,13 @@ executeLoginDialog( if (bSavePassword) { - xDialog-> - SetSavePasswordText(ResId(rInfo.GetIsPersistentPassword() ? - RID_SAVE_PASSWORD : - RID_KEEP_PASSWORD, - *xManager.get())); - xDialog->SetSavePassword(rInfo.GetIsSavePassword()); + xDialog->SetSavePasswordText( + ResId(rInfo.GetIsRememberPersistent() + ? RID_SAVE_PASSWORD + : RID_KEEP_PASSWORD, + *xManager.get())); + + xDialog->SetSavePassword(rInfo.GetIsRememberPassword()); } if ( bCanUseSysCreds ) @@ -126,7 +124,7 @@ executeLoginDialog( rInfo.SetUserName(xDialog->GetName()); rInfo.SetPassword(xDialog->GetPassword()); rInfo.SetAccount(xDialog->GetAccount()); - rInfo.SetSavePassword(xDialog->IsSavePassword()); + rInfo.SetIsRememberPassword(xDialog->IsSavePassword()); if ( bCanUseSysCreds ) rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() ); @@ -139,6 +137,61 @@ executeLoginDialog( } } +void +getRememberModes( + uno::Sequence< ucb::RememberAuthentication > const & rRememberModes, + ucb::RememberAuthentication & rPreferredMode, + ucb::RememberAuthentication & rAlternateMode ) +{ + sal_Int32 nCount = rRememberModes.getLength(); + OSL_ENSURE( (nCount > 0) && (nCount < 4), + "ucb::RememberAuthentication sequence size mismatch!" ); + if ( nCount == 1 ) + { + rPreferredMode = rAlternateMode = rRememberModes[ 0 ]; + return; + } + else + { + //bool bHasRememberModeNo = false; + bool bHasRememberModeSession = false; + bool bHasRememberModePersistent = false; + + for (sal_Int32 i = 0; i < nCount; ++i) + { + switch ( rRememberModes[i] ) + { + case ucb::RememberAuthentication_NO: + //bHasRememberModeNo = true; + break; + case ucb::RememberAuthentication_SESSION: + bHasRememberModeSession = true; + break; + case ucb::RememberAuthentication_PERSISTENT: + bHasRememberModePersistent = true; + break; + default: + OSL_TRACE( "Unsupported RememberAuthentication value" ); + break; + } + } + + if (bHasRememberModePersistent) + { + rPreferredMode = ucb::RememberAuthentication_PERSISTENT; + if (bHasRememberModeSession) + rAlternateMode = ucb::RememberAuthentication_SESSION; + else + rAlternateMode = ucb::RememberAuthentication_NO; + } + else + { + rPreferredMode = ucb::RememberAuthentication_SESSION; + rAlternateMode = ucb::RememberAuthentication_NO; + } + } +} + void handleAuthenticationRequest_( Window * pParent, @@ -161,7 +214,7 @@ handleAuthenticationRequest_( xSupplyAuthentication2.set(xSupplyAuthentication, uno::UNO_QUERY); ////////////////////////// - // First, try to obatin credentials from password container service. + // First, try to obtain credentials from password container service. uui::PasswordContainerHelper aPwContainerHelper(xServiceFactory); if (aPwContainerHelper.handleAuthenticationRequest(rRequest, xSupplyAuthentication, @@ -174,26 +227,20 @@ handleAuthenticationRequest_( ////////////////////////// // Second, try to obtain credentials from user via password dialog. - bool bRemember; - bool bRememberPersistent; + ucb::RememberAuthentication eDefaultRememberMode + = ucb::RememberAuthentication_SESSION; + ucb::RememberAuthentication ePreferredRememberMode + = eDefaultRememberMode; + ucb::RememberAuthentication eAlternateRememberMode + = ucb::RememberAuthentication_NO; + if (xSupplyAuthentication.is()) { - ucb::RememberAuthentication eDefault; - uno::Sequence< ucb::RememberAuthentication > - aModes(xSupplyAuthentication->getRememberPasswordModes(eDefault)); - bRemember = eDefault != ucb::RememberAuthentication_NO; - bRememberPersistent = false; - for (sal_Int32 i = 0; i < aModes.getLength(); ++i) - if (aModes[i] == ucb::RememberAuthentication_PERSISTENT) - { - bRememberPersistent = true; - break; - } - } - else - { - bRemember = false; - bRememberPersistent = false; + getRememberModes( + xSupplyAuthentication->getRememberPasswordModes( + eDefaultRememberMode), + ePreferredRememberMode, + eAlternateRememberMode); } sal_Bool bCanUseSystemCredentials; @@ -220,10 +267,16 @@ handleAuthenticationRequest_( if (rRequest.HasPassword) aInfo.SetPassword(rRequest.Password); aInfo.SetErrorText(rRequest.Diagnostic); - aInfo.SetPersistentPassword(bRememberPersistent); - aInfo.SetSavePassword(bRemember); + + aInfo.SetCanRememberPassword( + ePreferredRememberMode != eAlternateRememberMode); + aInfo.SetIsRememberPassword( + eDefaultRememberMode != ucb::RememberAuthentication_NO); + aInfo.SetIsRememberPersistent( + ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT); + aInfo.SetCanUseSystemCredentials(bCanUseSystemCredentials); - aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials ); + aInfo.SetIsUseSystemCredentials(bDefaultUseSystemCredentials); aInfo.SetModifyAccount(rRequest.HasAccount && xSupplyAuthentication.is() && xSupplyAuthentication->canSetAccount()); @@ -242,13 +295,24 @@ handleAuthenticationRequest_( xSupplyAuthentication->setUserName(aInfo.GetUserName()); if (xSupplyAuthentication->canSetPassword()) xSupplyAuthentication->setPassword(aInfo.GetPassword()); - xSupplyAuthentication-> - setRememberPassword( - aInfo.GetIsSavePassword() ? - bRememberPersistent ? - ucb::RememberAuthentication_PERSISTENT : - ucb::RememberAuthentication_SESSION : - ucb::RememberAuthentication_NO); + + if (ePreferredRememberMode != eAlternateRememberMode) + { + // user had te choice. + if (aInfo.GetIsRememberPassword()) + xSupplyAuthentication->setRememberPassword( + ePreferredRememberMode); + else + xSupplyAuthentication->setRememberPassword( + eAlternateRememberMode); + } + else + { + // user had no choice. + xSupplyAuthentication->setRememberPassword( + ePreferredRememberMode); + } + if (rRequest.HasRealm) { if (xSupplyAuthentication->canSetRealm()) @@ -267,22 +331,31 @@ handleAuthenticationRequest_( ////////////////////////// // Third, store credentials in password container. - if ( aInfo.GetIsUseSystemCredentials() ) + if (aInfo.GetIsUseSystemCredentials()) { - if (aInfo.GetIsSavePassword()) + if (aInfo.GetIsRememberPassword() || + (eAlternateRememberMode == ucb::RememberAuthentication_SESSION)) { - aPwContainerHelper.addRecord( - rURL.getLength() ? rURL : rRequest.ServerName, - rtl::OUString(), // empty u/p -> sys creds - uno::Sequence< rtl::OUString >(), - xIH, - bRememberPersistent); + 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.GetIsSavePassword()) + if (aInfo.GetIsRememberPassword() || + (eAlternateRememberMode == ucb::RememberAuthentication_SESSION)) { uno::Sequence< rtl::OUString > aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); @@ -290,12 +363,19 @@ handleAuthenticationRequest_( if (aInfo.GetAccount().Len() != 0) aPassList[1] = aInfo.GetAccount(); - aPwContainerHelper.addRecord( - rURL.getLength() ? rURL : rRequest.ServerName, - aInfo.GetUserName(), - aPassList, - xIH, - bRememberPersistent); + 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; diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx index 14cce88e0534..d713fbafa053 100644 --- a/uui/source/loginerr.hxx +++ b/uui/source/loginerr.hxx @@ -32,12 +32,13 @@ //========================================================================= -#define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1 -#define LOGINERROR_FLAG_MODIFY_ACCOUNT 2 -#define LOGINERROR_FLAG_MODIFY_USER_NAME 4 -#define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8 -#define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16 -#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32 +#define LOGINERROR_FLAG_MODIFY_ACCOUNT 1 +#define LOGINERROR_FLAG_MODIFY_USER_NAME 2 +#define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4 +#define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8 +#define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16 +#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32 +#define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64 class LoginErrorInfo { @@ -56,8 +57,7 @@ public: LoginErrorInfo() : _nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME ), _nRet( ERRCODE_BUTTON_CANCEL ) - { - } + {} const String& GetTitle() const { return _aTitle; } const String& GetServer() const { return _aServer; } @@ -66,10 +66,14 @@ public: const String& GetPassword() const { return _aPassword; } const String& GetPath() const { return _aPath; } const String& GetErrorText() const { return _aErrorText; } - BOOL GetIsPersistentPassword() const - { return ( _nFlags & LOGINERROR_FLAG_PERSISTENT_PASSWORD ); } - BOOL GetIsSavePassword() const - { return ( _nFlags & LOGINERROR_FLAG_SET_SAVE_PASSWORD ); } + + BOOL GetCanRememberPassword() const + { return ( _nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); } + BOOL GetIsRememberPersistent() const + { return ( _nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); } + BOOL GetIsRememberPassword() const + { return ( _nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); } + BOOL GetCanUseSystemCredentials() const { return ( _nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); } BOOL GetIsUseSystemCredentials() const @@ -94,8 +98,11 @@ public: { _aErrorText = aErrorText; } void SetFlags( BYTE nFlags ) { _nFlags = nFlags; } - inline void SetSavePassword( BOOL bSet ); - inline void SetPersistentPassword( BOOL bSet ); + + inline void SetCanRememberPassword( BOOL bSet ); + inline void SetIsRememberPassword( BOOL bSet ); + inline void SetIsRememberPersistent( BOOL bSet ); + inline void SetCanUseSystemCredentials( BOOL bSet ); inline void SetIsUseSystemCredentials( BOOL bSet ); inline void SetModifyAccount( BOOL bSet ); @@ -104,20 +111,28 @@ public: { _nRet = nRet; } }; -inline void LoginErrorInfo::SetSavePassword( BOOL bSet ) +inline void LoginErrorInfo::SetCanRememberPassword( BOOL bSet ) +{ + if ( bSet ) + _nFlags |= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD; + else + _nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD; +} + +inline void LoginErrorInfo::SetIsRememberPassword( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_SET_SAVE_PASSWORD; + _nFlags |= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD; else - _nFlags &= ~LOGINERROR_FLAG_SET_SAVE_PASSWORD; + _nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD; } -inline void LoginErrorInfo::SetPersistentPassword( BOOL bSet ) +inline void LoginErrorInfo::SetIsRememberPersistent( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_PERSISTENT_PASSWORD; + _nFlags |= LOGINERROR_FLAG_REMEMBER_PERSISTENT; else - _nFlags &= ~LOGINERROR_FLAG_PERSISTENT_PASSWORD; + _nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT; } inline void LoginErrorInfo::SetCanUseSystemCredentials( BOOL bSet ) diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx index 26d22b320d8a..0a056289c29d 100644 --- a/uui/source/passwordcontainer.cxx +++ b/uui/source/passwordcontainer.cxx @@ -30,6 +30,7 @@ #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/task/NoMasterException.hpp" #include "com/sun/star/task/XInteractionHandler.hpp" +#include "com/sun/star/task/XMasterPasswordHandling.hpp" #include "com/sun/star/task/XPasswordContainer.hpp" #include "com/sun/star/task/XUrlContainer.hpp" #include "com/sun/star/ucb/AuthenticationRequest.hpp" @@ -271,10 +272,20 @@ bool PasswordContainerHelper::addRecord( return false; if ( bPersist ) + { + uno::Reference< task::XMasterPasswordHandling > xMPH( + m_xPasswordContainer, uno::UNO_QUERY_THROW ); + + // If persistent storing of passwords is not yet + // allowed, enable it. + if ( !xMPH->isPersistentStoringAllowed() ) + xMPH->allowPersistentStoring( sal_True ); + m_xPasswordContainer->addPersistent( rURL, rUsername, rPasswords, xIH ); + } else m_xPasswordContainer->add( rURL, rUsername, @@ -429,7 +440,7 @@ PasswordContainerInteractionHandler::handle( // @@@ FIXME: this not able to // handle master pw request! // master pw request is never - // solvabe without UI! + // solvable without UI! this ) ) { // successfully handled -- cgit From d30937f3ef1f1c8c2f38d0923ab30607c0aceb7f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 9 Apr 2010 11:05:09 +0200 Subject: slidecopy: separate resource ID number circles for svl and svtools (thanks to MBA for the patch) --- uui/source/iahndl-errorhandler.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'uui') diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index ed8fd2118184..6e385372339c 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -40,7 +40,7 @@ #include "com/sun/star/task/XInteractionRetry.hpp" #include "tools/errinf.hxx" // ErrorHandler, ErrorContext, ... -#include "svl/svtools.hrc" // RID_ERRHDL +#include "svtools/svtools.hrc" // RID_ERRHDL #include "ids.hrc" #include "getcontinuations.hxx" -- cgit From e0986b3290e9c73116d86f9ae3b8e35f94aadc2b Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Thu, 22 Apr 2010 12:51:04 +0200 Subject: tl78: #i110383# password to modify support --- uui/source/iahndl-authentication.cxx | 21 +++++- uui/source/loginerr.hxx | 142 +++++++++++++++++------------------ 2 files changed, 86 insertions(+), 77 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 51556e88bb0f..7103fee29510 100755 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -32,6 +32,7 @@ #include "com/sun/star/task/MasterPasswordRequest.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" #include "com/sun/star/task/XInteractionPassword.hpp" +#include "com/sun/star/task/XInteractionPassword2.hpp" #include "com/sun/star/task/XInteractionRetry.hpp" #include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp" #include "com/sun/star/ucb/URLAuthenticationRequest.hpp" @@ -431,7 +432,7 @@ executePasswordDialog( pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen ) ); rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); - rInfo.SetPasswordToOpen( pDialog->GetPasswordToOpen() ); + rInfo.SetPassword( pDialog->GetPasswordToOpen() ); rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() ); rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() ); } @@ -441,7 +442,7 @@ executePasswordDialog( new PasswordDialog( pParent, nMode, xManager.get(), aDocName, bIsPasswordToModify ) ); rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); - rInfo.SetPasswordToOpen( bIsPasswordToModify ? String() : pDialog->GetPassword() ); + rInfo.SetPassword( bIsPasswordToModify ? String() : pDialog->GetPassword() ); rInfo.SetPasswordToModify( bIsPasswordToModify ? pDialog->GetPassword() : String() ); } } @@ -467,7 +468,12 @@ handlePasswordRequest_( uno::Reference< task::XInteractionRetry > xRetry; uno::Reference< task::XInteractionAbort > xAbort; uno::Reference< task::XInteractionPassword > xPassword; - getContinuations(rContinuations, &xRetry, &xAbort, &xPassword); + uno::Reference< task::XInteractionPassword2 > xPassword2; + getContinuations(rContinuations, &xRetry, &xAbort, &xPassword2, &xPassword); + + if ( xPassword2.is() && !xPassword.is() ) + xPassword.set( xPassword2, uno::UNO_QUERY_THROW ); + LoginErrorInfo aInfo; executePasswordDialog( pParent, aInfo, nMode, @@ -476,8 +482,15 @@ handlePasswordRequest_( switch (aInfo.GetResult()) { case ERRCODE_BUTTON_OK: + OSL_ENSURE( !bIsPasswordToModify || xPassword2.is(), "PasswordToModify is requested, but there is no Interaction!" ); if (xPassword.is()) { + if (xPassword2.is()) + { + xPassword2->setPasswordToModify( aInfo.GetPasswordToModify() ); + xPassword2->setRecommendReadOnly( aInfo.IsRecommendToOpenReadonly() ); + } + xPassword->setPassword(aInfo.GetPassword()); xPassword->select(); } @@ -593,7 +606,7 @@ UUIInteractionHelper::handlePasswordRequest( nMode = aDocumentMSPasswordRequest2.Mode; aDocumentName = aDocumentMSPasswordRequest2.Name; bMSCryptoMode = true; - bIsPasswordToModify = aDocumentPasswordRequest2.IsRequestPasswordToModify; + bIsPasswordToModify = aDocumentMSPasswordRequest2.IsRequestPasswordToModify; bDoHandleRequest = true; } diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx index d16e1a541710..2e0009900d86 100755 --- a/uui/source/loginerr.hxx +++ b/uui/source/loginerr.hxx @@ -25,143 +25,139 @@ * ************************************************************************/ -#ifndef _LOGINERR_HXX -#define _LOGINERR_HXX +#ifndef m_LOGINERR_HXX +#define m_LOGINERR_HXX #include //========================================================================= -#define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1 -#define LOGINERROR_FLAG_MODIFY_ACCOUNT 2 +#define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1 +#define LOGINERROR_FLAG_MODIFY_ACCOUNT 2 #define LOGINERROR_FLAG_MODIFY_USER_NAME 4 -#define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8 +#define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8 #define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16 -#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32 +#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32 class LoginErrorInfo { private: - String _aTitle; - String _aServer; - String _aAccount; - String _aUserName; - String _aPassword; - String _aPasswordToOpen; - String _aPasswordToModify; - String _aPath; - String _aErrorText; - BYTE _nFlags; - USHORT _nRet; - bool _bRecommendToOpenReadonly; + String m_aTitle; + String m_aServer; + String m_aAccount; + String m_aUserName; + String m_aPassword; + String m_aPasswordToModify; + String m_aPath; + String m_aErrorText; + BYTE m_nFlags; + USHORT m_nRet; + bool m_bRecommendToOpenReadonly; public: LoginErrorInfo() - : _nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME ), - _nRet( ERRCODE_BUTTON_CANCEL ) + : m_nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME ), + m_nRet( ERRCODE_BUTTON_CANCEL ) { } - const String& GetTitle() const { return _aTitle; } - const String& GetServer() const { return _aServer; } - const String& GetAccount() const { return _aAccount; } - const String& GetUserName() const { return _aUserName; } - const String& GetPassword() const { return _aPassword; } - const String& GetPasswordToOpen() const { return _aPasswordToOpen; } - const String& GetPasswordToModify() const { return _aPasswordToModify; } - const bool IsRecommendToOpenReadonly() const { return _bRecommendToOpenReadonly; } - const String& GetPath() const { return _aPath; } - const String& GetErrorText() const { return _aErrorText; } - BOOL GetIsPersistentPassword() const - { return ( _nFlags & LOGINERROR_FLAG_PERSISTENT_PASSWORD ); } - BOOL GetIsSavePassword() const - { return ( _nFlags & LOGINERROR_FLAG_SET_SAVE_PASSWORD ); } + const String& GetTitle() const { return m_aTitle; } + const String& GetServer() const { return m_aServer; } + const String& GetAccount() const { return m_aAccount; } + const String& GetUserName() const { return m_aUserName; } + const String& GetPassword() const { return m_aPassword; } + const String& GetPasswordToModify() const { return m_aPasswordToModify; } + const bool IsRecommendToOpenReadonly() const { return m_bRecommendToOpenReadonly; } + const String& GetPath() const { return m_aPath; } + const String& GetErrorText() const { return m_aErrorText; } + BOOL GetIsPersistentPassword() const + { return ( m_nFlags & LOGINERROR_FLAG_PERSISTENT_PASSWORD ); } + BOOL GetIsSavePassword() const + { return ( m_nFlags & LOGINERROR_FLAG_SET_SAVE_PASSWORD ); } BOOL GetCanUseSystemCredentials() const - { return ( _nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); } + { return ( m_nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); } BOOL GetIsUseSystemCredentials() const - { return ( _nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) == + { return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) == LOGINERROR_FLAG_IS_USE_SYSCREDS; } - BYTE GetFlags() const { return _nFlags; } - USHORT GetResult() const { return _nRet; } + BYTE GetFlags() const { return m_nFlags; } + USHORT GetResult() const { return m_nRet; } - void SetTitle( const String& aTitle ) - { _aTitle = aTitle; } - void SetServer( const String& aServer ) - { _aServer = aServer; } - void SetAccount( const String& aAccount ) - { _aAccount = aAccount; } - void SetUserName( const String& aUserName ) - { _aUserName = aUserName; } + void SetTitle( const String& aTitle ) + { m_aTitle = aTitle; } + void SetServer( const String& aServer ) + { m_aServer = aServer; } + void SetAccount( const String& aAccount ) + { m_aAccount = aAccount; } + void SetUserName( const String& aUserName ) + { m_aUserName = aUserName; } void SetPassword( const String& aPassword ) - { _aPassword = aPassword; } - void SetPasswordToOpen( const String& aPassword ) - { _aPasswordToOpen = aPassword; } + { m_aPassword = aPassword; } void SetPasswordToModify( const String& aPassword ) - { _aPasswordToModify = aPassword; } + { m_aPasswordToModify = aPassword; } void SetRecommendToOpenReadonly( bool bVal ) - { _bRecommendToOpenReadonly = bVal; } - void SetPath( const String& aPath ) - { _aPath = aPath; } - void SetErrorText( const String& aErrorText ) - { _aErrorText = aErrorText; } + { m_bRecommendToOpenReadonly = bVal; } + void SetPath( const String& aPath ) + { m_aPath = aPath; } + void SetErrorText( const String& aErrorText ) + { m_aErrorText = aErrorText; } void SetFlags( BYTE nFlags ) - { _nFlags = nFlags; } - inline void SetSavePassword( BOOL bSet ); - inline void SetPersistentPassword( BOOL bSet ); + { m_nFlags = nFlags; } + inline void SetSavePassword( BOOL bSet ); + inline void SetPersistentPassword( BOOL bSet ); inline void SetCanUseSystemCredentials( BOOL bSet ); inline void SetIsUseSystemCredentials( BOOL bSet ); - inline void SetModifyAccount( BOOL bSet ); - inline void SetModifyUserName( BOOL bSet ); + inline void SetModifyAccount( BOOL bSet ); + inline void SetModifyUserName( BOOL bSet ); void SetResult( USHORT nRet ) - { _nRet = nRet; } + { m_nRet = nRet; } }; inline void LoginErrorInfo::SetSavePassword( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_SET_SAVE_PASSWORD; + m_nFlags |= LOGINERROR_FLAG_SET_SAVE_PASSWORD; else - _nFlags &= ~LOGINERROR_FLAG_SET_SAVE_PASSWORD; + m_nFlags &= ~LOGINERROR_FLAG_SET_SAVE_PASSWORD; } inline void LoginErrorInfo::SetPersistentPassword( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_PERSISTENT_PASSWORD; + m_nFlags |= LOGINERROR_FLAG_PERSISTENT_PASSWORD; else - _nFlags &= ~LOGINERROR_FLAG_PERSISTENT_PASSWORD; + m_nFlags &= ~LOGINERROR_FLAG_PERSISTENT_PASSWORD; } inline void LoginErrorInfo::SetCanUseSystemCredentials( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS; + m_nFlags |= LOGINERROR_FLAG_CAN_USE_SYSCREDS; else - _nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS; + m_nFlags &= ~LOGINERROR_FLAG_CAN_USE_SYSCREDS; } inline void LoginErrorInfo::SetIsUseSystemCredentials( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS; + m_nFlags |= LOGINERROR_FLAG_IS_USE_SYSCREDS; else - _nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS; + m_nFlags &= ~LOGINERROR_FLAG_IS_USE_SYSCREDS; } inline void LoginErrorInfo::SetModifyAccount( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT; + m_nFlags |= LOGINERROR_FLAG_MODIFY_ACCOUNT; else - _nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT; + m_nFlags &= ~LOGINERROR_FLAG_MODIFY_ACCOUNT; } inline void LoginErrorInfo::SetModifyUserName( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME; + m_nFlags |= LOGINERROR_FLAG_MODIFY_USER_NAME; else - _nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME; + m_nFlags &= ~LOGINERROR_FLAG_MODIFY_USER_NAME; } #endif -- cgit From 6ebe363ce2eb75b496deb153fe00e7ce2a753b6a Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Tue, 27 Apr 2010 12:03:43 +0200 Subject: dv12#i29340# activated handleNameClashResolveRequest --- uui/source/iahndl.cxx | 15 +++++++-------- uui/source/iahndl.hxx | 3 --- 2 files changed, 7 insertions(+), 11 deletions(-) mode change 100644 => 100755 uui/source/iahndl.hxx (limited to 'uui') diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index e883bd60848d..905faab4051a 100755 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -867,14 +867,13 @@ UUIInteractionHelper::handleRequest_impl( if ( handleCertificateValidationRequest( rRequest ) ) return true; -// @@@ Todo #i29340#: activate! -// ucb::NameClashResolveRequest aNameClashResolveRequest; -// if (aAnyRequest >>= aNameClashResolveRequest) -// { -// handleNameClashResolveRequest(aNameClashResolveRequest, -// rRequest->getContinuations()); -// return true; -// } + ucb::NameClashResolveRequest aNameClashResolveRequest; + if (aAnyRequest >>= aNameClashResolveRequest) + { + handleNameClashResolveRequest(aNameClashResolveRequest, + rRequest->getContinuations()); + return true; + } if ( handleMasterPasswordRequest( rRequest ) ) return true; diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx old mode 100644 new mode 100755 index 42935565a314..6402653d3bda --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -215,8 +215,6 @@ private: com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); -// @@@ Todo #i29340#: activate! -#if 0 void handleNameClashResolveRequest( com::sun::star::ucb::NameClashResolveRequest const & rRequest, @@ -261,7 +259,6 @@ private: com::sun::star::uno::Reference< com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); -#endif void handleErrorHandlerRequest( -- cgit From ececcc290b431ca40b785afbffa1f3c2396a1bbb Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 28 Apr 2010 14:22:16 +0200 Subject: pdfextfix03: #i110871# PasswordRequest should still be supported for backwards compatibility --- uui/source/iahndl-authentication.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index f31397f1ef92..db6437322e0a 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -581,5 +581,17 @@ UUIInteractionHelper::handlePasswordRequest( true /* bool bMSCryptoMode */); return true; } + + task::PasswordRequest aPasswordRequest; + if( aAnyRequest >>= aPasswordRequest ) + { + handlePasswordRequest_(getParentProperty(), + aPasswordRequest.Mode, + rRequest->getContinuations(), + rtl::OUString(), + false /* bool bMSCryptoMode */); + return true; + } + return false; } -- cgit From 2005bc7b8b04f6eaa3d4636a3a1df1d6ff02f550 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 3 May 2010 09:08:38 +0200 Subject: cws tl78: build issues after merging with DEV300_m77 --- uui/prj/build.lst | 2 +- uui/source/iahndl-authentication.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'uui') diff --git a/uui/prj/build.lst b/uui/prj/build.lst index 0ebacfcb814f..dbe31cb1b57e 100644 --- a/uui/prj/build.lst +++ b/uui/prj/build.lst @@ -1,4 +1,4 @@ -uu uui : l10n svtools NULL +uu uui : l10n vcl svtools NULL uu uui usr1 - all uu_mkout NULL uu uui\source nmake - all uu_source NULL uu uui\util nmake - all uu_util uu_source NULL diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 7103fee29510..a84b1442a4ce 100755 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -428,8 +428,8 @@ executePasswordDialog( const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create(); - std::auto_ptr< AbstractPasswordToOpenModifyDialog > pDialog( - pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen ) ); + AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen ); + std::auto_ptr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp ); rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); rInfo.SetPassword( pDialog->GetPasswordToOpen() ); -- cgit From bd883027c74030e4bc4f038bdcab091723246360 Mon Sep 17 00:00:00 2001 From: Dirk Voelzke Date: Thu, 6 May 2010 11:04:08 +0200 Subject: dv12#i106373# applied patch to remove unused code --- uui/source/iahndl.cxx | 11 +++++++++-- uui/source/iahndl.hxx | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 905faab4051a..0879e3574da3 100755 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -867,6 +867,8 @@ UUIInteractionHelper::handleRequest_impl( if ( handleCertificateValidationRequest( rRequest ) ) return true; +// @@@ Todo #i29340#: activate! +#if 0 ucb::NameClashResolveRequest aNameClashResolveRequest; if (aAnyRequest >>= aNameClashResolveRequest) { @@ -874,7 +876,7 @@ UUIInteractionHelper::handleRequest_impl( rRequest->getContinuations()); return true; } - +#endif if ( handleMasterPasswordRequest( rRequest ) ) return true; @@ -1186,6 +1188,8 @@ executeMessageBox( return aResult; } +// @@@ Todo #i29340#: activate! +#if 0 enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE }; NameClashResolveDialogResult @@ -1213,9 +1217,11 @@ executeSimpleNameClashResolveDialog( "executeSimpleNameClashResolveDialog not yet implemented!" ); return ABORT; } - +#endif } // namespace +// @@@ Todo #i29340#: activate! +#if 0 void UUIInteractionHelper::handleNameClashResolveRequest( ucb::NameClashResolveRequest const & rRequest, @@ -1283,6 +1289,7 @@ UUIInteractionHelper::handleNameClashResolveRequest( break; } } +#endif void UUIInteractionHelper::handleGenericErrorRequest( diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 6402653d3bda..581099462845 100755 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -215,6 +215,8 @@ private: com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); +// @@@ Todo #i29340#: activate! +#if 0 void handleNameClashResolveRequest( com::sun::star::ucb::NameClashResolveRequest const & rRequest, @@ -223,6 +225,7 @@ private: com::sun::star::task::XInteractionContinuation > > const & rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); +#endif bool handleMasterPasswordRequest( -- cgit From e4307a4d3fc43914c8d28157c0e71633843fa045 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 6 May 2010 14:23:16 +0200 Subject: #i110213# - setup master password container on demand. --- uui/source/iahndl-authentication.cxx | 245 +++++++++++++++++++++++++---------- uui/source/loginerr.hxx | 61 +++++---- uui/source/passwordcontainer.cxx | 13 +- 3 files changed, 224 insertions(+), 95 deletions(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index f31397f1ef92..4183b852735e 100644 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -67,10 +67,9 @@ executeLoginDialog( { vos::OGuard aGuard(Application::GetSolarMutex()); - bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) - != 0; - bool bSavePassword = rInfo.GetIsPersistentPassword() - || rInfo.GetIsSavePassword(); + bool bAccount + = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) != 0; + bool bSavePassword = rInfo.GetCanRememberPassword(); bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials(); sal_uInt16 nFlags = 0; @@ -109,12 +108,13 @@ executeLoginDialog( if (bSavePassword) { - xDialog-> - SetSavePasswordText(ResId(rInfo.GetIsPersistentPassword() ? - RID_SAVE_PASSWORD : - RID_KEEP_PASSWORD, - *xManager.get())); - xDialog->SetSavePassword(rInfo.GetIsSavePassword()); + xDialog->SetSavePasswordText( + ResId(rInfo.GetIsRememberPersistent() + ? RID_SAVE_PASSWORD + : RID_KEEP_PASSWORD, + *xManager.get())); + + xDialog->SetSavePassword(rInfo.GetIsRememberPassword()); } if ( bCanUseSysCreds ) @@ -126,7 +126,7 @@ executeLoginDialog( rInfo.SetUserName(xDialog->GetName()); rInfo.SetPassword(xDialog->GetPassword()); rInfo.SetAccount(xDialog->GetAccount()); - rInfo.SetSavePassword(xDialog->IsSavePassword()); + rInfo.SetIsRememberPassword(xDialog->IsSavePassword()); if ( bCanUseSysCreds ) rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() ); @@ -139,6 +139,60 @@ executeLoginDialog( } } +void getRememberModes( + uno::Sequence< ucb::RememberAuthentication > const & rRememberModes, + ucb::RememberAuthentication & rPreferredMode, + ucb::RememberAuthentication & rAlternateMode ) +{ + sal_Int32 nCount = rRememberModes.getLength(); + OSL_ENSURE( (nCount > 0) && (nCount < 4), + "ucb::RememberAuthentication sequence size mismatch!" ); + if ( nCount == 1 ) + { + rPreferredMode = rAlternateMode = rRememberModes[ 0 ]; + return; + } + else + { + //bool bHasRememberModeNo = false; + bool bHasRememberModeSession = false; + bool bHasRememberModePersistent = false; + + for (sal_Int32 i = 0; i < nCount; ++i) + { + switch ( rRememberModes[i] ) + { + case ucb::RememberAuthentication_NO: + //bHasRememberModeNo = true; + break; + case ucb::RememberAuthentication_SESSION: + bHasRememberModeSession = true; + break; + case ucb::RememberAuthentication_PERSISTENT: + bHasRememberModePersistent = true; + break; + default: + OSL_TRACE( "Unsupported RememberAuthentication value" ); + break; + } + } + + if (bHasRememberModePersistent) + { + rPreferredMode = ucb::RememberAuthentication_PERSISTENT; + if (bHasRememberModeSession) + rAlternateMode = ucb::RememberAuthentication_SESSION; + else + rAlternateMode = ucb::RememberAuthentication_NO; + } + else + { + rPreferredMode = ucb::RememberAuthentication_SESSION; + rAlternateMode = ucb::RememberAuthentication_NO; + } + } +} + void handleAuthenticationRequest_( Window * pParent, @@ -161,7 +215,7 @@ handleAuthenticationRequest_( xSupplyAuthentication2.set(xSupplyAuthentication, uno::UNO_QUERY); ////////////////////////// - // First, try to obatin credentials from password container service. + // First, try to obtain credentials from password container service. uui::PasswordContainerHelper aPwContainerHelper(xServiceFactory); if (aPwContainerHelper.handleAuthenticationRequest(rRequest, xSupplyAuthentication, @@ -174,26 +228,20 @@ handleAuthenticationRequest_( ////////////////////////// // Second, try to obtain credentials from user via password dialog. - bool bRemember; - bool bRememberPersistent; + ucb::RememberAuthentication eDefaultRememberMode + = ucb::RememberAuthentication_SESSION; + ucb::RememberAuthentication ePreferredRememberMode + = eDefaultRememberMode; + ucb::RememberAuthentication eAlternateRememberMode + = ucb::RememberAuthentication_NO; + if (xSupplyAuthentication.is()) { - ucb::RememberAuthentication eDefault; - uno::Sequence< ucb::RememberAuthentication > - aModes(xSupplyAuthentication->getRememberPasswordModes(eDefault)); - bRemember = eDefault != ucb::RememberAuthentication_NO; - bRememberPersistent = false; - for (sal_Int32 i = 0; i < aModes.getLength(); ++i) - if (aModes[i] == ucb::RememberAuthentication_PERSISTENT) - { - bRememberPersistent = true; - break; - } - } - else - { - bRemember = false; - bRememberPersistent = false; + getRememberModes( + xSupplyAuthentication->getRememberPasswordModes( + eDefaultRememberMode), + ePreferredRememberMode, + eAlternateRememberMode); } sal_Bool bCanUseSystemCredentials; @@ -220,8 +268,14 @@ handleAuthenticationRequest_( if (rRequest.HasPassword) aInfo.SetPassword(rRequest.Password); aInfo.SetErrorText(rRequest.Diagnostic); - aInfo.SetPersistentPassword(bRememberPersistent); - aInfo.SetSavePassword(bRemember); + + aInfo.SetCanRememberPassword( + ePreferredRememberMode != eAlternateRememberMode); + aInfo.SetIsRememberPassword( + eDefaultRememberMode != ucb::RememberAuthentication_NO); + aInfo.SetIsRememberPersistent( + ePreferredRememberMode == ucb::RememberAuthentication_PERSISTENT); + aInfo.SetCanUseSystemCredentials(bCanUseSystemCredentials); aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials ); aInfo.SetModifyAccount(rRequest.HasAccount @@ -242,13 +296,24 @@ handleAuthenticationRequest_( xSupplyAuthentication->setUserName(aInfo.GetUserName()); if (xSupplyAuthentication->canSetPassword()) xSupplyAuthentication->setPassword(aInfo.GetPassword()); - xSupplyAuthentication-> - setRememberPassword( - aInfo.GetIsSavePassword() ? - bRememberPersistent ? - ucb::RememberAuthentication_PERSISTENT : - ucb::RememberAuthentication_SESSION : - ucb::RememberAuthentication_NO); + + if (ePreferredRememberMode != eAlternateRememberMode) + { + // user had te choice. + if (aInfo.GetIsRememberPassword()) + xSupplyAuthentication->setRememberPassword( + ePreferredRememberMode); + else + xSupplyAuthentication->setRememberPassword( + eAlternateRememberMode); + } + else + { + // user had no choice. + xSupplyAuthentication->setRememberPassword( + ePreferredRememberMode); + } + if (rRequest.HasRealm) { if (xSupplyAuthentication->canSetRealm()) @@ -267,38 +332,76 @@ handleAuthenticationRequest_( ////////////////////////// // Third, store credentials in password container. - if ( aInfo.GetIsUseSystemCredentials() ) - { - if (aInfo.GetIsSavePassword()) - { - aPwContainerHelper.addRecord( - rURL.getLength() ? rURL : rRequest.ServerName, - rtl::OUString(), // empty u/p -> sys creds - uno::Sequence< rtl::OUString >(), - xIH, - bRememberPersistent); - } - } - // Empty user name can not be valid: - else if (aInfo.GetUserName().Len() != 0) - { - if (aInfo.GetIsSavePassword()) - { - uno::Sequence< rtl::OUString > - aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); - aPassList[0] = aInfo.GetPassword(); - if (aInfo.GetAccount().Len() != 0) - aPassList[1] = aInfo.GetAccount(); - - aPwContainerHelper.addRecord( - rURL.getLength() ? rURL : rRequest.ServerName, - aInfo.GetUserName(), - aPassList, - xIH, - bRememberPersistent); - } - } - 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()) diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx index c8cbba96564b..39e5b81caf85 100644 --- a/uui/source/loginerr.hxx +++ b/uui/source/loginerr.hxx @@ -32,12 +32,13 @@ //========================================================================= -#define LOGINERROR_FLAG_SET_SAVE_PASSWORD 1 -#define LOGINERROR_FLAG_MODIFY_ACCOUNT 2 -#define LOGINERROR_FLAG_MODIFY_USER_NAME 4 -#define LOGINERROR_FLAG_PERSISTENT_PASSWORD 8 -#define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16 -#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32 +#define LOGINERROR_FLAG_MODIFY_ACCOUNT 1 +#define LOGINERROR_FLAG_MODIFY_USER_NAME 2 +#define LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD 4 +#define LOGINERROR_FLAG_IS_REMEMBER_PASSWORD 8 +#define LOGINERROR_FLAG_CAN_USE_SYSCREDS 16 +#define LOGINERROR_FLAG_IS_USE_SYSCREDS 32 +#define LOGINERROR_FLAG_REMEMBER_PERSISTENT 64 class LoginErrorInfo { @@ -56,27 +57,30 @@ public: LoginErrorInfo() : _nFlags( LOGINERROR_FLAG_MODIFY_USER_NAME ), _nRet( ERRCODE_BUTTON_CANCEL ) - { - } + {} const String& GetTitle() const { return _aTitle; } - const String& GetServer() const { return _aServer; } + const String& GetServer() const { return _aServer; } const String& GetAccount() const { return _aAccount; } const String& GetUserName() const { return _aUserName; } const String& GetPassword() const { return _aPassword; } const String& GetPath() const { return _aPath; } const String& GetErrorText() const { return _aErrorText; } - BOOL GetIsPersistentPassword() const - { return ( _nFlags & LOGINERROR_FLAG_PERSISTENT_PASSWORD ); } - BOOL GetIsSavePassword() const - { return ( _nFlags & LOGINERROR_FLAG_SET_SAVE_PASSWORD ); } + + BOOL GetCanRememberPassword() const + { return ( _nFlags & LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD ); } + BOOL GetIsRememberPersistent() const + { return ( _nFlags & LOGINERROR_FLAG_REMEMBER_PERSISTENT ); } + BOOL GetIsRememberPassword() const + { return ( _nFlags & LOGINERROR_FLAG_IS_REMEMBER_PASSWORD ); } + BOOL GetCanUseSystemCredentials() const { return ( _nFlags & LOGINERROR_FLAG_CAN_USE_SYSCREDS ); } BOOL GetIsUseSystemCredentials() const { return ( _nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) == LOGINERROR_FLAG_IS_USE_SYSCREDS; } - BYTE GetFlags() const { return _nFlags; } - USHORT GetResult() const { return _nRet; } + BYTE GetFlags() const { return _nFlags; } + USHORT GetResult() const { return _nRet; } void SetTitle( const String& aTitle ) { _aTitle = aTitle; } @@ -94,8 +98,11 @@ public: { _aErrorText = aErrorText; } void SetFlags( BYTE nFlags ) { _nFlags = nFlags; } - inline void SetSavePassword( BOOL bSet ); - inline void SetPersistentPassword( BOOL bSet ); + + inline void SetCanRememberPassword( BOOL bSet ); + inline void SetIsRememberPassword( BOOL bSet ); + inline void SetIsRememberPersistent( BOOL bSet ); + inline void SetCanUseSystemCredentials( BOOL bSet ); inline void SetIsUseSystemCredentials( BOOL bSet ); inline void SetModifyAccount( BOOL bSet ); @@ -104,20 +111,28 @@ public: { _nRet = nRet; } }; -inline void LoginErrorInfo::SetSavePassword( BOOL bSet ) +inline void LoginErrorInfo::SetCanRememberPassword( BOOL bSet ) +{ + if ( bSet ) + _nFlags |= LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD; + else + _nFlags &= ~LOGINERROR_FLAG_CAN_REMEMBER_PASSWORD; +} + +inline void LoginErrorInfo::SetIsRememberPassword( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_SET_SAVE_PASSWORD; + _nFlags |= LOGINERROR_FLAG_IS_REMEMBER_PASSWORD; else - _nFlags &= ~LOGINERROR_FLAG_SET_SAVE_PASSWORD; + _nFlags &= ~LOGINERROR_FLAG_IS_REMEMBER_PASSWORD; } -inline void LoginErrorInfo::SetPersistentPassword( BOOL bSet ) +inline void LoginErrorInfo::SetIsRememberPersistent( BOOL bSet ) { if ( bSet ) - _nFlags |= LOGINERROR_FLAG_PERSISTENT_PASSWORD; + _nFlags |= LOGINERROR_FLAG_REMEMBER_PERSISTENT; else - _nFlags &= ~LOGINERROR_FLAG_PERSISTENT_PASSWORD; + _nFlags &= ~LOGINERROR_FLAG_REMEMBER_PERSISTENT; } inline void LoginErrorInfo::SetCanUseSystemCredentials( BOOL bSet ) diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx index 26d22b320d8a..0a056289c29d 100644 --- a/uui/source/passwordcontainer.cxx +++ b/uui/source/passwordcontainer.cxx @@ -30,6 +30,7 @@ #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/task/NoMasterException.hpp" #include "com/sun/star/task/XInteractionHandler.hpp" +#include "com/sun/star/task/XMasterPasswordHandling.hpp" #include "com/sun/star/task/XPasswordContainer.hpp" #include "com/sun/star/task/XUrlContainer.hpp" #include "com/sun/star/ucb/AuthenticationRequest.hpp" @@ -271,10 +272,20 @@ bool PasswordContainerHelper::addRecord( return false; if ( bPersist ) + { + uno::Reference< task::XMasterPasswordHandling > xMPH( + m_xPasswordContainer, uno::UNO_QUERY_THROW ); + + // If persistent storing of passwords is not yet + // allowed, enable it. + if ( !xMPH->isPersistentStoringAllowed() ) + xMPH->allowPersistentStoring( sal_True ); + m_xPasswordContainer->addPersistent( rURL, rUsername, rPasswords, xIH ); + } else m_xPasswordContainer->add( rURL, rUsername, @@ -429,7 +440,7 @@ PasswordContainerInteractionHandler::handle( // @@@ FIXME: this not able to // handle master pw request! // master pw request is never - // solvabe without UI! + // solvable without UI! this ) ) { // successfully handled -- cgit From d0d67b203b9f306f3ac10fcb5019e82127a18610 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 8 Jun 2010 16:29:32 +0200 Subject: cws tl78: more space for filename added to password dialog --- uui/source/passworddlg.src | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'uui') diff --git a/uui/source/passworddlg.src b/uui/source/passworddlg.src index 5eba2fdb2c5b..33767057e1bd 100755 --- a/uui/source/passworddlg.src +++ b/uui/source/passworddlg.src @@ -41,7 +41,7 @@ ModalDialog DLG_UUI_PASSWORD Moveable = TRUE ; OutputSize = TRUE ; SVLook = TRUE ; - Size = MAP_APPFONT( 145, 75 ); + Size = MAP_APPFONT( 145, 91 ); Text [ en-US ] = "Enter password"; FixedText FT_PASSWORD @@ -53,15 +53,21 @@ ModalDialog DLG_UUI_PASSWORD Edit ED_PASSWORD { - Pos = MAP_APPFONT( 3, 35 ); + Pos = MAP_APPFONT( 3, 51 ); Size = MAP_APPFONT( 139, 13 ); Border = TRUE ; PassWord = TRUE ; }; + FixedLine FL_FIXED_LINE_1 + { + Pos = MAP_APPFONT( 0, 66 ); + Size = MAP_APPFONT( 145, 6 ); + }; + OKButton BTN_PASSWORD_OK { - Pos = MAP_APPFONT( 27, 56 ); + Pos = MAP_APPFONT( 27, 72 ); Size = MAP_APPFONT( 37, 15 ); DefButton = TRUE ; DefButton = TRUE; @@ -69,22 +75,16 @@ ModalDialog DLG_UUI_PASSWORD CancelButton BTN_PASSWORD_CANCEL { - Pos = MAP_APPFONT( 66, 56 ); + Pos = MAP_APPFONT( 66, 72 ); Size = MAP_APPFONT( 37, 15 ); }; HelpButton BTN_PASSWORD_HELP { - Pos = MAP_APPFONT( 105, 56 ); + Pos = MAP_APPFONT( 105, 72 ); Size = MAP_APPFONT( 37, 15 ); }; - FixedLine FL_FIXED_LINE_1 - { - Pos = MAP_APPFONT( 0, 50 ); - Size = MAP_APPFONT( 145, 6 ); - }; - String STR_ENTER_PASSWORD_TO_OPEN { Text [ en-US ] = "Enter password to open file: \n"; -- cgit From b5774ca9c4b802578b24120a0f8eb6625d2173ef Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 8 Jun 2010 19:15:36 +0200 Subject: cws tl78: #i109634# additional dialog parameter --- uui/source/iahndl-authentication.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 027a5cced169..008acadea0ae 100755 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -534,7 +534,7 @@ executePasswordDialog( const sal_uInt16 nMaxPasswdLen = bMSCryptoMode ? 15 : 0; // 0 -> allow any length VclAbstractDialogFactory * pFact = VclAbstractDialogFactory::Create(); - AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen ); + AbstractPasswordToOpenModifyDialog *pTmp = pFact->CreatePasswordToOpenModifyDialog( pParent, 0, nMaxPasswdLen, bIsPasswordToModify ); std::auto_ptr< AbstractPasswordToOpenModifyDialog > pDialog( pTmp ); rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL ); -- cgit From 6fd692c5e9d61acb3613ef0f783fc232ecef67ef Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Tue, 8 Jun 2010 18:02:35 +0200 Subject: cws tl79: #i110048# help ids added --- uui/source/ids.hrc | 30 +++++++++++++++++++----------- uui/source/logindlg.src | 7 +++++++ 2 files changed, 26 insertions(+), 11 deletions(-) (limited to 'uui') diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc index 9bf5856bc270..808033ec9d4c 100644 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -167,17 +167,25 @@ #define ERRCODE_UUI_SSLWARN_INVALID_1 (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 1) #define TITLE_UUI_SSLWARN_INVALID (ERRCODE_AREA_UUI_UNKNOWNAUTH + SSLWARN_TYPE_INVALID + 3) -#define HID_DLG_LOGIN (HID_UUI_START + 0) -#define HID_DLG_COOKIES (HID_UUI_START + 1) -#define HID_DLG_MASTERPASSWORD_UUI (HID_UUI_START+2) -#define HID_DLG_MASTERPASSWORD_CRT (HID_UUI_START+3) -#define HID_DLG_FILTER_SELECT (HID_UUI_START+4) -#define HID_DLG_PASSWORD_UUI (HID_UUI_START+5) -#define HID_DLG_PASSWORD_CRT (HID_UUI_START+6) -#define HID_DLG_UNKNOWNAUTH_UUI (HID_UUI_START+7) -#define HID_DLG_SSLWARN_UUI (HID_UUI_START+8) -#define HID_XMLSECDLG_MACROWARN (HID_UUI_START+9) -#define HID_DLG_NEWERVERSIONWARNING (HID_UUI_START+10) +#define HID_DLG_LOGIN (HID_UUI_START + 0) +#define HID_DLG_COOKIES (HID_UUI_START + 1) +#define HID_DLG_MASTERPASSWORD_UUI (HID_UUI_START + 2) +#define HID_DLG_MASTERPASSWORD_CRT (HID_UUI_START + 3) +#define HID_DLG_FILTER_SELECT (HID_UUI_START + 4) +#define HID_DLG_PASSWORD_UUI (HID_UUI_START + 5) +#define HID_DLG_PASSWORD_CRT (HID_UUI_START + 6) +#define HID_DLG_UNKNOWNAUTH_UUI (HID_UUI_START + 7) +#define HID_DLG_SSLWARN_UUI (HID_UUI_START + 8) +#define HID_XMLSECDLG_MACROWARN (HID_UUI_START + 9) +#define HID_DLG_NEWERVERSIONWARNING (HID_UUI_START +10) + +#define HID_LOGIN_DLG_PATH (HID_UUI_START +11) +#define HID_LOGIN_DLG_BROWSE (HID_UUI_START +12) +#define HID_LOGIN_DLG_USER_NAME (HID_UUI_START +13) +#define HID_LOGIN_DLG_PASSWORD (HID_UUI_START +14) +#define HID_LOGIN_DLG_ACCOUNT (HID_UUI_START +15) +#define HID_LOGIN_DLG_REMEMBER_PASSWORD (HID_UUI_START +16) +#define HID_LOGIN_DLG_USE_SYSTEM_CREDENTIALS (HID_UUI_START +17) // HID_UUI_END (aka HID_CHAOS_NEW_DATABASE) is reserved in // sfx2/util/hidother.src diff --git a/uui/source/logindlg.src b/uui/source/logindlg.src index c2683ea3d94c..bf6a97c3b0ff 100755 --- a/uui/source/logindlg.src +++ b/uui/source/logindlg.src @@ -93,12 +93,14 @@ ModalDialog DLG_UUI_LOGIN Edit ED_LOGIN_PATH { + HelpId = HID_LOGIN_DLG_PATH; Border = TRUE ; Pos = MAP_APPFONT( 6 , 95 ) ; Size = MAP_APPFONT( 112 , 12 ) ; }; PushButton BTN_LOGIN_PATH { + HelpId = HID_LOGIN_DLG_BROWSE; Pos = MAP_APPFONT( 121 , 94 ) ; Size = MAP_APPFONT( 50 , 14 ) ; Text = "~Browse..." ; @@ -113,6 +115,7 @@ ModalDialog DLG_UUI_LOGIN Edit ED_LOGIN_USERNAME { + HelpId = HID_LOGIN_DLG_USER_NAME; Border = TRUE ; Pos = MAP_APPFONT( 6 , 121 ) ; Size = MAP_APPFONT( 165 , 12 ) ; @@ -127,6 +130,7 @@ ModalDialog DLG_UUI_LOGIN Edit ED_LOGIN_PASSWORD { + HelpId = HID_LOGIN_DLG_PASSWORD; Border = TRUE ; Pos = MAP_APPFONT( 6 , 147 ) ; Size = MAP_APPFONT( 165 , 12 ) ; @@ -142,6 +146,7 @@ ModalDialog DLG_UUI_LOGIN Edit ED_LOGIN_ACCOUNT { + HelpId = HID_LOGIN_DLG_ACCOUNT; Border = TRUE ; Pos = MAP_APPFONT( 6 , 173 ) ; Size = MAP_APPFONT( 165 , 12 ) ; @@ -150,6 +155,7 @@ ModalDialog DLG_UUI_LOGIN CheckBox CB_LOGIN_SAVEPASSWORD { + HelpId = HID_LOGIN_DLG_REMEMBER_PASSWORD; Pos = MAP_APPFONT( 6 , 190 ) ; Size = MAP_APPFONT( 165 , 10 ) ; Text [ en-US ] = "~Remember password" ; @@ -157,6 +163,7 @@ ModalDialog DLG_UUI_LOGIN CheckBox CB_LOGIN_USESYSCREDS { + HelpId = HID_LOGIN_DLG_USE_SYSTEM_CREDENTIALS; Pos = MAP_APPFONT( 6 , 203 ) ; Size = MAP_APPFONT( 165 , 10 ) ; Text [ en-US ] = "~Use system credentials" ; -- cgit From a2e7c2e0d002d75a6b77a629a4e904ab54bf8375 Mon Sep 17 00:00:00 2001 From: obo Date: Thu, 24 Jun 2010 10:44:42 +0200 Subject: #i10000# add bIsPasswordToModify --- uui/source/iahndl-authentication.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'uui') diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx index 91aa3fed73a6..73fa61f31ff4 100755 --- a/uui/source/iahndl-authentication.cxx +++ b/uui/source/iahndl-authentication.cxx @@ -742,7 +742,8 @@ UUIInteractionHelper::handlePasswordRequest( aPasswordRequest.Mode, rRequest->getContinuations(), rtl::OUString(), - false /* bool bMSCryptoMode */); + false /* bool bMSCryptoMode */, + false /* bool bIsPasswordToModify */); return true; } -- cgit