plegall / Piwigo-community

11 stars 24 forks source link

Uploaded pictures of "visitors" users always with pending status and Admin "rights" #13

Open croulibri opened 8 years ago

croulibri commented 8 years ago

In my configuration, all members have high trust state, and so their pictures are meant to be visible immediately (without moderation of the admin / webmaster).

When a member with webmaster / admin rights upload pictures with the web form flash uploader, the pictures are immediately visible. But when a user with visitor rights upload picture with the web form flash uploader, the pictures are not visible. Indeed, they are not visible in the community plugin admin page as "pending pictures", but just on the batch manager part when looking for "last import", they are shown as "pending" in "admin view only". Changing the "rights" (from Admin to family for instance) solve the problem. But if the same user with visitor rights upload pictures with pLoader, so pictures are put with the correct "rights" chosen by the member (everybody, friends, family,...) and so are visible immediately to the expected people.

Why uploading through the web form flash up-loader necessarily puts picture in admin view only ? Is there something to do to change this behavior ? (see http://piwigo.org/forum/viewtopic.php?pid=155353#p155353 and http://fr.piwigo.org/forum/viewtopic.php?id=26537)

sakanaou commented 7 years ago

I noticed the same behavior. Looking into the images database, I noticed that the images in question have a "level" of 16 while normal "administrator" level is 8. The code in question seems to be https://github.com/plegall/Piwigo-community/blob/master/add_photos.php#L50 and https://github.com/plegall/Piwigo-community/blob/master/main.inc.php#L671 In my understading it must be set to 16 only in case of moderation. And 0 (or the equivalent of the user's permission who uploads) otherwise.