Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Multiple Group permissions for album view...  (Read 3354 times)

0 Members and 1 Guest are viewing this topic.

cjhmdm

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Multiple Group permissions for album view...
« on: July 25, 2009, 03:47:14 pm »

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.
Logged

cjhmdm

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Multiple Group permissions for album view...
« Reply #1 on: July 25, 2009, 03:50:22 pm »

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
Logged

Nibbler

  • Guest
Re: Multiple Group permissions for album view...
« Reply #2 on: July 25, 2009, 05:02:32 pm »

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
Logged

cjhmdm

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: Multiple Group permissions for album view...
« Reply #3 on: July 25, 2009, 05:16:03 pm »

Well, that works too then  ;D

Thanks for doing what I'd have procrastinated in doing lol
Logged
Pages: [1]   Go Up
 

Page created in 0.094 seconds with 21 queries.