upload only to albums user can view. upload only to albums user can view.
 

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]

Main Menu

upload only to albums user can view.

Started by larrywalker, June 29, 2005, 03:58:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

larrywalker

I am tring to make a new group which can only upload to albums in their category. They can only view the right album to which there group has rights. When they upload a file they can use the pull down and pick an album which they cant view. Then the picture is in the wrong album which they cant view. Am I missing a setting ? If I remove the setting in other albums that allow vistors to upload then the other group cant upload, But the albums dont show up in the other users pull down when uploading as I would expect.


I have no public albums if that matters.

PS great program. 

Nibbler

Try this fix:

open upload.php and find

if (GALLERY_ADMIN_MODE) {
    $public_albums = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
} else {
    $public_albums = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " AND uploads='YES' ORDER BY title");
}


replace that code with this code

if (GALLERY_ADMIN_MODE) {
    $public_albums = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " ORDER BY title");
} else {
$visibility = $CONFIG['allow_private_albums'] ? 'AND visibility IN (0,' . implode(',', $USER_DATA['groups']) . ')' : '';
$public_albums = db_query("SELECT aid, title FROM {$CONFIG['TABLE_ALBUMS']} WHERE category < " . FIRST_USER_CAT . " AND uploads='YES' $visibility ORDER BY title");
}


That should only display as options the albums that the user can see.