One of the reasons for using Gallery2 instead of plain old image.module is its powerful access control. This hinges on user groups though so Drupal user roles need to be translated into Gallery2 groups when a user is updated. All the group functions are provided for in the embed code. They just need to be implemented.

CommentFileSizeAuthor
#2 gallery_groupsync.patch12.86 KBtangent

Comments

michelle’s picture

This is something I would like as well. I'm not advanced enough, yet, to code it, though. If no one beats me to it, I'll do it eventually, but that eventually may be a ways off.

Michelle

tangent’s picture

Status: Active » Needs work
StatusFileSize
new12.86 KB

I was working on this for a bit and got it mostly working. Attached is a patch.

It's been a while now so I don't remember exactly what state it was in but there was one unresolved bug. It was syncing to some degree though so maybe someone can pick up this code and run with it or at least get some ideas from it.

I'm not intending to use Gallery2 for the moment so I'm not working on this anymore.

aserdaten’s picture

Has Tangent's suggestion patch been implemented in the latest version of the module? I don't see it in the code, but Walkah may have chosen to do it differently. I see role/group synching mentioned in G2 Meeting Notes from last year, but I can't tell whether it's been implemented in the module.

My assumption is that it's there, because the absence of what seems to be a fairly small amount of code greatly reduces the utility of the module. Also, I'm hesitant to add Tangent's patch when the latest module release is newer.

Any guidance would be appreciated.

tangent’s picture

I recommend against applying my patch unless you intend to further hack the code afterwards. My patch was posted only to show the direction I was headed but I'm pretty certain it would give you no joy.

kiz_0987’s picture

This version ( http://drupal.org/node/35379 ) has group support and is being maintained (I'm working on 4.7 with G2.0/G2.1 now). Group support between G2 and Drupal is overly complex, but seems to work OK. Make sure you read the warning at the beginning (although nobody has actually reported any major issues).

aserdaten’s picture

Thanks - I'll give this a shot and see how it works. It's early enough in development that I can pretty much charge in where angels fear to tread, so I'll implement and report back.

aserdaten’s picture

OK, I implemented kiz's module. It seems to be working but I need to play with it for awhile. I ran into an interesting problem during installation, though, and one that kiz discussed before in a Gallery2 forum item.

For some reason kiz's module inserts "cgi-system" as a directory in the document path for all G2 images and thumbs on my server. Now, my server is at Dreamhost, which means there are two fairly unique set of circumstances in play. The first is that DH runs PHP as CGI. The second is that DH offers a "one click install" of Gallery2, and sets up Gallery2's image directory outside the webserver document path. I suspect one of these two things is causing the problem.

To fix it the first thing I tried was turning off PHP as CGI - which caused Gallery2 to fail entirely and I assume would have required me to do a fresh installation. The second thing I tried was to run the PHP 5 interpreter instead of the PHP 4 interpreter. That worked; kiz's module seems to work.

I'm going to use it for a bit and see how it does. If there are more problems I'll report back.

kiz_0987’s picture

Status: Needs work » Closed (fixed)

Functionality is now available, although it did not use this patch.