Announcement

#1 2009-02-21 18:02:59

Aces
Guest

[resolved] Permission to view high quality pictures

Hey!

I have a problem. I dont want users who arent members to be able to view the high quality pictures. This was simply fixed with just editing the "guest" premission and remove the high quality options.
But i want everyone who registers to be able to view high quality pictures. But to do that i have to manualy set the high quality option on every account?

//Aces

 

#2 2009-02-21 21:53:27

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13182

Re: [resolved] Permission to view high quality pictures

In the past (Piwigo 1.6) such a behavior was possible, because the $conf['newuser_default_enabled_high'] was a configuration parameter, but since [Bugtracker, ticket 578, fixed] User guest must be real user we take the enable_high setting from the guest user. So if you have set "high definition" enabled for guest user, new registered users will have the same value.

Adding such a feature can be done in a simple plugin:

1. [Administration>Specials>Plugins] install and activate the plugin "LocalFiles Editor" (provided by default with Piwigo 2.0.0)

2. [Administration>Specials>Plugins>LocalFiles Editor>Personal Plugin] :

Code:

<?php
/*
Plugin Name: Personal Plugin
Version: 1.0
Description: Personal Plugin
Plugin URI: http://piwigo.org
Author: Pierrick LE GALL
Author URI: http://le-gall.net/pierrick/en/blog
*/

add_event_handler('register_user', 'enable_high');

function enable_high($register_user) {
  $query = "
UPDATE ".USER_INFOS_TABLE."
  SET enabled_high = 'true'
  WHERE user_id = ".$register_user['id']."
;";
  pwg_query($query);
}
?>

and "save file"

3. [Administration>Specials>Plugins] install and activate the plugin "Personal Plugin"

Your user "guest" has high definition disabled but any registered user gets automaticaly the high definition access.


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

#3 2009-02-22 13:50:08

Aces
Guest

Re: [resolved] Permission to view high quality pictures

Cheers!

 

#4 2011-01-27 11:07:32

RobertRorian
Guest

Re: [resolved] Permission to view high quality pictures

Alright, but no .. how to achieve this, without messing with the main piwigo files:
- guest user can't load/see HD photos
- now he registers, activates account and voila - he can! (without changing permissions manunally by admin)

Note: the code for personal plugin posted above didn't work (Piwigo 2.1.5)

 

#5 2011-01-27 11:36:35

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6753

Re: [resolved] Permission to view high quality pictures

You can define a default user who does not see the HD


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#6 2011-01-27 12:26:19

RobertRorian
Guest

Re: [resolved] Permission to view high quality pictures

ddtddt wrote:

You can define a default user who does not see the HD

Alright,
- Guest user can't see HD photos -and it's set via config
- when NewUser register/acivates account he is auto assign to 'my_group' (which is set to default) but he don't get the 'High definition' property



anyway in Users/Manage i have as one this username field
guest
[guest]
[default values]

and few cells later in col 'Properties' it's value is blank null, maybe that's the problem, maybe all new users got [default values] settings.. I really have no idea

 

#7 2011-01-27 21:32:23

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6753

Re: [resolved] Permission to view high quality pictures

You create a user with permissions that you want to see attributed to the new member

in your data base you look ID  (exemple 12)

and in local file you add

$conf['default_user_id'] = 12 ;   //(with localfile editor)


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#8 2011-02-02 09:36:21

RobertRorian
Guest

Re: [resolved] Permission to view high quality pictures

Many, many thanks!
That did the trick!

Thank You!

 

#9 2011-02-02 12:12:39

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6753

Re: [resolved] Permission to view high quality pictures

:-)


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#10 2014-11-19 00:40:46

rstevens
Member
2014-11-17
16

Re: [resolved] Permission to view high quality pictures

Is there a better way to do this for Piwigo 2.7.1?

Offline

 

#11 2014-11-19 07:51:41

flop25
Piwigo Team
2006-07-06
6918

Re: [resolved] Permission to view high quality pictures

rstevens wrote:

Is there a better way to do this for Piwigo 2.7.1?

Please do not answer on solved thread. The default user can still be changed in the local configuration since that's an advanced feature


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

 

#12 2014-11-20 02:09:48

sport
Member
2014-03-16
93

Re: [resolved] Permission to view high quality pictures

plg wrote:

In the past (Piwigo 1.6) such a behavior was possible, because the $conf['newuser_default_enabled_high'] was a configuration parameter, but since [Bugtracker, ticket 578, fixed] User guest must be real user we take the enable_high setting from the guest user. So if you have set "high definition" enabled for guest user, new registered users will have the same value.

Adding such a feature can be done in a simple plugin:

1. [Administration>Specials>Plugins] install and activate the plugin "LocalFiles Editor" (provided by default with Piwigo 2.0.0)

2. [Administration>Specials>Plugins>LocalFiles Editor>Personal Plugin] :

Code:

<?php
/*
Plugin Name: Personal Plugin
Version: 1.0
Description: Personal Plugin
Plugin URI: http://piwigo.org
Author: Pierrick LE GALL
Author URI: http://le-gall.net/pierrick/en/blog
*/

add_event_handler('register_user', 'enable_high');

function enable_high($register_user) {
  $query = "
UPDATE ".USER_INFOS_TABLE."
  SET enabled_high = 'true'
  WHERE user_id = ".$register_user['id']."
;";
  pwg_query($query);
}
?>

and "save file"

3. [Administration>Specials>Plugins] install and activate the plugin "Personal Plugin"

Your user "guest" has high definition disabled but any registered user gets automaticaly the high definition access.

THX..........

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact