forum.coppermine-gallery.net

No Support => Modifications/Add-Ons/Hacks => Mods: Permissions => Topic started by: Abbas Ali on September 08, 2006, 10:07:26 am

Title: Upload permission in albums on group basis
Post by: Abbas Ali on September 08, 2006, 10:07:26 am
This mod will give admin the ability to assign upload permission for a album on group basis i.e. which group is allowed to upload in that particular album.

First you will need to add a new column to database table cpg_albums. For this run following query in phpMyAdmin or any other db tool (Replace cpgPrefix with your prefix).

Code: [Select]
ALTER TABLE `cpgPrefix_albums` ADD `upload_group` INT NOT NULL ;

All the modified files are attached in the zip. If you are using cpg1.4.x without any mods then it is recommended to replace existing files with the files in the archive. If you are using modded cpg then open each file in a editor and copy the modified/added code to your existing files.

All the lines which were added are marked with following syntax.

########## Added ##########
// some code
###########################

All the lines which were modified are marked with following syntax

########### Modified #########
// some code
############################

Admin can give permissions to groups from Album Properties page i.e. modifyalb.php script.

"Visitors can upload photos" should be set to yes (album properties page) and group should be allowed to upload to public albums (group manager page) to make this mod work.

Note: This is just an experimental mod. Do not use on galleries which contain sensitive data.


Abbas
Title: Re: Upload permission in albums on group basis
Post by: nims on September 11, 2006, 12:09:23 pm
Hi Abbas,

Thanks for your efforts. I wud like to know if this fits my requirements or not.

I want to create categories ( or groups ) like female models, male models and kid models. Now when a user registers I want him to select an appropriate category ( or Group ).

Once his account is activated he shud be able to upload his pics ( create his album ) under that category ( or group ).

Now I feel that what I call categories or Groups might be different then what you have for cpg. Its just to convey my idea. Basically Males shud upload pics to males gallery, females to females gallery and so on.

any chance ? Maky
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on September 11, 2006, 12:31:07 pm
No, this mod won't accomplish what you want. Categories and groups are two different things. Normal users cannot create albums in categories other then their own user category.

This mod only gives permission to a user to upload in a certain album.
Title: Re: Upload permission in albums on group basis
Post by: dem_ on September 12, 2006, 04:12:36 am
Dude you rock!, im gonna "install it" right now
Title: Re: Upload permission in albums on group basis
Post by: dem_ on September 12, 2006, 04:27:35 am
 ::) Question.... This wont interfere with the personal albums of a user right?
dumb question i know
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on September 12, 2006, 06:57:46 am
No, it won't.
Title: Re: Upload permission in albums on group basis
Post by: dem_ on September 12, 2006, 07:49:52 am
Flawless !
Title: Re: Upload permission in albums on group basis
Post by: jhietter on September 28, 2006, 04:55:04 am
Thank you!  This is exactly what I needed & it works great!
Title: Re: Upload permission in albums on group basis
Post by: simoslav on October 20, 2006, 10:49:59 am
Dear Abbas
can you please explain me something , im using cpg bridged with joomla, my users register through joomla and not via cpg, but they have instant access to cpg once registred, can you tell me please if this mod require registration through cpg ? many thanks
Title: Re: Upload permission in albums on group basis
Post by: Nibbler on October 20, 2006, 01:40:08 pm
This mod should work fine with bridging.
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on October 20, 2006, 01:45:52 pm
I haven't tested this mod with bridged cpg. Try it yourself and report back if it works well with bridging turned on.
Title: Re: Upload permission in albums on group basis
Post by: Frasse on October 21, 2006, 12:01:06 pm
I've been looking around for an expanded permission mod or changed core in Coppermine for a long time now, and this seems to be a _very_ intreresting mod.  :)

Question: Will it be possible for users in a group to change and delete uploaded files as well, or is it just possible to upload files?
Title: Re: Upload permission in albums on group basis
Post by: sigepjedi on November 10, 2006, 05:56:05 pm
I would also like to see moderators able to edit picture comments on this....
Title: Re: Upload permission in albums on group basis
Post by: Joachim Müller on November 10, 2006, 07:13:20 pm
Your reply is not related to this mod. Comment moderation is an entirely different animal.
Title: Re: Upload permission in albums on group basis
Post by: her_voodoo on November 16, 2006, 09:19:20 pm
Hello.

I am running CPG 1.4.9 and I have it Bridge to SMF 1.1 RC3.  I do not have any other modifications and this is pretty much the only one that I really have need for but it seems I cannot get it to work.  I have modified the database table as asked and have overwritten the files with the ones in the zipfile but when I go to the album properties, I do not see an option to select a user group who will be able to upload to this folder.  Would anyone have a suggestion as to what I perhaps did wrong or what I might do additionally to get it to work for me?  Thanks in advance for any insight or help.
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on November 17, 2006, 06:07:29 am
Did you modified/replaced your modifyalb.php file?
Title: Re: Upload permission in albums on group basis
Post by: her_voodoo on November 18, 2006, 02:27:22 am
Yes, I did.  Since I don't have any other modifications, I did as you suggested and just replaced those files with the ones you provide in the zipfile.

I've attached the file if you wish to take a look at it. :)  I would love to use this modification because it is a great solution to my problem. Thank you for helping me.
Title: Re: Upload permission in albums on group basis
Post by: her_voodoo on November 30, 2006, 02:22:38 am
A small question.  Should the input value for the upload_group be hidden?  That is how it shows up when I view source on the modifyalb.php 

Code: [Select]
{
    global $ALBUM_DATA, $lang_yes, $lang_no;

    if ($name == 'uploads' && USER_ADMIN_MODE) {
        echo "        <input type=\"hidden\" name=\"$name\" value=\"{$ALBUM_DATA['uploads']}\" />";
        return;
    }


Could this be the reason I can't seem to find it or use it on my gallery? :)  Any help appreciated.
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on November 30, 2006, 10:56:15 am
PM me your gallery admin account. I will see what i can do.
Title: Re: Upload permission in albums on group basis
Post by: Marchello on December 05, 2006, 06:18:38 pm
Can this mod assign permissions to multiple groups ( for example I want to give permission to guest AND registered users to upload) or is it one group only?


Thanks

Marchello
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on December 05, 2006, 06:29:21 pm
One group only.
Title: Re: Upload permission in albums on group basis
Post by: ST247 on December 06, 2006, 11:22:45 am
I just installed Coppermine 1.4.10.  I followed your instructions to change the database and upload the files.
I don't see any option to give permissions to a group either.
Thanks in advance for your help.
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on December 06, 2006, 11:26:34 am
Did you just replaced the original files with the modded files? or applied the mod manually?
Title: Re: Upload permission in albums on group basis
Post by: ST247 on December 10, 2006, 01:48:51 pm
Did you just replaced the original files with the modded files? or applied the mod manually?
I replaced the files since I didn't have any other mods installed.
Title: Re: Upload permission in albums on group basis
Post by: ugaMack on December 15, 2006, 07:36:49 pm
This is part of what I'm looking for. Does anyone know of a mod or plugin that would allow a group to create an album in a category outside of the user galleries?

Thanks
Title: Re: Upload permission in albums on group basis
Post by: Zenigata on December 16, 2006, 02:39:33 am
Does this mod works with a bridged SMF?
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on December 16, 2006, 06:09:27 am
@ugaMack: afaik no such mod exists.

@Zenigata: Yes it should work.

@ST247: PM me your admin username/pass along with the site url.
Title: Re: Upload permission in albums on group basis
Post by: Jost on December 27, 2006, 11:58:22 pm
thanks - works like a charm
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on February 10, 2007, 11:39:18 am
Hi Abbas,

i am already using the mod http://forum.coppermine-gallery.net/index.php?topic=26218.0 (http://forum.coppermine-gallery.net/index.php?topic=26218.0) and that works like a charm now.

This mod looks like something i coulduse  as wel. I am working on a site which, if all goes as planned, will have a large numbers of scouting groups adding pictures to the site. At this moment i can grant someone the right of upload by adding them to the Upload group. But that means they can basicly upload into any album which is set to accept uploads by visitors.

With this mod i can add a group for each person who requested upload permission. That person can then only upload in those albums where his/her group has been set as the one who can upload. But that would , in my case, probably result in a large list of groupnames in groupmgr.php

What i am looking for, and i am not sure if this mod can be adjusted for it, is a way to add one group to groupmgr.php which has upload priveleges, named Upload. And then i make someone a member of that group. And when i then assign the Upload group to a newly created album i can select All or choose specific person or persons in case there are more then 1 uploader from a group who wants to add pictures.

I hope i make sense , if not say so and i'll see if i can clearify.

Regards,
Hein
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on February 10, 2007, 01:05:18 pm
Hein,

Create a group called Uploader. All users who wants to upload should have this group as either their primary or secondary group. Then from album properties page allow the Uploader group to upload in that album. All users who have Uploader as their primary or secondary group will then have upload permission to that album.
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on February 10, 2007, 02:33:35 pm
I think you misunderstood me Abbas.

When i set it up like you describe i still would have to make multiple Uploader group. I'll try to describe. Scoutgroup A and Scoutgroup B want to upload pictures from a camp to CPG. They both have 1 person in their group who takes care of the uploading. But i do not want the person from A being able to also upload in the album from person B and vice versa.

What i would see as a usefull feature is that you can add people to the group Uploader and that you can select in Album properties to either let the whole group Uploader be able to upload or just 1 person from to group to stop others from uploading in the wrong album.

I attached a picture which hopefully makes it visual. In the picture the group Uploader is chosen as the group who can upload into a album and All is chosen to allow everyone in that group to upload. Instead of All one could also choose just 1 person.

Hein
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on March 01, 2007, 03:14:20 pm
I usually do not bump but in this case i am eager to know if this mod can do what i want. It would make my life easier knowing that even though someone is in the Uploader group they can not upload in all albums accept the ones i grant them rights to.

:) Abbas if you would so kind to give some thought to this option that i think would be a great benefit to this mod.

Kind regards,

Hein
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on March 02, 2007, 07:06:02 am
Hein, Sorry for not replying your query. I guess with some more code changes (and db changes) the mod can do what you want. I will have to take a look at it to know how much more work is needed. (I myself have forgotten how this mod works and the code that went into it ;) )
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on March 02, 2007, 04:24:21 pm
No need for sorry Abbas, you are doing this voluntarily ;) Which i do appreciate.

Thanks for having a look at my request, i do think it would be of great benefit for sites with a large group of uploaders who may only upload to their assigned albums.

Again, thanks and io hope the outcome of your investigation will be positive  ;D

Hein
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on March 08, 2007, 06:30:24 pm
@Hein: Just an update that nothing has been done in this regards. Not getting enough time :(
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on March 09, 2007, 02:55:39 pm
Abbas

not a problem, your not being paid to do it  ;D. I already owe you for looking into it. I do think it is possible but i lack the coding skills  :-\

The mod works for my site, i only have to make sure the people i grant the upload right understand that they have to be carefull in which album they upload.

I sure hope you can find time and makes this work.

Thanks and regards,

Hein
Title: Re: Upload permission in albums on group basis
Post by: Rorge on March 12, 2007, 06:02:29 am
Hello,

Thanks for your work in this MUCH needed area.

When I applied this mod and went to change the album properties (visitor can upld files:yes) etc...then selected the group I wanted to be able to upload pics and selected update album I received the message:

There was an error while processing a database query

Stuck.  Thanks for your help
Title: Re: Upload permission in albums on group basis
Post by: Joachim Müller on March 12, 2007, 09:02:08 am
There was an error while processing a database query
Enable debug_mode, then replicate the error. Post the actual error message (the query that fails). Do not post debug_output.
Title: Re: Upload permission in albums on group basis
Post by: Rorge on March 12, 2007, 03:41:41 pm
Thanks for your help GauGau

While executing query "UPDATE cpg1410_albums SET title='Elizabeth', description='', category='4', thumb='0', uploads='YES', comments='YES', votes='YES', visibility='0', alb_password='', alb_password_hint='', keyword='', upload_group='112' WHERE aid='39' LIMIT 1" on 0

mySQL error: Unknown column 'upload_group' in 'field list'


Title: Re: Upload permission in albums on group basis
Post by: Joachim Müller on March 12, 2007, 06:58:02 pm
Means that you haven't run the query
Code: [Select]
ALTER TABLE `cpgPrefix_albums` ADD `upload_group` INT NOT NULL ;as suggested in the initial posting of this thread. Make sure to replace cpgPrefix with the actual prefix of your Coppermine database tables.
Title: Re: Upload permission in albums on group basis
Post by: CafePrima on March 15, 2007, 09:46:37 pm
I think I'm having trouble configuring this mod correctly. I think I installed it properly and I successfully ran the DB Query before I ever started.

I created my custom groups and I am able to assign a user to a group. However, when I create a category, for "category owner" choices I am given the user names, not the group names. Am I able to make a "group" the owner?

Also, when I'm in the album view and I click "view assigned albums" I receive a message, "This group has no special access" but I can't figure out where to assign albums to a group. I want everyone to be able to view them but only certain groups to be able to upload.

Are these things possible with this mod or am I misunderstanding. I'd love to use the bridge manager (for phpbb 2.0.22) but since I have special groups there, it seems to get even more confused!

Thanks in advance for any help!
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on March 30, 2007, 11:00:30 am
@Hein: Just an update that nothing has been done in this regards. Not getting enough time :(

Hi Abbas,

any news on this subject ?

Kind regards,
Hein
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on March 30, 2007, 01:56:49 pm
Nopes :(. Same excuse :D
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on March 30, 2007, 02:00:27 pm
I think I'm having trouble configuring this mod correctly. I think I installed it properly and I successfully ran the DB Query before I ever started.

I created my custom groups and I am able to assign a user to a group. However, when I create a category, for "category owner" choices I am given the user names, not the group names. Am I able to make a "group" the owner?

Also, when I'm in the album view and I click "view assigned albums" I receive a message, "This group has no special access" but I can't figure out where to assign albums to a group. I want everyone to be able to view them but only certain groups to be able to upload.

Are these things possible with this mod or am I misunderstanding. I'd love to use the bridge manager (for phpbb 2.0.22) but since I have special groups there, it seems to get even more confused!

Thanks in advance for any help!

I think you are mixing up this mod with other permissions.

This mod won't control who will see what. Neither will it control anything related to categories. It will just allow a group (users of a group) to upload to a particular album. To control which group can upload, go to album properties page and from there select the group.
Title: Re: Upload permission in albums on group basis
Post by: morgue on April 03, 2007, 08:39:09 am
Hi, I think I did everything, but I don't see the options on where to assign a group to an album so let me see

I added the column to the table running this:
ALTER TABLE `cpg1410_albums` ADD `upload_group` INT( 11 ) NOT NULL 

Then I extracted the files from the zip into the coppermine folder.

Now I can't find any option different from what I had before, I looked inside Categories, Album list, but nothing. Could it be because of the theme I'm using? o_O

I would appreciate any help you guys could provide to me, thanks!
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on April 03, 2007, 09:44:15 am
Go to album properties page to see the option.
Title: Re: Upload permission in albums on group basis
Post by: morgue on April 03, 2007, 03:06:10 pm
I'm getting the same options as before, nothing that says groups or a different field.  ???
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on April 05, 2007, 09:28:23 am
You probably didn't do the theme related modifications properly. Instead of replacing the files try to apply the mod manually as explained in the first post.
Title: Re: Upload permission in albums on group basis
Post by: morgue on April 07, 2007, 12:02:53 am
I just tried that, I can not find the option... Is it supposed to be where you set the password for an album, set if visitors can or not upload to it?
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on April 07, 2007, 06:55:55 am
I just tried that, I can not find the option... Is it supposed to be where you set the password for an album, set if visitors can or not upload to it?

yes
Title: Re: Upload permission in albums on group basis
Post by: morgue on April 07, 2007, 10:39:26 am
yes

it is not :(

would you mind looking at the code/tables on my gallery? I'm 100% I did everything right... I'm not using the default theme, I'm using i-feel-dirty, which seems to cause some other issues... like not showing the album list on the main page, but that would be unrelated to this...

I'm out of ideas, thanks for your help
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on April 07, 2007, 11:16:31 am
PM me the site url, admin account info and one registered user account info. Also give the link to this topic in the message.
Title: Re: Upload permission in albums on group basis
Post by: morgue on April 10, 2007, 07:48:53 pm
I just wanted to know if you received my message.  ???

thanks
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on April 11, 2007, 07:07:02 am
Yes i did....been busy hence didn't took a look as yet.
Title: Re: Upload permission in albums on group basis
Post by: morgue on April 11, 2007, 07:25:53 am
Good :D

Thanks man, whenever you have a chance :)
Title: Re: Upload permission in albums on group basis
Post by: SoftDux on April 21, 2007, 09:05:10 am
how difficult would / could it be to modify your code to work with a few different galleries / groups?
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on April 24, 2007, 08:15:39 am
Nopes :(. Same excuse :D

Good morning Abbas ;) Any luck yet with finding time to see if my request is worth implementing in this mod ?

Kind regards,
Hein
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on April 25, 2007, 09:26:48 am
To all those who are waiting for my reply on this thread: I am really sorry. Been running very very busy these days so couldn't look into any of your issues/suggestions etc.

I presume that i will remain busy for the next 2-3 months. So please don't wait for my answers and move ahead.
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on April 25, 2007, 10:25:34 am
To all those who are waiting for my reply on this thread: I am really sorry. Been running very very busy these days so couldn't look into any of your issues/suggestions etc.

I presume that i will remain busy for the next 2-3 months. So please don't wait for my answers and move ahead.

It's ok Abbas. We appreciate your input and effort into making CPG better and better. I don't know what you are busy with but i wish you all the best.

Regards,
Hein
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on April 25, 2007, 02:00:28 pm
[ot]

I don't know what you are busy with but i wish you all the best.

Well my work load has increased because of a big project i am managing for the past 3-4 months. Also now i am engaged an need to give some of my time to my fiancee. This might continue till my marriage :D
[/ot]
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on June 07, 2007, 11:32:58 am
[ot]
Congratulations Abbas on getting engaged. I hope and wish you will have a long and happy marriage. I'm not at that stage yet but i know my gf wants attention as wel  ;)
[/ot]

I am stil wanting to get this mod to do be enhanced as discussed here, http://forum.coppermine-gallery.net/index.php?topic=35990.msg194990#msg194990 (http://forum.coppermine-gallery.net/index.php?topic=35990.msg194990#msg194990). Abbas is undoubtedly really busy at the moment so i wonder if maybe a other dev member might be willing to give it a shot ?
Title: Re: Upload permission in albums on group basis
Post by: BT-loader on July 01, 2007, 04:24:04 am
I just installed Coppermine 1.4.10.  I followed your instructions to change the database and upload the files.
I don't see any option to give permissions to a group either.
Thanks in advance for your help.
Same here...  :(
Title: Re: Upload permission in albums on group basis
Post by: aunrea on July 12, 2007, 03:54:41 pm
I have this mod installed and work fine except 1 thing:

Some of my members are in the Registered group and the Design Team group (I created) but they can only upload to Register group albums and not Design Team groups. Since I have my gallery bridged with phpbb I can not edit gallery profiles to make them only in the design team group and it would be annoying if I have to unbridge each time I need to add someone to the design team group.

The website is at http://gallery.chscrapbooks.com and the test account is:

username: searlyn
password: 123456

searlyn is in the design team group and the albums in the Design Team category have Design Team group permissions only.
Title: Re: Upload permission in albums on group basis
Post by: aunrea on July 16, 2007, 02:29:09 am
I have this mod installed and work fine except 1 thing:

Some of my members are in the Registered group and the Design Team group (I created) but they can only upload to Register group albums and not Design Team groups. Since I have my gallery bridged with phpbb I can not edit gallery profiles to make them only in the design team group and it would be annoying if I have to unbridge each time I need to add someone to the design team group.

The website is at http://gallery.chscrapbooks.com and the test account is:

username: searlyn
password: 123456

searlyn is in the design team group and the albums in the Design Team category have Design Team group permissions only.

Does anyone know what the problem is?
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on July 16, 2007, 07:19:40 am
This is strange. Can you provide me with the admin un/pass via PM?
Title: Re: Upload permission in albums on group basis
Post by: aunrea on July 19, 2007, 01:20:45 pm
I have to set it to all registered members can upload to the album. I need to let the design team upload to their albums. I can't wait. I hope someone can still find a solution because this plug-in sounds great if I could get it to work properly. Thanks for the help so far.
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on August 12, 2007, 10:46:18 am
I have been spending time during vacation to see if i could see a way to get this mod to do what i want but i keep bumping into this wall over and over again. I can't code  :-\.

So, i am stuck with my request regarding this mod. To have it modified so you can set upload rights for a group and even (when needed) to a single person within a group. I realise Abbas is a busy man so i look to the others devs how might fancy a challenge  ;).

I hope you all had a good vacation ;) i sure know my world jamboree was loads of fun!
Title: Re: Upload permission in albums on group basis
Post by: roultras on October 11, 2007, 04:50:29 pm
Thanks for the mod, it really helped me.

I have a problem and I ask for your help: I also installed a few days ago another mod from Abbas, the one who made it posible to have moderators for each album ( http://forum.coppermine-gallery.net/index.php?topic=26218.0 ).

I installed this mod and after that my problem is that i can't have different groups in charge of moderating and of uploading. If I allow for example "registered" group to upload photos, then the moderator option puts registered users in charge of moderating the albums.
Same thing happens if I allow guests to upload, they are allowed also to moderate.

I am a newbie here, if someone can tell me what to do I would apreciate it.
Title: Re: Upload permission in albums on group basis
Post by: roultras on October 11, 2007, 11:53:11 pm
sorry, it was my bad, i oerlooked one of the instructions...
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on October 12, 2007, 02:33:12 pm
Please do not cross post, i.e. if you have an issue with another mod then post in respective thread.

@Hein: I got time to look into your issue. Initially i thought that its easy and straight forward but i was wrong. When i actually started coding, i found that its quite complex. So i am afraid you will have to either drop the idea or wait longer  :-[
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on October 12, 2007, 03:32:12 pm
Abbas i appreciate your effort. If you don't mind i am prepared to wait for it. I believe it is a valuable option to have in this mod. Thanks again for your time and effort  ;)
Title: Re: Upload permission in albums on group basis
Post by: Gephri on December 18, 2007, 08:39:45 pm
I've been silently watching this thread in hopes of Heins' request getting working.  I too would like this.
Title: Re: Upload permission in albums on group basis
Post by: Gephri on December 19, 2007, 06:07:59 pm
Abbas - is it possible to use your Upload Permission In Albums on Group Basis along with MiniCMS (http://forum.coppermine-gallery.net/index.php?topic=15543.0)

What I'm trying to do is set up vertical management (Group can manage a category, its sub category(s) and albums along with using MiniCMS for each).

I think this can be done if your "...Group Basis" can be applied to MiniCMS.

thanks
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on December 21, 2007, 06:53:26 am
Never tried doing so - Please try it yourself and report back.
Title: Re: Upload permission in albums on group basis
Post by: Gephri on December 21, 2007, 08:11:59 am
in this case, i'm just the concept guy - no idea how to code this. sorry
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on December 21, 2007, 10:11:13 am
Oh - i thought that you were asking whether the mod will work if MiniCMS plugin has been installed and hence i said you can try it.

So you want the mod to be applied to MiniCms plugin too... Well i have not seen or used that plugin at all so don't know. Maybe the creator of that plugin can help you.
Title: Re: Upload permission in albums on group basis
Post by: Joachim Müller on December 21, 2007, 05:51:55 pm
@Gephri: the MiniCMS plugin is not subject of this thread and should therefor not be discussed here. It is a very complex plugin, I doubt that it can be easily modified in the way you want. MiniCMS goes unsupported here - for support, visit cpg-contrib.org (http://cpg-contrib.org/thumbnails.php?album=1)
Title: Re: Upload permission in albums on group basis
Post by: mipavluk on February 07, 2008, 02:51:06 am
Excellent mod!!!
Thanks Abbas!
Title: Re: Upload permission in albums on group basis
Post by: mipavluk on February 07, 2008, 03:33:38 am
well... I have a problem...
Album Permisions: I choose the correct group for each album.
Group Permission: allowed public albums upload for the groups
I only have 2 groups, registered and designers.
Some albums for registered and some albums for designers.
but none of the two groups can upload images to their respective albums
I think I do something wrong... but I can't find my error... can you please help me?
thanks
Title: Re: Upload permission in albums on group basis
Post by: daverj on March 05, 2008, 01:29:28 am
I wanted to ask this before trying this mod, because if I understand the description correctly, it won't work the way I want it to.

But since I am new to Coppermine, I wanted to ask to be sure.

Background:
-- My site is Joomla based with Coppermine bridged to Joomla.
-- Post groups are enabled, so all my groups come from Joomla.
-- Members are each in only one group. There are no secondary groups in Joomla

I wish to have 2 categories, each with several albums.

Any group from Registered and up can see all albums.

Members of the Registered group should be able to upload to the albums in one category

Members of the Publishers group should be able to upload to albums in either category.

If I understand the mod correctly, then I can set Registered users to upload to albums set for them, and publishers can upload to albums set for them, but publishers would not be able to upload to the albums set for Registered users.

Is this correct?

If this is true, is there another way to allow anybody but guests to upload to one set of albums but only members of a certain group to upload to other albums? (everybody except guests gets to see everything)
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on March 05, 2008, 05:46:11 am
If I understand the mod correctly, then I can set Registered users to upload to albums set for them, and publishers can upload to albums set for them, but publishers would not be able to upload to the albums set for Registered users.

Is this correct?

Yes, this is correct.

Quote
If this is true, is there another way to allow anybody but guests to upload to one set of albums but only members of a certain group to upload to other albums? (everybody except guests gets to see everything)

I am afraid no. The mod only supports one group at a time.
Title: Re: Upload permission in albums on group basis
Post by: daverj on March 05, 2008, 09:36:53 pm
Quote
I am afraid no. The mod only supports one group at a time.

Nuts!

OK, I downloaded the mod in order to look at the code in the hopes that maybe I could modify it further to do what I need.

I noticed a couple of things that surprised me, and one that might allow me to do what I need.

1 - In modifyalb.php, in the added function "form_upload_group" it looks as if a hidden form field is created instead of the dropdown list if the Config option "Allow Private Albums" is not enabled.

-- if this is true, why? I thought that "Allow Private Albums" is an option controlling who can see albums, and that if it is turned off then all albums are publicly viewable, but that it has nothing to do with who can upload to albums.

-- I also wonder if this might explain some of the posts earlier in this thread where people installed the mod and never saw the dropbox to select the group. Perhaps they had "Allow Private Albums" turned off.

2 - in that same function it looks like users have the ability to select an upload group for the albums they create in their own user gallery.

-- This surprised me, but I guess it's a way for users to create an album (public or private) that they want other members to be able to upload to

3 - It looks like if the "upload group" field is set to "0" for an album then uploads are not restricted to a specific group and any group that is allowed public uploads would be able to upload to that album.

-- If this is true, then it solves my problem. I could make the albums in one category set this way, with the upload group field set to "0" and members of both the Registered group and the Publishers group would be able to upload to them (as well as any other group that has public uploads allowed). I could then set the upload group field in the other albums to allow only the Publishers group to upload to those albums. The result would be that Publishers can then upload to any albums in the public section and Registered users can upload only to some of those albums. If that works, it is exactly what I need.


Am I understanding these three things correctly?
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on March 06, 2008, 08:56:14 am
Its been long time since i last looked at the mod code - so i almost forgot everything (codewise) :). I will again have to go through the code and come up with answers to your questions.
Title: Re: Upload permission in albums on group basis
Post by: daverj on March 06, 2008, 04:19:04 pm
If it's too much trouble, don't worry about it.

 It looks like it's easy enough to install, and then remove if it won't do what I need or I can't figure out how to make the changes I need.
Title: Re: Upload permission in albums on group basis
Post by: daverj on March 06, 2008, 09:46:26 pm
OK, I went ahead and installed the mod. I copied your mods into the 1.4.16 versions of those files, since there seem to be a couple of updates in some of them.

The mod works well, and looks like it will do what I need. Though I will probably make a change to it relating to my question #1 above.

The dropdown list for who can upload does have as it's first choice "Everybody (public album)". So this means that I can have some albums set to allow everybody to upload (which in my case are only two groups, Registered and Publishers), and then set some other albums so only the Publishers group can upload to them.

The only glitch for me is what I suspected in question #1 above. The dropdown list is not shown in the album settings if the gallery is configured to not allow private albums. Being new to Coppermine I don't know if there was some specific reason that you coded it that way, and there would be some issues if it was used in a gallery set up without private galleries.

Unless there is a specific reason not to, I plan to modify the code so the dropbox is shown without taking the "allow private albums" config setting into consideration.

My personal preference for this gallery is that all albums are publicly viewable, but prevent normal members from uploading to certain ones.

==========

So, to answer my own questions (in case anybody else reading this is interested for their own galleries):

#1 - Yes, the option to set upload groups is not visible in the Album Properties page if the gallery is configured with "Allow Private Albums" turned off

#2 - No, it seems I was mistaken that users would be able to set this option on their own user galleries. I'll have to go back and re-read the code I mentioned. I must have misunderstood what it was doing.

#3 - Yes, the default setting for the upload group is "Everybody" which lets you set some albums for all users to upload to and set other albums so only members of a given group can upload to them.
Title: Re: Upload permission in albums on group basis
Post by: daverj on March 06, 2008, 10:31:47 pm
Well, I looked at the code again and now I see why it isn't showing up for non-admins in their user galleries, but I still have some confusion since it looks like code was added to do that and then circumvented elsewhere.

In the top of modifyalb.php is this code which makes sure that form field is only shown to admins:

Code: [Select]
if (GALLERY_ADMIN_MODE) {
  $data[] = array('Which group can upload photos', 'upload_group', 8);
}

But further down, in the function "form_upload_group" is the following code in an IF/ELSE statement:

Code: [Select]
    if (GALLERY_ADMIN_MODE) {

            .... (I removed the code here to make this post smaller) ....

    } else {
        $options = array(0 => $lang_modifyalb_php['public_alb'],
            FIRST_USER_CAT + USER_ID => $lang_modifyalb_php['me_only'],
            );
        $result = cpg_db_query("SELECT group_id, group_name FROM {$CONFIG['TABLE_USERGROUPS']} WHERE group_id IN " . USER_GROUP_SET);
        while ($group = mysql_fetch_array($result)) {
            $options[$group['group_id']] = sprintf($lang_modifyalb_php['groupp_only'], $group['group_name']);
        } // while
    }

That's the part that confused me, and I mentioned in question #2 above. It seems to create that dropbox for non-admins in the album settings for private galleries. When I discovered the other code up above that only adds that dropbox to the page when in Admin Mode, I understand now why I didn't see the dropbox while logged in as a regular user with a private album. But it's still confusing why the code shown above exists at all since it will never be used.

There was also some commented out code above it in the section used to create the field for admins, so I am kind of guessing that while you were creating this mod you had this feature in mind, but then disabled it and never removed the extra code.
Title: Re: Upload permission in albums on group basis
Post by: daverj on March 06, 2008, 10:44:30 pm
I guess new members here can't modify their own posts.

I forgot to add to the above post that just above the IF/ELSE block I quoted (the second block of code on the previous post) is the statement that is preventing this form field from showing up on sites that have "allow private albums" turned off:

Code: [Select]
    if (!$CONFIG['allow_private_albums']) {
        echo '        <input type="hidden" name="' . $name . '" value="0" />' . "\n";
        return;
    }
Title: Re: Upload permission in albums on group basis
Post by: luigi72 on August 14, 2008, 03:49:13 pm
Hi.

I have installed  Coppermine Photo Gallery 1.4.18 (stable). I would like to modify permissions for registered users in categories or galleries, that users can create their private albums (and they can upload their files, photos, albums). How can I modify that or what and where to modify?

Thanks for quickly answer.
Title: Re: Upload permission in albums on group basis
Post by: Hein Traag on August 14, 2008, 04:41:47 pm
Get 1.4.19 and upgrade.
Title: Re: Upload permission in albums on group basis
Post by: luigi72 on August 17, 2008, 10:14:59 pm
Sorry, but ver.1.4.19 is "only" a security update and not for modify permissions... Or I mislead?
Title: Re: Upload permission in albums on group basis
Post by: Joachim Müller on August 24, 2008, 04:33:17 pm
Do not try to discuss the need to update here. Just do as suggested and upgrade!
Title: Re: Upload permission in albums on group basis
Post by: luigi72 on November 27, 2008, 03:07:03 pm
Hi,

I have a second problem.

I am the administrator for my coppermine gallery. With categories i have not problem, but with albums I have a big problem. If I want create new album into the categorie and when I push the albums button, he write me a mystake "You have not permissions". What can be bad?

Thanks for quickly answer.

Sorry for my english  :(
Title: Re: Upload permission in albums on group basis
Post by: luigi72 on November 27, 2008, 03:11:14 pm
This category is not public (is not for all users, is just for me).
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on November 28, 2008, 05:54:52 am
By albums button you mean "Albums" menu in top admin menu?
Title: Re: Upload permission in albums on group basis
Post by: luigi72 on December 01, 2008, 07:35:01 pm
Yes.
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on December 02, 2008, 06:21:49 am
Enable debug mode and see on what line the error is coming. Also attach your albmgr.php file to this thread.
Title: Re: Upload permission in albums on group basis
Post by: luigi72 on December 02, 2008, 10:41:20 am
Hi,

the error is (in slovak language):

Súbor: /domains1/gh290100/public/www_root/galeria/albmgr.php - Riadok: 348
(File: /domains1/gh290100/public/www_root/galeria/albmgr.php - Line: 348)

Info for coppermine support:

Code: [Select]
USER:
------------------
Array
(
    [ID] => d565d3d72921b3aed7b7aa85e7dadd5b
    [am] => 1
    [lang] => slovak
    [liv] => Array
        (
        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => ********
    [groups] => Array
        (
            [0] => 1
        )

    [disk_max] => 0
    [disk_min] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 1
    [ufc_max] => 3
    [ufc_min] => 3
    [custom_user_upload] => 0
    [num_file_upload] => 5
    [num_URI_upload] => 3
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 3
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg14x_filetypes; (0s)
    [1] => select * from cpg14x_plugins order by priority asc; (0s)
    [2] => delete from `gh290102db`.cpg14x_sessions where time<1228206323 and remember=0; (0s)
    [3] => delete from `gh290102db`.cpg14x_sessions where time<1227000323; (0s)
    [4] => select user_id from `gh290102db`.cpg14x_sessions where session_id = '87ae45617e32965588d43cdae37c1e69' (0s)
    [5] => select user_id as id, user_password as password from `gh290102db`.cpg14x_users where user_id=1 (0s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `gh290102db`.cpg14x_users AS u INNER JOIN `gh290102db`.cpg14x_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0s)
    [7] => SELECT user_group_list FROM `gh290102db`.cpg14x_users AS u WHERE user_id='1' and user_group_list <> ''; (0s)
    [8] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg14x_usergroups WHERE group_id in (1) (0s)
    [9] => SELECT group_name FROM  cpg14x_usergroups WHERE group_id= 1 (0s)
    [10] => update `gh290102db`.cpg14x_sessions set time='1228209923' where session_id = '87ae45617e32965588d43cdae37c1e69' (0s)
    [11] => SELECT user_favpics FROM cpg14x_favpics WHERE user_id = 1 (0s)
    [12] => DELETE FROM cpg14x_banned WHERE expiry < '2008-12-02 11:25:23' (0s)
    [13] => SELECT * FROM cpg14x_banned WHERE (ip_addr='84.47.83.35' OR ip_addr='84.47.83.35' OR user_id=1) AND brute_force=0 (0s)
    [14] => SELECT COUNT(*) FROM cpg14x_pictures WHERE approved = 'NO' (0s)
)

==========================
GET :
------------------
Array
(
    [cat] => 0
)

==========================
POST :
------------------
Array
(
)

==========================
VERSION INFO :
------------------
PHP version: 5.2.4 - OK
------------------
mySQL version: 5.0.45
------------------
Coppermine version: 1.4.18(stable)
==========================
Module: GD
------------------
GD Version: bundled (2.0.34 compatible)
FreeType Support: 1
FreeType Linkage: with freetype
T1Lib Support:
GIF Read Support: 1
GIF Create Support: 1
JPG Support: 1
PNG Support: 1
WBMP Support: 1
XPM Support:
XBM Support: 1
JIS-mapped Japanese Font Support:

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 5.0.45
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /tmp/mysql.sock
MYSQL_INCLUDE -I/usr/local/mysql/include/mysql
MYSQL_LIBS -L/usr/local/mysql/lib/mysql -lmysqlclient 
==========================
Module: zlib
------------------
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.3
Linked Version 1.2.3
==========================
Server restrictions (safe mode)?
------------------
Directive | Local Value | Master Value
safe_mode | On | On
safe_mode_exec_dir | no value | no value
safe_mode_gid | Off | Off
safe_mode_include_dir | no value | no value
safe_mode_exec_dir | no value | no value
sql.safe_mode | Off | Off
disable_functions | exec, system, pXhpinfo, passthru, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate,shell_exec,popen,dl | exec, system, pXhpinfo, passthru, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate,shell_exec,popen,dl
file_uploads | On | On
include_path | . | .
open_basedir | /domains/ironmuscle.sk/public:/domains1/gh290100/public:/tmp | /domains:/domains1:/tmp
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from | no value | no value
sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 5 | 5
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.133 seconds - 15 queries in 0 seconds - Album set : ; Meta set: ;
Title: Re: Upload permission in albums on group basis
Post by: luigi72 on December 03, 2008, 10:35:57 am
Can you help me?

 :'(
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on December 05, 2008, 06:04:43 am
I see that you have modified albmgr.php (out of the requirements of this mod). You have replaced some important code around line 348 which is causing the error.
Title: Re: Upload permission in albums on group basis
Post by: mahdi1234 on January 17, 2009, 11:26:31 pm
Hi Abbas,

do you think this could be extended to prevent users from commenting in particular album? Same rules would apply i.e. user group can upload/comment or cannot do that.

thanks,
mahdi
Title: Re: Upload permission in albums on group basis
Post by: Abbas Ali on January 21, 2009, 05:28:20 am
Yes, I think this can be done with some additional coding in comments related scripts. Unfortunately i don't have enough time now to do this myself :(.
Title: Re: Upload permission in albums on group basis
Post by: drklain on February 27, 2009, 04:15:55 am
Your mod looks like exactly what I'm looking for, but I can't find where to download it!  I've downloaded the two mod packs on the download page of the coppermine website, but neither appears to have this mod in it.  Can you tell me where it is?
Title: Re: Upload permission in albums on group basis
Post by: Joachim Müller on February 27, 2009, 07:08:32 am
The mod is attached the the very first posting in this thread.
Title: Re: Upload permission in albums on group basis
Post by: skuutor on April 15, 2009, 07:41:24 am
Can this mod be used to allow users (in a designated group) to upload to albums in other users' galleries?  Or is this only for albums in public galleries?
Title: Re: Upload permission in albums on group basis
Post by: Joachim Müller on April 15, 2009, 11:03:38 am
Can this mod be used to allow users (in a designated group) to upload to albums in other users' galleries?
No
  Or is this only for albums in public galleries?
Yes
Title: Re: Upload permission in albums on group basis
Post by: phorce1 on December 17, 2009, 01:42:25 am
Just wanted to thank you for this. Just applied the mod by hand and it does exactly what I need for sharing a CopperMine install between 2 groups of people with overlapping interests and some overlapping members.