Announcement

  •  » Requests
  •  » Who can download this photo?

#1 2014-11-18 21:16:43

rstevens
Member
2014-11-17
16

Who can download this photo?

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

 

#2 2014-11-18 21:17:28

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3277

Re: Who can download this photo?

[extension by plg] Download Permissions (by album, not by photo)

Offline

 

#3 2014-11-18 21:45:53

rstevens
Member
2014-11-17
16

Re: Who can download this photo?

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

 

#4 2014-11-18 22:36:16

flop25
Piwigo Team
2006-07-06
7037

Re: Who can download this photo?

that's the HD attribute per user that you're talking about


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#5 2014-11-19 00:07:20

rstevens
Member
2014-11-17
16

Re: Who can download this photo?

>>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

 

#6 2014-11-19 07:45:50

flop25
Piwigo Team
2006-07-06
7037

Re: Who can download this photo?

Nope The download icon should not be there. Certainly an extension messing things up


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#7 2014-11-19 22:10:47

rstevens
Member
2014-11-17
16

Re: Who can download this photo?

How can I contact the author of this extension to get him or her to fix the problem?

Offline

 

#8 2014-11-22 22:49:34

sport
Member
2014-03-16
93

Re: Who can download this photo?

Same here. when not logged in

Code:

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

Code:

  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

 

#9 2014-11-22 23:50:39

rstevens
Member
2014-11-17
16

Re: Who can download this photo?

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

 

#10 2014-11-23 14:30:51

sport
Member
2014-03-16
93

Re: Who can download this photo?

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

Code:

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

 

#11 2014-11-24 19:22:14

rstevens
Member
2014-11-17
16

Re: Who can download this photo?

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

 

#12 2014-11-24 23:29:49

rstevens
Member
2014-11-17
16

Re: Who can download this photo?

User sport, thanks! Do you know how I can set "High definition enabled" (permission to download) for the group RegisteredUsers?

Offline

 

#13 2014-11-25 01:29:33

sport
Member
2014-03-16
93

Re: Who can download this photo?

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

 

#14 2014-11-25 18:34:39

rstevens
Member
2014-11-17
16

Re: Who can download this photo?

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

 

#15 2014-11-25 19:12:48

flop25
Piwigo Team
2006-07-06
7037

Re: Who can download this photo?

The answer has already been given ;change the default user config set as Guest by default, using the local configuration


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 
  •  » Requests
  •  » Who can download this photo?

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact