[PATCH] Add multiple account saving support to KHTML/Konqueror (BUG #72317)

Filip Brcic brcha at gna.org
Thu Jul 22 19:44:30 BST 2010


This is a repost of my comment for the bug #72317 
(https://bugs.kde.org/show_bug.cgi?id=72317)

Hi,

I tried to add support for multiple accounts and it seams I succeeded. By that
I mean I successfully recompiled KDE trunk and KDE 4.3.3 (my desktop's 
version)
with this patch and tried multiple accounts in konqueror and it works. Also,
accounts are saved for the whole site, not just for the specific URL like it
was the practice before.

Key features of my approach are the following:

Login page is identified by having 2 form input fields, one that is plain text
field, and the other that is the password field. All other form types are
dropped to old behaviour.

Login on one site is universal on that site. That means if you can login using
multiple URLs (like on bugs.kde.org), the login data will be stored only once
and used on all login pages.

All account usernames on the site are stored as PASSWORD value in the FormData
folder of Network KWallet with the key:

accounts_SITE

All passwords are stored as PASSWORD value in the FormData folder of the
Network KWallet with the key:

account_SITE_USERNAME

When you come to the SITE's login page, the system offers you to autocomplete
username. When you select some username from the autocomplete list, the system
autofills the correct password.

No username if prefilled, but that could be easily done (for example, by
selecting the first username from the accounts list or by keeping record which
username was last used).

I made this patch from the current kdelibs trunk checkout, yet I tested it 
also on kdelibs 4.3.3 and it applies correctly (actually it doesn't since the
copyright comments don't apply correctly, but if you ignore that one error as
it is only related to comments, the patch does apply). Therefore, it is safe 
to assume this patch works on all versions of kdelibs from 4.3.3 to trunk
(possibly with some older versions, but I didn't check that).

It is worth noting that I marked all changes I made with

// BEGIN CHANGE [BRCHA]
...
// END CHANGE [BRCHA]

comments, so that the changes are easily visible and searchable on the kdelibs
checkout with the applied patch.

Also, I didn't add support for KHTMLWalletQueue and marked the point with //
TODO [BRCHA]. I will investigate KHTMLWalletQueue implementation and add
support for that in some near future. Luckily I still didn't get to the point
where WalletQueue is used, but it is probably useful to add support for that 
as well ;). KHTMLWalletQueue supports only Maps (as maps were the only thing 
used in the old approach), so I'll have to add support for Password storing.

Cheers,
Filip

-- 
Filip Brcic <brcha at gna.org>
WWWeb: http://www.brcha.iz.rs
Jabber  : brcha at kdetalk.net 
GPG 0x2537C379
Fingerprint: 287D 5F24 50AA A36C 977F AC9A F1FD C7EB 2537 C379
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdelibs--khtml--enable_multiaccount_saving.diff
Type: text/x-patch
Size: 24604 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100722/5cf43e2f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100722/5cf43e2f/attachment.sig>


More information about the kde-core-devel mailing list