OK, this is actually a bug that existed both in the stable as well as the devel branch. When a user is member of a group that doesn't have the privilege to upload to public albums, but has the privilege to have a personal gallery, the upload link is not being displayed. When going to the upload screen manually, the user gets an error message.
I updated both branches of the SVN repository with the fixes below. Fixes will therefor be in cpg1.4.11 and cpg1.5.0 (once they get released).
To fix this manually, perform the steps outlined below:
1) upload.php
Edit upload.php, findif (!USER_CAN_UPLOAD_PICTURES) {
and replace withif (!USER_CAN_UPLOAD_PICTURES && !USER_CAN_CREATE_ALBUMS) {
This will make sure that the upload screen doesn't show an error message in the first place if public uploads are off and personal galleries are on.
Explanation for advanced users: the constant USER_CAN_CREATE_ALBUMS is named a bit misleading for historical reasons. Actually, it determines if a user can have a personal gallery.
Findif (!count($public_albums_list) && !count($user_albums_list)) {
cpg_die (ERROR, $lang_upload_php['err_no_alb_uploadables'], __FILE__, __LINE__);
}
and replace withif (!count($public_albums_list) && !count($user_albums_list)) { // there's no album where the user is allowed to upload to
if (USER_CAN_CREATE_ALBUMS) {
cpg_die (ERROR, $lang_upload_php['err_no_alb_uploadables'].'<br /> <br /><a href="albmgr.php" title="'.$lang_user_admin_menu['albmgr_title'].'" class="admin_menu">'.$lang_user_admin_menu['albmgr_lnk'].'</a>', __FILE__, __LINE__);
} else {
cpg_die (ERROR, $lang_upload_php['err_no_alb_uploadables'], __FILE__, __LINE__);
}
}
This will fix uploading and remind users who are allowed to have a personal gallery that they need to create at least one album before being able to upload a file.
2) include/themes.inc.php
Edit include/themes.inc.php, find if (!USER_CAN_UPLOAD_PICTURES) {
template_extract_block($template_sys_menu, 'upload_pic');
}
and replace with if (!USER_CAN_UPLOAD_PICTURES && !USER_CAN_CREATE_ALBUMS) {
template_extract_block($template_sys_menu, 'upload_pic');
}
This will fix the visibility of the upload link.
3) Check your custom theme
If you have created a custom theme (i.e. one that doesn't come with Coppermine by default), you will have to make sure to fix the issue as well. Open themes/yourtheme/theme.php, try to findfunction theme_main_menu($which)
If you don't have that line, then you're fine and won't have to perform additional steps. If you do have that function defined in your theme, do as suggested in step 2 (searching for if (!USER_CAN_UPLOAD_PICTURES) { and applying the suggested fix).
Finally, upload your changed files and test-drive everything.
@devs: please confirm
Cheers
Joachim