summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-10-18 14:05:07 +0200
committerCaolán McNamara <caolanm@redhat.com>2021-10-19 11:43:27 +0200
commit7bed55bc0b4ebb26fa8de5e3e38716d2febd0eb7 (patch)
tree38a49d6af69eb0a504722272c3521cdfb0786ccb /ucb
parent3b3154f6c2517155b1253ce9ff773c470bb31093 (diff)
related tdf#145190 gio_mount: show username when requesting password
It is always nice to know WHICH password you are being asked for. When a remote open/save service exists (without a saved password) then the password request immediately pops up and nowhere is there any indication which service / username the password is for. This still doesn't indicate which hostname/service this is for, but better than nothing at all. To avoid causing any regressions, this was done only when a username was explicitly passed along. In the case where a previous password was guessed, that is kept as _NA. [aMessage provides "Enter password for <user> on <host>" but that duplicates the label "Enter user name and password for:". So we don't seem to have much to work with here.] Change-Id: I0991c76ed1ce625ef354009fb416f1058cbeb313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123746 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/gio/gio_mount.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/ucb/source/ucp/gio/gio_mount.cxx b/ucb/source/ucp/gio/gio_mount.cxx
index dfbb9a0310e5..1d2dbcea8142 100644
--- a/ucb/source/ucp/gio/gio_mount.cxx
+++ b/ucb/source/ucp/gio/gio_mount.cxx
@@ -109,13 +109,14 @@ static void ooo_mount_operation_ask_password (GMountOperation *op,
OUString aDomain, aUserName, aPassword;
+ if (default_user)
+ aUserName = OUString(default_user, strlen(default_user), RTL_TEXTENCODING_UTF8);
+
ucbhelper::SimpleAuthenticationRequest::EntityType eUserName =
(flags & G_ASK_PASSWORD_NEED_USERNAME)
? ucbhelper::SimpleAuthenticationRequest::ENTITY_MODIFY
- : ucbhelper::SimpleAuthenticationRequest::ENTITY_NA;
-
- if (default_user)
- aUserName = OUString(default_user, strlen(default_user), RTL_TEXTENCODING_UTF8);
+ : aUserName.isEmpty() ? ucbhelper::SimpleAuthenticationRequest::ENTITY_NA
+ : ucbhelper::SimpleAuthenticationRequest::ENTITY_FIXED;
ucbhelper::SimpleAuthenticationRequest::EntityType ePassword =
(flags & G_ASK_PASSWORD_NEED_PASSWORD)