Summary: | Manage several cookies | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Boris Kavod <kavod> |
Component: | Plugin-WebService-Piwigo | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | caulier.gilles, frederic.coiffier |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.1.0 | |
Sentry Crash Report: | |||
Attachments: | Patch in order to kipi plugin manage several authentification cookies |
Description
Boris Kavod
2006-03-06 00:21:31 UTC
Created attachment 14976 [details]
Patch in order to kipi plugin manage several authentification cookies
Here, the correction patch
above patch should resolv change request. keep it open untill applied to svn/rejected ;-) Sorry, I am newbee in the bug following projects :o) I know that this functionnality has not a lot of interest for the first goal (ie. interation with Gallery) but I think it was a great thing if, in the future, the integration can expend to another gallery systems. Waiting your point of view. At your disposition. I am currently developing a competitor to Gallery and a KIPI pluggin for it. My recommendation would be to either implement the Gallery API exactly, or to fork the Pluggin and make a couple changes. In your case, I would imagine the simplest would be to create a proxy to handle this one cookie and trade in for two, essentially making a compatible system. OTOH, considering this patch as an enhancement, would there be any backwards compatibility issues? No backward compatibility (at least, considering what I saw). I am currently using the kipi plugins with this patch with both of Gallery and my PhpBB script. So it manages in the same way one or two (and normaly more) cookie(s). Please Col can you check this and the patch they provide? SVN commit 547984 by cguthrie: Add support for multiple cookies by commiting a slightly modified patch. Tested on G1/G2 for a single cookie environment. Please reopen if my variation on the patch in some way doesn't work for you. BUG: 123141 M +9 -7 gallerytalker.cpp --- trunk/extragear/libs/kipi-plugins/galleryexport/gallerytalker.cpp #547983:547984 @@ -23,6 +23,7 @@ #include <qtextstream.h> #include <qfile.h> #include <qimage.h> +#include <qregexp.h> #include <klocale.h> #include <kio/job.h> @@ -299,13 +300,14 @@ if (m_state == GE_LOGIN && m_loggedIn) { - // get and parse the cookie - m_cookie = job->queryMetaData("setcookies"); - // rfc2109: http://www.faqs.org/rfcs/rfc2109.html - m_cookie.remove("Set-Cookie:"); - m_cookie = m_cookie.section(";", 0, 0); - m_cookie = "Cookie:" + m_cookie; - + QStringList cookielist = QStringList::split("\n", job->queryMetaData("setcookies")); + m_cookie = "Cookie:"; + for (QStringList::Iterator it = cookielist.begin(); it != cookielist.end(); ++it) + { + QRegExp rx("^Set-Cookie: ([^;]+)"); + if (rx.search(*it) > -1) + m_cookie += " " + rx.cap(1) + ";"; + } listAlbums(); } } It works perfectly for me. Thanks you very much! |