Error on clicking "upload file" when user is of group "Registered" Error on clicking "upload file" when user is of group "Registered"
 

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]

Main Menu

Error on clicking "upload file" when user is of group "Registered"

Started by fdcusa, February 08, 2015, 10:59:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

fdcusa

Install with (0) modifications.

When "upload file" selected, get error "sorry there is no album where you are allowed to upload files."

User: rwhite
Group: Registered

Album settings:
Album Owner:  fdcusa
Album can be viewed by:  Everybody (public album)
Password protect this album: No
Visitors can upload files: Yes

Registered User Group Settings:
Public albums upload: Allowed (Yes), Approval (Yes)
Personal gallery: Allowed (no), approval (no)
Group Quota: 1024 KiB (user rwhite currently has 0 KiB space used)

I have reviewed the online manual for the sections referenced above to (for me) no avail.

fdcusa

Debug info after clicking "upload file" and display of error message attached

allvip

Users must create first an album in My Gallery if they are not allowed to upload in public albums.


Go to Album proprities (for every album) AND click Visitor can upload YES.
Visitors (registred) can upload files - YES by default for every album http://forum.coppermine-gallery.net/index.php/topic,68707.0.html

In Users - Groups you can set permissions for every Group (guests, registred, admin).

FOR USERS TO BE ALLOWED TO CREATE ALBUMS in a category:

You you go to File - Category - edit category - users allowed to create albums - click registred - click Create/Update Category then the users from group registred will be allowed to create albums in that category too.

allvip

Sorry I edited the post a few times (made some mistake).
Read again the above reply.

fdcusa

I appreciate your time to respond.

My goal is not to let Registered users create their own albums - only able to upload to one specific existing album.

I did change the settings according to your notes, including allowing Registered to create an album.  Now the error is same "Sorry there is no album where you are allowed to upload files" as before the change, followed by the "Create/ order my albums" button, showing error occurred in upload.php line 536.  Before allowing Registered to create an album, the error occurred on line 538.

I have attached captures of the applicable album properties, the group manager page, and the applicable user (rwhite) settings.

allvip

Try this plugin and see if it works HTML5 multi-file upload plugin http://forum.coppermine-gallery.net/index.php/topic,75927.0.html

Can you post a link to your gallery and make a users name test, password test, group Registred so I can try it?

fdcusa

test/test created, click globe at left under my login id.

Installed the mentioned plug-in.  Made no difference with rwhite logged in.  With my admin login, it accepted the chosen file, uploaded, and then oddly screen refreshed to show "Login" in top menu and Error you don't have permission to access this page editpics.php line 79.

allvip

Quote from: fdcusa on February 08, 2015, 02:22:55 PM
I have attached captures of the applicable album properties, the group manager page, and the applicable user (rwhite) settings.

I do not understand in album_properties.png you have Choose album fdcusa(Users uploads), Album title User Uploads. It should be the same for Choose Album and Album Title.
Please choose from the drop down menu of Choose Album - User Uploads and try again.

allvip

When you change the Album Title in Album properties you must click Update album and then they will be the same.
I don't know if you understant what I mean.

fdcusa

If I change Album Title to "(fdcusa) User Uploads", then Choose Album shows "(fdcusa) (fdcusa) User Uploads", which implicates "Choose" Album shows the owner of the album followed by the Album Title.  Attached screenshot showing Choose Album list expanded before editing the Album Title.  Trying upload file under rwhite after the change - same error.


allvip

Now you have  (fdcusa)  (fdcusa)  User Uploads and fdcusa) User Uploads. Still not the same.

When you click choose album and you choose  (fdcusa) User Uploads the page refreshes by itself and you should have

Choose album - (fdcusa) User Uploads
Album title - (fdcusa) User Uploads
Category fedusca

If you want to change Album title, type a new name for Album title and click update. Then Choose Album and Album title will have both the same title.

Can you please make a make users test an admin only for 10 minutes?. I want hack or anything. I'm a trusted member. Is optional. Only if you want.

ron4mac


Αndré

From what I see in the screenshots, you created an album "User uploads" in the user gallery of user "fdcusa" and enabled public uploads for that album, right?

Please try to create (as admin) an album outside the user galleries category (category ID other than "1"). I assume it will work as expected.

fdcusa

Thank you, allvip, ron4mac, and André for your assistance!

I had no control over the parens being at the beginning of the Album name - from screenshot in post #9 it is apparent that Coppermine displays the category name ahead of album names in the dropdown list under album properties.

André is on target.  I moved all the albums into *no category*, out of my user "fdcusa" category, enabled visitor uploads only for two of the albums, and now a Registered user clicks "Upload File" and is presented with the dropdown to select the album, which properly shows only the two albums I have ticked Visitor uploads YES.

Wonderfully simply application, and thank you all!

Αndré

Note to myself:

The option "Visitors can upload files" should either be disabled or hidden in the album properties for albums in the user galleries. At least (and in any case), it should be documented that it doesn't take effect as long as the album resides in the user galleries category.

Corresponding code:
Code (upload.php) Select
if (!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 />&nbsp;<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__);
    }
}

(it checks for albums in public categories where the user is allowed to upload files and albums in the user's own user gallery).


IMHO there's nothing to fix regarding the current functionality (= no bug or lack of feature). The user galleries category would be nonsense if users could upload files to other users' albums.