forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Permissions & Access Rights => Topic started by: larrywalker on June 29, 2005, 03:58:19 pm

Title: upload only to albums user can view.
Post by: larrywalker on June 29, 2005, 03:58:19 pm
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. 
Title: Re: upload only to albums user can view.
Post by: Nibbler on June 29, 2005, 05:00:01 pm
Try this fix:

open upload.php and find

Code: [Select]
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

Code: [Select]
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.