Bug 96352 - Can not login
Summary: Can not login
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-WebService-Piwigo (show other bugs)
Version: unspecified
Platform: Slackware Linux
: VHI wishlist
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-05 12:54 UTC by Klaus Weidenbach
Modified: 2023-02-25 08:21 UTC (History)
14 users (show)

See Also:
Latest Commit:
Version Fixed In: 0.1.0


Attachments
Patch for kipi-plugins-0.1.0-rc1 for Gallery2 connectivity (5.91 KB, patch)
2006-03-04 14:41 UTC, Boris Kavod
Details
Patch for kipi-plugins-0.1.0-rc1 for Gallery2 connectivity - final (7.25 KB, patch)
2006-03-07 01:27 UTC, Boris Kavod
Details
Fix the display to show all albums (1023 bytes, patch)
2006-03-26 22:56 UTC, Colin Guthrie
Details
Fix the display to show all albums (1.48 KB, patch)
2006-03-26 23:32 UTC, Colin Guthrie
Details
patch to add CRLF to final mime boundary (422 bytes, patch)
2006-04-22 19:06 UTC, David Bremner
Details
Fix preview thumbnails and image hyperlinks. (1.20 KB, patch)
2006-05-21 00:56 UTC, Colin Guthrie
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Weidenbach 2005-01-05 12:54:18 UTC
Version:           cvs20050104 (using KDE KDE 3.3.2)
Installed from:    Slackware Packages
OS:                Linux

It is not possible to login into Gallery2 galleries. With the Java RemoteGallery program I have no problems. When I open the Gallery Export I get the login screen and I write the URL, user and password. I am using the same URL (http://localhost/gallery2/) like I used in the Java program. Is here maybe the problem?
After i pressed OK I get a failed message and the URL got changed into: http://localhost/gallery2/gallery_remote2.php
This file doesn't exists in Gallery2 I think anymore. Is it possible to add also support for Gallery2? Thanks!
Comment 1 Renchi Raju 2005-01-05 18:27:29 UTC
gallery2 is still in alpha stage. Have a look at the gallery2 readme (especially - when not to use section)
http://cvs.sourceforge.net/viewcvs.py/*checkout*/gallery/gallery2/README.html?rev=1.48#when_not_to_use

the protocol for it is/will be(?) different from the gallery1 protocol. so its a moving target for now. once gallery2 or gallery2_remote protocol reaches a beta stage, i will update the code to support it.
Comment 2 Stephane Enten 2005-04-12 13:55:51 UTC
Gallery 2 has been in Beta stage for over a month now, would you consider implementing the new protocol ?
Comment 3 Bernd Wurst 2005-07-17 10:40:17 UTC
I'm also missing this. 
Gave you some of my precious votes as G2 has been beta for a while now. :)
Comment 4 Renchi Raju 2005-07-17 19:28:04 UTC
i just talked to gallery developers and here's their response:

"there is a new xmlrpc protocol that will be used for the final release of gallery2 if all goes well. the current g2 remote protocol is a hack so that g1 remote protocol clients could work with little modification. look for a news announcment on gallery.sf.net announcing stability of the xmlrpc protocol for public testing"

so its still a moving target.
Comment 5 Volker Krause 2005-08-15 14:11:28 UTC
*** This bug has been confirmed by popular vote. ***
Comment 6 Jens 2005-10-22 00:16:19 UTC
Hello,

Any news about this?
Gallery2 is released and I would really like to see this feature! :-)

Thanks!
Comment 7 Bernd Wurst 2005-12-04 18:42:05 UTC
Just wanna ask is someone is working on this...

I would like to help, testing and so on if this is useful. But I need g2 login. ;-)
Comment 8 Paul Dunbar 2006-02-17 15:24:04 UTC
Gallery2 is quite stable, and their xmlrpc protocol is documented and open.  Is there a maintainer for this plugin?
Comment 9 Vardhman 2006-02-18 04:02:29 UTC
I  am assigned the plugin maintainership, but currently quite busy to
actually get in to upgrading the plugin for gallery 2 support. Any
contributions are most welcome.


Vardhman
On 17 Feb 2006 14:24:05 -0000, Paul Dunbar <merlin@ethernaut.net> wrote:
[bugs.kde.org quoted mail]



--
Blogs: http://vardhman.blogspot.com
I&nbsp; am assigned the plugin maintainership, but currently quite busy
to actually get in to upgrading the plugin for gallery 2 support. Any
contributions are most welcome.<br>
<br>
<br>Vardhman<br><div><span class="gmail_quote">On 17 Feb 2006 14:24:05 -0000, <b class="gmail_sendername">Paul Dunbar</b> &lt;<a href="mailto:merlin@ethernaut.net">merlin@ethernaut.net</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
------- You are receiving this mail because: -------<br>You are the assignee for the bug, or are watching the assignee.<br><br><a href="http://bugs.kde.org/show_bug.cgi?id=96352">http://bugs.kde.org/show_bug.cgi?id=96352</a>
<br><br><br><br><br>------- Additional Comments From merlin ethernaut net&nbsp;&nbsp;2006-02-17 15:24 -------<br>Gallery2 is quite stable, and their xmlrpc protocol is documented and open.&nbsp;&nbsp;Is there a maintainer for this plugin?<br>
_______________________________________________<br>Kde-imaging mailing list<br><a href="mailto:Kde-imaging@kde.org">Kde-imaging@kde.org</a><br><a href="https://mail.kde.org/mailman/listinfo/kde-imaging">https://mail.kde.org/mailman/listinfo/kde-imaging
</a><br></blockquote></div><br><br clear="all"><br>-- <br>Blogs: <a href="http://vardhman.blogspot.com">http://vardhman.blogspot.com</a><br>
Comment 10 Boris Kavod 2006-03-01 22:28:19 UTC
>Gallery2 is quite stable, and their xmlrpc protocol 
>is documented and open.  Is there a maintainer for this plugin? 

Where can we download the documentation of their procol?
Comment 11 Blindauer Emmanuel 2006-03-01 23:04:47 UTC
http://jmullan.visi.com/docs/gallery-remote.protocol.html

There is an extention from procolol used in gallery1 which should be easy to implement, but this is not the xmlrpc protocol, i don't even know it is already available in gallery 2.1
Comment 12 Colin Guthrie 2006-03-02 16:30:36 UTC
I would like to see G2 support for sure. Added a vote.

If the small changes can be made to work for now, then the full XMLRPC implementation can be completed at a later date as there will at least be a stop gap!
Comment 13 Boris Kavod 2006-03-04 12:10:05 UTC
Hello,

I have done the minimum necessary changes in order to kipi works with my Gallery2.
However, some some ergonomic things are not perfect (for example : when I list remote galleries, I see only the name/comments of the photos and not the previews). I do not know the correct working... but the transferts are OK.

I have never participated in a Open Source project, so can you explain me the process to share my code to the kipi team? Must I use SVN or something else?

Thanks for your help.
Comment 14 Bernd Wurst 2006-03-04 12:49:46 UTC
Hi Boris!

I am not a kipi-maintainer, but in order to share your precious work with us, you should make a patch. If you don't know how to do that, just complain again. :)

If you have a patch that shows the difference between a plain kipi plugins source code and yours, please attach it to this bug report (see "Create a New Attachment" below). 
If you do that, the maintainer(s) can have a look at it and then decide whether to use it or not.
BUT: In the meantime, all users that are really interrested can also have a look at it and use it locally. So will I. ;-)
Comment 15 Boris Kavod 2006-03-04 14:41:44 UTC
Created attachment 14946 [details]
Patch for kipi-plugins-0.1.0-rc1 for Gallery2 connectivity

Allow to log / list-albums / send photo to gallery2
TODO: correct the remote images previews
Comment 16 Boris Kavod 2006-03-04 14:43:16 UTC
Hoping can help you and maintainers

Maintainers: do not hesitate to add me in contributors ;)
Comment 17 Boris Kavod 2006-03-05 23:46:27 UTC
Any feed back about the patch?

Does it works? Does the correction works for you? Does you enjoy? :)
Comment 18 Colin Guthrie 2006-03-06 00:29:30 UTC
Sorry, but I've not had a chance to test it out yet... I will try and do shortly tho'. Initial look at the code looks fine the only confusing bit is:

@@ -371,7 +376,8 @@
                 {
                     GAlbum album;
                     album.name    = value;
-                    album.ref_num = key.section(".", 2, 2).toInt();
+                    album.ref_num = value.toInt();
+                    //album.ref_num = key.section(".", 2, 2).toInt();
                     iter = albumList.append(album);
                 }
                 else if (key.startsWith("album.title"))

but I've not looked at the context, so I'm sure it's fine really. Thanks for your code. I will definately use it.
Comment 19 Blindauer Emmanuel 2006-03-06 00:43:06 UTC
worksforme for me, I can upload pictures to a gallery-2.0 server. but no preview as excepted
Comment 20 Boris Kavod 2006-03-06 01:12:50 UTC
Hi Colin,

I have remarked that the ID was (no longer ?) not use the 'ref-num' indicated in the http://jmullan.visi.com/docs/gallery-remote.protocol.html but album.name value.

It is more logical because the "ref-num" is only an incremental number and the gallery2 can confuse it but "album.name" number is a key (number or not).

For the preview, I have worked about this evening... but without success. I keep you inform.
Comment 21 Boris Kavod 2006-03-07 01:27:24 UTC
Created attachment 14989 [details]
Patch for kipi-plugins-0.1.0-rc1 for Gallery2 connectivity - final

The same patch but correcting the preview problem.

NOTE: if it does not work, verify first the permission of your albums. The
thunds must be viewable to all.

Feel free to feed back!!!!
Comment 22 Colin Guthrie 2006-03-24 11:03:52 UTC
Hi,

Just had a chance to try out this patch. Nice work :)

I was able to log in and upload a new Album and images etc.

Unfortunately, there are a couple of issues (nothing too major and they may have been pre-existing before the G2 changes).

1. Not all my albums were visible - the tree of existing albums only showed the first sub-album in album. So most of my albums were hidden.

2. The album item counts were totally wrong - even when I created a new (sub) album, the count came in at > 400!! This is clearly wrong.

I am happy to have a play with this and update your patch if you are happy to let me but let me know if you are going to try and fix these issues yourself.

(it could of course be an issue with my installation of G2, but I hope not!)

All the best
Comment 23 Oded Arbel 2006-03-26 19:13:04 UTC
Hi.

I've just installed kipi-plugins rc1 patched with the attached file. I can now login correctly to my G2 gallery and can see the main album, but no sub albums. I can create a new sub album - and its there in the gallery interface - but can't see it in the list.

I can upload images, but some images - apparently large ones - fail to upload. When I look in the album directories I can see that the file was uploaded correctly but the gallery does not show it and I get an "invalid response from server" in GelleryExport.
Comment 24 Colin Guthrie 2006-03-26 22:56:47 UTC
Created attachment 15317 [details]
Fix the display to show all albums

Oded, this should fix the fact that not all albums are shown for you. I also
reported the same problem earlier.

Also, I was assuming the album counts were way off, but I now realise that this
is actually the album reference number (aka Name in the code), not the count. I
think this is unintuative really, so will attemtp to clean this up in a
different patch.

Anyways, this should help a few people. It should be applied after (e.g. in
addition to) the original patch.
Comment 25 Colin Guthrie 2006-03-26 23:32:46 UTC
Created attachment 15319 [details]
Fix the display to show all albums

Sorry brain froze on last patch.... it just didn't compile and I thought I'd
checked after refactoring it a bit etc. etc. sorry!

This should be OK.
Comment 26 Oded Arbel 2006-03-27 11:20:20 UTC
Thanks - that did the trick :-)

I can now see all the albums - including ones created using the GalleryExport interface - and upload to all of them.

I understand that this patch breaks compatibility with gallery 1 ? Not that I use it, but isn't it also a consideration ?
Comment 27 Chris Samuel 2006-03-27 11:24:06 UTC
I'm not in a position to test this, unfortunately, but does this support both Gallery 2.0 and 2.1 variants, or just one of them ?
Comment 28 Oded Arbel 2006-03-27 11:25:42 UTC
I'm testing with Gallery 2.1

One more thing - when showing an album in the interface (after an upload for example), the images are listed with only their ID number. Is it possible to also show the caption for each image (and possibly - make sure it is set during upload using digikam data) ?

Thanks.
Comment 29 Colin Guthrie 2006-03-27 12:01:24 UTC
Gallery 1 support in addition to G2 support would be nice, but personally, I'm happy with just G2.

I don't know of many reasons not to upgrade your G1 installation to G2 (database I sps?), besides your ISP restrictions. If it's a blocker to this being adopted to CVS, I'd happily code support for both versions.

I would also like to see captions and such beside the images/albums and allow editing of this meta data. I'll probably code up a patch at some point (fairly soon) to allow this.

I'll get rid of the id number display 100% as I really don't see the need for this at all. I'm a techie and even I don't care what the id number is ;)
Comment 30 Kevin 2006-04-06 20:49:30 UTC
I downloaded and applied the patches, and the initial tests are great.  If I see anything as I continue to use the upload, I will pass it on.

I do have another question though.  Is it difficult to add keyword support to the upload?  I use the plugin from Digikam, and the Digikam tags look like a good match for the Gallery2 keywords.  This would make the plugin perfect from my perspective.  The captions are already uploaded, and with keywords, I could search my photos easily.

Thanks for the great work.
Comment 31 Vincent Barberet 2006-04-07 07:52:04 UTC
great ! Thank you for this patch. However, does someone knows when the kipi-plugins including the patch will be released ?
Comment 32 David Bremner 2006-04-21 14:18:18 UTC
I tried these patches without success with Gallery 2.02.

I applied the patches to the debian package for 0.1.0-rc1

Here is the server line
156.34.216.36 - - [21/Apr/2006:06:54:28 -0500] "POST /gallery/main.php HTTP/1.1" 403 - "-" "Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.2 (like Gecko) (Debian)"

For comparison, here is a line from a successful login from the java Gallery Remote client

156.34.216.36 - - [21/Apr/2006:06:47:21 -0500] "POST /gallery/main.php HTTP/1.1" 200 100 "-" "Gallery Remote 1.5"

Does anyone have any ideas?  It seems like I am getting the right version of the plugins, since it is now going with URL/main.php
Comment 33 Aaron Solochek 2006-04-21 14:55:42 UTC
Huh.  I patched the kipi-plugins-0.1+rc1 debian package and it works for me.  It could use some refinement, but it gets the job done.   

Here is my log from a post:
 "POST /gallery2/main.php HTTP/1.1" 200 107 "-" "Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.2 (like Gecko) (Debian)"

The fact that you're getting a 403 makes me think that the problem isn't the patch, but more likely a server config issue (assuming you're using the right username/password on the client side).  I just upgraded to the latest gallery 2.1.1a and verified that it still works.
Comment 34 adibudeen 2006-04-21 15:10:11 UTC
I thought it was just me.  I am having a similar issue, and it appears to be server-side.  I run mod_security on an apache web server, and the audit_log reports this error:

POST /gallery2/main.php HTTP/1.1
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.2 (like Gecko) Kubuntu 6.04 Dapper
Pragma: no-cache
Accept: text/html, image/jpeg, image/png, text/*, image/*, */*
Accept-Encoding: x-gzip, x-deflate, gzip, deflate
Accept-Charset: utf-8, utf-8;q=0.5, *;q=0.5
Accept-Language: en
Content-Type: multipart/form-data; boundary=----------pKxRGfozifdfs6FgBD9AUqTcxx
WVF274M4TbhHaPvB3nFGRQTYavO4Y
Content-Length: 759
Host: www.lanterntorch.com
Connection: Keep-Alive
Cache-control: no-cache
mod_security-message: Access denied with code 403. Error processing request body
: Multipart: final boundary missing
mod_security-action: 403

28
[POST payload not available]

HTTP/1.1 403 Forbidden
Content-Length: 286
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
--4d2ba048--
Comment 35 Colin Guthrie 2006-04-21 16:30:51 UTC
I run this patch over HTTPS and with with Apache requiring that I authenticate against my LDAP server prior to any actual interaction and it all works for me :)

I don't know if G2 remote protocol generates a 403 header if you get your gallery auth wrong, but perhaps it does?? Also, are you sure you have the Remote module installed correctly at the G2 end? A minimal install doesn't have this module, so you need a full install to get it to work.

As for refinements, I'd like to see "syncing" capabilities whereby e.g. Digikam could "sync" a whole album (including sub-albums) rather than making me do so manually.... Ideally we'd store something against the image such that we could determin if we'd changed it in Digikam afterwards and it would re-sync the image. Ideally we'd grab back comments people have made on the image into digikam too. 

Not sure how hard this would be but happy to start/help out with the implementation (tho' not yet as busy with other things just now.)
Comment 36 adibudeen 2006-04-21 18:22:22 UTC
The gallery is configured for remote login.  I have successfully logged in with F-Spot.  I'm positive that the problem is with mod_security. It produces the 403 error by default, and the audit_log indicate that mod_security denied it.

I just disabled the following line in httpd.conf  "SecFilterScanPOST On" and now I can login to the gallery.  F-Spot logs in with the above line enabled, so I am suspecting that something in the POST payload, sent by the kipi plugin, sets off a red flag for mod_security.  Anyway, that is the workaround for it (not a very good one if you're not the server administrator).  I hope that the plugin can be patched to fix this issue.  I certainly have no intentions of using F-Spot instead of Digikam. :-)
Comment 37 David Bremner 2006-04-22 19:06:14 UTC
Created attachment 15743 [details]
patch to add CRLF to final mime boundary

This may address the problem with apache mod_security. I can now login to a 
remote gallery 2, create galleries and upload photos. Happiness to code ratio
is very high :-)
Comment 38 adibudeen 2006-04-23 10:56:39 UTC
Confirmed.  It also works here.  Thank you!
Comment 39 Vincent Barberet 2006-04-24 11:42:23 UTC
I've made an ebuild for gentoo distribution. It works well. Thank you for your great job.
Comment 40 Kevin 2006-04-24 18:46:11 UTC
Vincent,

Is the ebuild online anywhere (like bugs.gentoo.org)?  If it is not, could you post it here?

I am willing to test it on my system.

Thanks,

Kevin
Comment 41 Angelo Naselli 2006-05-20 18:47:46 UTC
Hi guys, I could release all the patches you posted, but we need your tests
to be sure all the work you did is ok. The problem with this plugin is that is
not official maintained, (and i cannot test remote gallery here). So if someone
who cares about this plugin, wants to maintain/contribute is welcome (contact us in kde-imaging at kde.org ml).

Regards,
   Angelo
Comment 42 Colin Guthrie 2006-05-20 18:53:57 UTC
As far as testing goes I think there has been sufficient feedback in the responses here to say that it works OK and can be released. I'd really like to extend this plugin but am a bit busy with other projects just now. Perhaps in a few months I'll have some time to focus on it.
Comment 43 Angelo Naselli 2006-05-20 19:07:41 UTC
that could be great. The aim by now is to reach 0.1.0 final and I'd like
to fix at least bug like this that have contributors. I'll release the patches,
but can you test the svn version?
Comment 44 Colin Guthrie 2006-05-20 19:09:55 UTC
Sure, testing SVN is no problem. I think you've given me help before about an unrelated kipi issue on the cooker mailing list and still have you instructions kicking around.
Comment 45 Angelo Naselli 2006-05-20 19:20:26 UTC
SVN commit 542934 by anaselli:

applied patches by  Boris Kavod, Colin Guthrie and David Bremner
BUG: 96352

 M  +8 -0      galleryitem.h  
 M  +2 -1      gallerympform.cpp  
 M  +34 -23    gallerytalker.cpp  
 M  +9 -8      gallerywindow.cpp  


--- trunk/extragear/libs/kipi-plugins/galleryexport/galleryitem.h #542933:542934
@@ -60,6 +60,14 @@
         create_sub     = false;
     }
 
+    bool operator<(const GAlbum& rhs) const
+    {
+        if (parent_ref_num == rhs.parent_ref_num)
+            return ref_num < rhs.ref_num;
+
+        return parent_ref_num < rhs.parent_ref_num;
+    }
+
     int                ref_num;
     int                parent_ref_num;
     QString            name;
--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerympform.cpp #542933:542934
@@ -57,6 +57,7 @@
     str += "--";
     str += m_boundary;
     str += "--";
+    str += "\r\n";
 
     QTextStream ts(m_buffer, IO_Append|IO_WriteOnly);
     ts.setEncoding(QTextStream::UnicodeUTF8);
@@ -111,7 +112,7 @@
     str += m_boundary;
     str += "\r\n";
     str += "Content-Disposition: form-data; name=\"";
-    str += "userfile";
+    str += "g2_userfile";
     str += "\"; ";
     str += "filename=\"";
     str += QFile::encodeName(KURL(path).filename());
--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerytalker.cpp #542933:542934
@@ -62,10 +62,11 @@
     m_url = url;
 
     GalleryMPForm form;
-    form.addPair("cmd", "login");
-    form.addPair("protocol_version", "2.3");
-    form.addPair("uname", name);
-    form.addPair("password", passwd);
+    form.addPair("g2_form[cmd]", "login");
+    form.addPair("g2_controller", "remote:GalleryRemote");
+    form.addPair("g2_form[protocol_version]", "2.3");
+    form.addPair("g2_form[uname]", name);
+    form.addPair("g2_form[password]", passwd);
     form.finish();
 
     KIO::TransferJob* job = KIO::http_post(m_url, form.formData(), false);
@@ -85,8 +86,9 @@
 void GalleryTalker::listAlbums()
 {
     GalleryMPForm form;
-    form.addPair("cmd", "fetch-albums");
-    form.addPair("protocol_version", "2.3");
+    form.addPair("g2_form[cmd]", "fetch-albums-prune");
+    form.addPair("g2_controller", "remote:GalleryRemote");
+    form.addPair("g2_form[protocol_version]", "2.3");
     form.finish();
 
     KIO::TransferJob* job = KIO::http_post(m_url, form.formData(), false);
@@ -113,9 +115,10 @@
     }
         
     GalleryMPForm form;
-    form.addPair("cmd", "fetch-album-images");
-    form.addPair("protocol_version", "2.3");
-    form.addPair("set_albumName", albumName);
+    form.addPair("g2_form[cmd]", "fetch-album-images");
+    form.addPair("g2_controller", "remote:GalleryRemote");
+    form.addPair("g2_form[protocol_version]", "2.3");
+    form.addPair("g2_form[set_albumName]", albumName);
     form.finish();
 
     KIO::TransferJob* job = KIO::http_post(m_url, form.formData(), false);
@@ -145,15 +148,16 @@
     }
 
     GalleryMPForm form;
-    form.addPair("cmd", "new-album");
-    form.addPair("protocol_version", "2.3");
-    form.addPair("set_albumName", parentAlbumName);
+    form.addPair("g2_form[cmd]", "new-album");
+    form.addPair("g2_controller", "remote:GalleryRemote");
+    form.addPair("g2_form[protocol_version", "2.3");
+    form.addPair("g2_form[set_albumName]", parentAlbumName);
     if (!albumName.isEmpty())
-        form.addPair("newAlbumName", albumName);
+        form.addPair("g2_form[newAlbumName]", albumName);
     if (!albumTitle.isEmpty())
-        form.addPair("newAlbumTitle", albumTitle);
+        form.addPair("g2_form[newAlbumTitle]", albumTitle);
     if (!albumCaption.isEmpty())
-        form.addPair("newAlbumDesc", albumCaption);
+        form.addPair("g2_form[newAlbumDesc]", albumCaption);
     form.finish();
 
     KIO::TransferJob* job = KIO::http_post(m_url, form.formData(), false);
@@ -185,12 +189,13 @@
     QString path = photoPath;
     
     GalleryMPForm form;
-    form.addPair("cmd", "add-item");
-    form.addPair("protocol_version", "2.3");
-    form.addPair("set_albumName", albumName);
-    form.addPair("userfile_name", QFile::encodeName(KURL(path).filename()));
+    form.addPair("g2_form[cmd]", "add-item");
+    form.addPair("g2_controller", "remote:GalleryRemote");
+    form.addPair("g2_form[protocol_version]", "2.3");
+    form.addPair("g2_form[set_albumName]", albumName);
+    form.addPair("g2_userfile_name", QFile::encodeName(KURL(path).filename()));
     if (!caption.isEmpty())
-        form.addPair("caption", caption);
+        form.addPair("g2_form[caption]", caption);
 
     QImage image(photoPath);
 
@@ -371,7 +376,8 @@
                 {
                     GAlbum album;
                     album.name    = value;
-                    album.ref_num = key.section(".", 2, 2).toInt();
+                    album.ref_num = value.toInt();
+                    //album.ref_num = key.section(".", 2, 2).toInt();
                     iter = albumList.append(album);
                 }
                 else if (key.startsWith("album.title"))
@@ -430,6 +436,9 @@
         return;
     }
 
+    // We need parent albums to come first for rest of the code to work
+    qHeapSort(albumList);
+
     emit signalAlbums( albumList );
 }
 
@@ -457,8 +466,10 @@
         }
         else
         {
-            QStringList strlist = QStringList::split("=", line);
-            if (strlist.count() == 2)
+        	// Boris the Gallery default URL contains "=" char. So we will split the string only from the first "=" char
+            QStringList strlist = QStringList();
+            strlist << line.left(line.find('=')) << line.mid(line.find('=')+1);
+            if (strlist.count() >= 2)
             {
                 QString key   = strlist[0];
                 QString value = strlist[1];
--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerywindow.cpp #542933:542934
@@ -238,7 +238,7 @@
         url.setHost(dlg.url());
     }
     if (!url.url().endsWith(".php"))
-        url.addPath("gallery_remote2.php");
+        url.addPath("main.php");
 
     m_url    = url.url();
     m_user   = dlg.name();
@@ -327,7 +327,7 @@
             {
                 kdWarning() << "Failed to find parent for album "
                             << album.name
-                            << "with id " << album.ref_num;
+                            << " with id " << album.ref_num << "\n";
             }
         }
     }
@@ -388,19 +388,20 @@
     for ( iter = photoList.begin(); iter != photoList.end(); ++iter )
     {
         const GPhoto& photo = *iter;
-        KURL imageurl(photo.albumURL);
-        KURL thumburl(photo.albumURL);
-        imageurl.addPath(photo.name);
-        thumburl.addPath(photo.thumbName);
+        KURL imageurl(photo.albumURL + photo.name);
+        KURL thumburl(photo.albumURL + photo.thumbName);
+        // Boris : gallery use complex URLs (with = & etc.). the addPath seems not working in this context
+        //imageurl.addPath(photo.name);
+        //thumburl.addPath(photo.thumbName);
 
         m_photoView->write( "<tr><td class='photo'>"
                             + QString("<a href='%1'>")
                             .arg(imageurl.url())
-                            + QString("<img border=1 src=%1><br>")
+                            + QString("<img border=1 src=\"%1\"><br>")
                             .arg(thumburl.url())
                             + photo.name
                             + ( photo.caption.isEmpty() ? QString() :
-                                QString("<br><i>%1<i>")
+                                QString("<br><i>%1</i>")
                                 .arg(photo.caption) )
                             + "</a></td></tr>" );
     }
Comment 46 Colin Guthrie 2006-05-21 00:56:52 UTC
Created attachment 16192 [details]
Fix preview thumbnails and image hyperlinks.

Testing the SVN version and it works fine, but there is a slight problem with
preview thumbnails for me.

The URL returned from g2 has backslashes in it escaping the sensitive parts
(colons and equals signs).

This patch adds a simple .replace to the bit where this is assigned in
gallerytalker.cpp and removes some old commented out lines in gallerywindow.cpp

that could confuse in the future.

The second part is not essential.
Comment 47 Angelo Naselli 2006-05-21 15:33:09 UTC
SVN commit 543161 by anaselli:

applied patche by Colin Guthrie 
Please next time open a new bug report. Thanks

CCBUG: 96352

 M  +1 -1      gallerytalker.cpp  
 M  +0 -3      gallerywindow.cpp  


--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerytalker.cpp #543160:543161
@@ -497,7 +497,7 @@
                 }
                 else if (key.startsWith("baseurl"))
                 {
-                    albumURL = value;
+                    albumURL = value.replace("\\","");
                 }
             }
         }
--- trunk/extragear/libs/kipi-plugins/galleryexport/gallerywindow.cpp #543160:543161
@@ -390,9 +390,6 @@
         const GPhoto& photo = *iter;
         KURL imageurl(photo.albumURL + photo.name);
         KURL thumburl(photo.albumURL + photo.thumbName);
