Advanced search  

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

Pages: [1]   Go Down

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

0 Members and 2 Guests 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.018 seconds with 19 queries.