Multiple Group permissions for album view... Multiple Group permissions for album view...
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Multiple Group permissions for album view...

Started by cjhmdm, July 25, 2009, 03:47:14 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cjhmdm

WARNING: Use this at your own risk. This is sort of advanced, so DO NOT make ANY changes listed below unless you know what you're doing!

After doing some searching around (namely for a mod/hack that would do this) and coming up short, I figured out a manual way to accomplish what I wanted.

Before I begin, a little info about my site...
I'm running MyBB v1.4.8 and CPG v1.4.25 (bridged)
I have several user groups in which case some members belong to several groups (via primary group and secondary group(s)). It seems the MyBB>CPG bridge only imports the members' primary group which causes problems for me when trying to set permissions in the gallery.

Here's how I overcame this problem:


First things first. Open up phpMyAdmin in your flavorite browser.
Browse to [coppermine db] >> [prefix_albums]*

*For example :
[coppermine db] = Coppermine
[prefix_albums] = cpg_albums

Click the 'Structure' tab up top if you're not already there

Now, find the Field 'visibility' and open it for editing (click the pencil to the right of the field under 'Action')
Change the Type from 'INT' to 'VARCHAR'
Change Length/Values from '11' to say '50'
Save changes

Now, you want to edit each album (in phpMyAdmin) and add the GID, separating each GID with a comma...

For Instance:


You have 3 groups:
Good (GID = 100)
Bad (GID = 101)
Ugly (GID = 102)

You have 4 albums:
Good Pics
Bad Pics
Other Pics
My Pics

You want 'Good' to have access to 'Good Pics', 'Bad Pics', and 'Other Pics'
You want 'Bad' to have access to 'Bad Pics'
You want 'Ugly' to have access to all albums

Once your changes have been saved and you are back on the 'Structure' tab, click the 'Browse' tab up top.

Open the 'Good Pics' album for editing (click the pencil)
Find where it says 'visibility' and input the following for value: 100,102 (which means this album can be viewed by members of the 'Good' and 'Ugly' groups)
Click 'Go' to save the changes

Open the 'Bad Pics' album for editing (click the pencil)
Find where it says 'visibility' and input the following for value: 101,102 (which means this album can be viewed by members of the 'Bad', and 'Ugly' groups)
Click 'Go' to save the changes

Open the 'Other Pics' album for editing (click the pencil)
Find where it says 'visibility' and input the following for value: 100,101,102 (which means this album can be viewed by members of the 'Good', 'Bad', and 'Ugly' groups)
Click 'Go' to save the changes

Open the 'My Pics' album for editing (click the pencil)
Find where it says 'visibility' and input the following for value: 102 (which means this album can be viewed by members of the 'Ugly' group)
Click 'Go' to save the changes



I cannot stress enough that if you are not comfortable editing your database manually then DO NOT attempt to do this. I've tested these changes in every way possible and have yet to find any issues/problems; but this doesn't mean there aren't any. Which is why this info comes to you AS IS, with no warranty or guarantee from me.

When I have some extra time I'll try to write up a mod/hack that will automate this process, but for now it'll have to be done manually.

cjhmdm

My apologies for the quick bump, but could a mod or admin add a [HOW-TO] in front of the thread title for me? I forgot to add it before I submitted the post and I can't edit it.

Thanks

Nibbler

I've now updated the bridge to support multiple user groups. I think that's a better solution.

http://forum.coppermine-gallery.net/index.php/topic,60782.0.html

cjhmdm

Well, that works too then  ;D

Thanks for doing what I'd have procrastinated in doing lol