-        // Boris : gallery use complex URLs (with = & etc.). the addPath seems not working in this context
-        //imageurl.addPath(photo.name);
-        //thumburl.addPath(photo.thumbName);
 
         m_photoView->write( "<tr><td class='photo'>"
                             + QString("<a href='%1'>")
Comment 48 Riccardo Iaconelli 2007-10-21 22:51:22 UTC
This doesn't seem to be working.
I'm told: Failed to login into remote gallery. Gallery URL probably incorrect
The gallery version on the server is 2.2.3
Comment 49 Riccardo Iaconelli 2007-10-21 23:31:01 UTC
sorry, it's fixed, encountered a misconfiguration.
Comment 50 Martin 2008-01-03 17:01:54 UTC
Hi

With kipi-plugins 0.1.5-rc1 and DigiKam 0.9.3 I am still not able to connect to a Gallery2, Version 2.2.4. Error message tells me that the URL must be wrong...

As far as I can see the gallerytalker.cpp is still without the patches I found on this page.

I tried to implement the suggested patches into gallerytalker.cpp - but I get still the same error.

Martin
Comment 51 Angelo Naselli 2008-01-03 18:04:46 UTC
Well it sounds odd to me, nobody has touched it after the patch was added
and the maintainer is now the one who provides that patch ;)
Comment 52 Martin 2008-01-03 18:48:19 UTC
To make it clear: With F-Spot and Gallery Remote I can upload pictures to Gallery2 - as far as I know F-Spot doesn't use kipi-plugins --> Gallery2 remote setup is ok.

Gwenview uses kipi-plugins isn't able to upload pictures --> It's not a problem of DigiKam or Gwenview - it must be something wrong with galleryexport.

Comment 53 Colin Guthrie 2008-01-03 18:52:43 UTC
Well this specific bug is definitely fixed but it could be something has been introduced into latest G2 that makes things break again. I'll take a look.
Comment 54 Martin 2008-01-03 19:03:37 UTC
Thanks for your answer. But it seems to me that file gallerytalker.cpp in SVN isn't really updated - the login procedure is still for Gallery and not for Gallery2. In the other files of "galleryexport" I find the suggested patches - but in gallerytalker.cpp they are lost - must be a very old version...
Comment 55 Colin Guthrie 2008-01-03 19:12:52 UTC
If you look at the code you'll see that the system is written to allow for compatibility to both gallery 1 and 2. If you look at the svn history you'll see that gallerytalker changes were reverted and implemented differently. It definitely works with g2. I've used it plenty times.
Comment 56 Martin 2008-01-03 19:30:48 UTC
As written in http://bugs.kde.org/show_bug.cgi?id=96352#c52 F-Spot and Remote Gallery have no problems to connect to Gallary2 - they are still working with Gallery2 2.2.4.

I made an other Gallery2 2.2.4 installation on my local linux server with the same result: DigiKam and Gwenview can't connect, F-Spot and Remote Gallery have no problems.
Comment 57 Colin Guthrie 2008-01-03 19:33:24 UTC
Yes but these apps use different code to connect so I can only presume that something has changed in latest gallery that is not compatible with this code. Like I said above I'll take a look when I get a moment. I wasn't disputing that there is a bug, I'm just saying that it definitely isn't *this* bug :)
Comment 58 Martin 2008-01-03 19:52:06 UTC
Thanks a lot - if this helps for track it down: I found an older Gallery2 installation on my server - version 2.2.1 - with the same result: No connection.
Comment 59 Angelo Naselli 2008-01-03 20:14:14 UTC
could it be related to bug #154752?
Comment 60 Martin 2008-01-03 20:23:40 UTC
I don't think so - the error message seems to be clear (in German ;-)

"Fehler beim Anmelden an der entfernten Galerie.Die Adresse (URL) der Galerie ist möglicherweise falsch."
Comment 61 Martin 2008-01-16 15:56:46 UTC
Any news about this problem...? DigiKam isn't able to connect to my Gallery2 installation.
Comment 62 Colin Guthrie 2008-01-16 18:21:46 UTC
Can you create me a test login on your Gallery2 and send me (privately) the details. I cannot reproduce this problem on my system with latest gallery2 codebase.

There is also another bug to do with the listing that I'm working with someone to try and get to the bottom off but that's harder to reproduce.
Comment 63 Colin Guthrie 2008-01-16 23:19:51 UTC
Martin,

Can I ask if you have mod_security installed in your apache. I seem to be getting a "406 Not Acceptable" if I just submit a direct post request....
Comment 64 Martin 2008-01-17 08:19:31 UTC
The phpinfo of the server says:

Apache Version 	Apache/2.0.46 (Red Hat)
Loaded Modules 	... mod_security  ...
Comment 65 Colin Guthrie 2008-01-17 11:26:25 UTC
For the mod_security related bug, please continue discussions on bug #155980 as this is clearly a different problem to this original bug and people in the CC list here are probably not overly interested ;)