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

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

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.