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
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 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] :
<?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.
Offline
Cheers!
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)
You can define a default user who does not see the HD
Offline
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
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)
Offline
Many, many thanks!
That did the trick!
Thank You!
:-)
Offline
Is there a better way to do this for Piwigo 2.7.1?
Offline
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
Offline
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 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