Hello/Hi/Greetings,
I would like a "Who can download this photo?" feature so only authenticated users that I specify can download it, even if the "Who can see this photo?" option under Photos > Batch Manager > Single mode is set to Everybody.
Piwigo version: 2.7.1
PHP version: 5.4.x
Offline
[extension by plg] Download Permissions (by album, not by photo)
Offline
Thanks. I have the Download Permissions extension installed at http://www.pictures.me
Can you be more specific on how to solve the problem with the extension?
Currently, as I evaluate piwig.org, everyone can both view and download photos.
To restate, I want Everyone to view photos but only authenticated users to be allowed to download photos.
The algorithm would be something like:
Is the user authenticated? No, do not show the Download button.
Yes--Actually I'd like to go one step further and ask here, "Has the user reached his daily download quota?"
No, show the Download button and let the user download the photo.
Offline
that's the HD attribute per user that you're talking about
Offline
>>that's the HD attribute per user that you're talking about
You mean I login as admin and under Administration Home > Users I click Manage, click the checkbox for guest > edit and uncheck "High definition enabled"?
That works. The Download Photo button still shows for guests but when clicked the user is shown a page that says, " Access denied e".
How can I get it to be more friendly--perhaps take the user to a login page?
Offline
Nope The download icon should not be there. Certainly an extension messing things up
Offline
How can I contact the author of this extension to get him or her to fix the problem?
Offline
Same here. when not logged in
Access denied e
Its exactly what i want, with the download button, just a more user friendly message.
i have edited action.php on line 111
To
do_error(401, 'Access denied Only for members please register <a href="#" onclick="window.history.back();">Go Back to previous page</a>');
i now, its not the way but for now it does what i want ad the moment.
When logged in, it works nice and without problems.
Almost forgot.
i use the extension Custom Download Link
http://piwigo.org/ext/extension_view.ph … 93#rev5093
Last edited by sport (2014-11-22 23:12:01)
Offline
Thank you, user sport. I'll try your short-term fix. I wonder if your text can be improved:
Not: Access denied Only for members please register. Go Back to previous page
But: Not yet a member? Click here to register.
Also, would it be better to just send the user to the registration screen without having to first click a button? If so, can anyone post the code to do that?
Offline
Better is to give visitors a choice.
to go back to previous page, or a option to become a member.
What you can do is make a nice page with the extension "AdditionalPages".
and change in action.php on line 111 to
do_error(401, '<META HTTP-EQUIV="refresh" CONTENT="seconds;URL=the-other-url">
Set seconds to 0 if you want to redirect instandly, or set it to 5 seconds or longer if you want to show a short message.
Where the-other-url stands, you put your url.
Good luck.
Offline
No, your fix puts the meta tag outside of the </head> tag.
This works. I tested it. To redirect to the login page, in action.php replace:
do_error(401, 'Access denied e');
with:
$redirect_url = get_root_url().'identification.php';
redirect($redirect_url);
Last edited by rstevens (2014-11-24 21:08:10)
Offline
User sport, thanks! Do you know how I can set "High definition enabled" (permission to download) for the group RegisteredUsers?
Offline
no need to.
if a user is logged in, they can download the image.
and if i am not wrong, its always in the largest form what is on your server.
there is a extension what give options to download in different sizes.
Just try your download, and check the image size.
Last edited by sport (2014-11-25 01:36:03)
Offline
Hi user sport,
I just retested it several times.
When a new user registers, "High definition enabled" is not set. As I understand, this is because I purposely unchecked it for the guest user.
If the admin manually sets "High definition enabled" for registered users, they can download photos. If it isn't checked, after every time they click the Download button, logged-in registered users are brought to the login page.
Given "High definition enabled" is not set for the guest user, do you know how to modify the piwigo code so it gets set automatically for every new registered user?
Maybe there is a way to do this for all members of the group RegisteredUsers?
Thank YOU!
Offline
The answer has already been given ;change the default user config set as Guest by default, using the local configuration
Offline