Upload permission in albums on group basis Upload permission in albums on group basis
 

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

Upload permission in albums on group basis

Started by Abbas Ali, September 08, 2006, 10:07:26 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Abbas Ali

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


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
Chief Geek at Ranium Systems

nims

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

Abbas Ali

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.
Chief Geek at Ranium Systems

dem_

Dude you rock!, im gonna "install it" right now

dem_

 ::) Question.... This wont interfere with the personal albums of a user right?
dumb question i know

Abbas Ali

Chief Geek at Ranium Systems

dem_


jhietter

Thank you!  This is exactly what I needed & it works great!

simoslav

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

Nibbler


Abbas Ali

I haven't tested this mod with bridged cpg. Try it yourself and report back if it works well with bridging turned on.
Chief Geek at Ranium Systems

Frasse

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?

sigepjedi

I would also like to see moderators able to edit picture comments on this....

Joachim Müller

Your reply is not related to this mod. Comment moderation is an entirely different animal.

her_voodoo

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.

Abbas Ali

Did you modified/replaced your modifyalb.php file?
Chief Geek at Ranium Systems

her_voodoo

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.

her_voodoo

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 

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

Abbas Ali

PM me your gallery admin account. I will see what i can do.
Chief Geek at Ranium Systems

Marchello

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