Advanced search  

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]

Pages: [1]   Go Down

Author Topic: upload only to albums user can view.  (Read 4295 times)

0 Members and 1 Guest are viewing this topic.

larrywalker

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
upload only to albums user can view.
« 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. 
Logged

Nibbler

  • Guest
Re: upload only to albums user can view.
« Reply #1 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 19 queries.