Piwigo.org

You are not logged in. (Register / Login)

Announcement

#1 2011-06-30 16:32:39

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

unofficial mirror; allow users to modify their images

Hi there,

I am a Piwigo newbie; my impression is that Piwigo is extremely clean and powerful and it has various kinds of clients that my friends can use easily. Cool :P

As an independent developer I created a clone of the official SVN repository, and you can find it at

https://github.com/xmirror/piwigo

This clone doesn't contain the directory "extensions" directory which may be too big and which is put in a non-standard directory that shouldn't be converted correctly to git stuff. I am going to write some cron jobs to make the mirror is up-to-date.

Now I am working on my branch https://github.com/icyfork/piwigo/tree/icy-2.2 , which contains some patches to allow users to modify their images: Though Piwigo supports multiple users, its ACL prevents any uploaders to change meta data of their image. This may be a bit trouble, esp. when I have piwigo site used by some friends. I looked at Piwigo's plugin directory but I couldn't find a suitable extension, so I decided to give a try. I didn't look at Piwigo API, but I think the best way is "hard code". For example, Piwigo allows only Adminstrators/Webmaster to modify images, by the line

# file picture_modify.php
check_status(ACCESS_ADMINISTRATOR);

No way to provide a more flexible way here: the only way is to redefine "check_status", or modify "picture_modify.php"... (IMHO)

That's my first try. I hope that some guys here can give some helps/ideas

Thank you

Offline

#2 2011-07-03 11:54:49

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

Hi,

I've just written plugin to solve the problem

* Plugin page: [extension by icy] Icy Picture Modify
* The source tree: https://github.com/icy/icy_picture_modify

Any comments are highly appreciated.

Enjoy!

Offline

#3 2011-10-01 09:58:50

IGraham
Member
Location: UK
Registered: 2011-09-28
Posts: 183
Website

Re: unofficial mirror; allow users to modify their images

Hello icy

just installed your Icy Modify Picture 1.1 (IMP) - I'm using theme Pure Autumn
Definitely provides needed functionality, was slightly surprised such functionality was previously not implemented/needed.
With the theme I'm using IMP works, though is off set to the right of Piwigo - maybe by the left tool bar width.
IMP provides possibly more functionality than I'd want to present to some of my users. If your still developing this do you think it might be possible for the admin to deselect such things as the 'Linked albums' & 'Representation of albums' panels and within Properties panel the elements 'Creation date' & 'Who can see this photo'

IMP is quite usable as it is, thanks for having made it, but if you develop it then (for me) simplifying what the user can do would be good

Offline

#4 2011-10-01 11:45:00

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

Hi IGraham,

Thank you very much for your feedback. I am glad to hear that the plugin is useful at your side :)

I am still working  on the plugin, and the next  major task is to ensure that the plugin works with the coming release of Piwigo. After that, I will work to provide the administrator's panel of the plugin and support the features you've mentioned.

Thank you again for using IMP.

Best regards,

Last edited by icy (2011-10-01 11:54:44)

Offline

#5 2011-10-01 13:22:13

mol
Piwigo Team Germany
Location: germany
Registered: 2010-05-26
Posts: 108
Website

Re: unofficial mirror; allow users to modify their images

icy wrote:

Any comments are highly appreciated.

i use the IMP with the strpped theme, no problems.

Offline

#6 2011-10-07 17:31:07

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

Thanks for your feedback, *mol*.

FYI, the plugin is compatible with Piwigo 2.3.0. I've updated plugin information, so that new Piwigo won't complain about plugin's compatibility. It's time to work on the new feautures :)

Offline

#7 2011-12-16 14:02:11

IGraham
Member
Location: UK
Registered: 2011-09-28
Posts: 183
Website

Re: unofficial mirror; allow users to modify their images

Hello Icy

Was wondering how the development and 'new features' are coming on ?
I've had a slight grumble from a user that the extension colors the text fields dark grey and this makes entering info difficult. Though i suspect this is more to do with integration with the theme I'm using (Pure Autumn) than the extension itself.
Would be good to hear that your still developing the extension (fingers crossed)

Offline

#8 2011-12-16 14:13:57

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

IGraham wrote:

Hello Icy

Was wondering how the development and 'new features' are coming on ?
I've had a slight grumble from a user that the extension colors the text fields dark grey and this makes entering info difficult. Though i suspect this is more to do with integration with the theme I'm using (Pure Autumn) than the extension itself.

Yes I know this problem, and I don't have any efficien way to resolve it :(

Would be good to hear that your still developing the extension (fingers crossed)

Yes still. Please wait. More features require more works and time !!

Offline

#9 2011-12-29 15:23:33

plg
Piwigo Team
Location: Paris, France, Europe
Registered: 2002-04-05
Posts: 12364
Website

Re: unofficial mirror; allow users to modify their images

Hi icy,

I'm making some tests on your plugin. Congratulations, this is an excellent plugin!

Here is a more technical feedback:

1) bug: there is something you didn't extract from admin.php (I simplify) :

Code:

if (in_array($page['page'], array('picture_modify'))
{
  invalidate_user_cache();
}

The user cache says how many photos there are in each album, for each user. You just have to call this function, then Piwigo will regenerate user cache when it's necessary.

When to call this function :

* photo deletion
* associate/dissociate with albums
* change privacy level
* change the album thumbnail

2) feeling: I think that using the gallery theme will generate many problems for this page, designed to be an administration page. I would much better like to have this page as an admin-like page, with a simplified menu (just a ""return to gallery" link maybe). I don't exactly know, maybe I should do the same for the upload form in Community (and then, adapting it to your plugin would be easier).

Online

#10 2011-12-29 16:21:46

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

Hi,

Thank you very much for the feedback and suggestion. I will take a look and fix the problem soon. I agree that using theme's settings will cause some problems and  a dedicated page would be better :)

Regards,

Offline

#11 2012-01-05 01:47:53

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

IGraham wrote:

Hello Icy

Was wondering how the development and 'new features' are coming on ?

I've had a slight grumble from a user that the extension colors the text fields dark grey and this makes entering info difficult. Though i suspect this is more to do with integration with the theme I'm using (Pure Autumn) than the extension itself.
Would be good to hear that your still developing the extension (fingers crossed)

I am currently working on the plugin (I use a local branch so you may not see changes in the official git/svn tree.) The plugin will have a better ACL support, and users may see it in 1.2.x. The version 2.0.x will also come soon with batch support :)

Regards,

Offline

#12 2012-01-07 08:27:07

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

The first advanced ACL support can be found in a development branch
   https://github.com/icy/icy_picture_modi … rivate_acl

An example of configuration can be found at
   https://github.com/icy/icy_picture_modi … cy_acl.php

I am still working on upload feature, but now you can enjoy some fun ACL support. You can download the acrhive from development branch, or you try the version v1.2.0 listed at
   https://github.com/icy/icy_picture_modify/tags

Enjoy!

Last edited by icy (2012-01-07 08:38:18)

Offline

#13 2012-01-07 12:11:21

IGraham
Member
Location: UK
Registered: 2011-09-28
Posts: 183
Website

Re: unofficial mirror; allow users to modify their images

Hello Icy

Thanks for the effort is appreciated
However :-)
Not being at all sure what to do I did
Downloaded icy-icy_picture_modify-af46e2a - correct one yes ?
Deactivated & Deleted installed icy plugin
Uploaded to my server Piwigo plugins  icy-icy_picture_modify-af46e2a
Uploaded  local/config/icy_acl.php
Within my Piwigo admin Activated now showing  icy modify picture
Logged out, Logged in as a user
Drilled down to a user uploaded image clicked cross tool icon
I'm now seeing the same image detail page I was seeing previously - should I be seeing different ?
Logged out, Logged in as a admin
Icy modify picture is showing as needing to be restored but wont restore ???

I've no doubt that this is something I'm doing wrong - What


Looking at Icy_acl.php I see ' Settings for user 'ruby'' should I be adding a set of settings per user ??

I'm dimly aware the both Python & ruby are both to do with program languages or is this just coincidence

Me now feeling slightly dumb
A bit of help needed please

Offline

#14 2012-01-07 12:41:27

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

IGraham wrote:

Hello Icy

Thanks for the effort is appreciated
However :-)

Thank you for your try :)

Not being at all sure what to do I did
Downloaded icy-icy_picture_modify-af46e2a - correct one yes ?
Deactivated & Deleted installed icy plugin
Uploaded to my server Piwigo plugins  icy-icy_picture_modify-af46e2a

As you're using a development version, it's a bit complex to install (I am sorry that I missed INSTALL). The directory icy-icy_picture_modify-af46e2a is generated by github. After you decompress the archive,

* remove the known directory icy_picture_modify in your installation
* Move the directory icy-icy_picture_modify-af46e2a to your Piwigo installation and change its name to  icy_picture_modify

(If you have a shell and you're using git, it is more easier when using git clone to have a copy of the source code.)

Uploaded  local/config/icy_acl.php

The file https://github.com/icy/icy_picture_modi … cy_acl.php is an EXAMPLE. You should edit your own version.

Within my Piwigo admin Activated now showing  icy modify picture
Logged out, Logged in as a user
Drilled down to a user uploaded image clicked cross tool icon
I'm now seeing the same image detail page I was seeing previously - should I be seeing different ?

As you can see in the README file (see, for example, https://github.com/icy/icy_picture_modi … acl/README), the default settings won't help much.

The purpose of the current development is to provide a better ACL support, not to provide a webUI (this is also mentioned in README). So what you need to do is to edit your icy_acl.php. The current version v1.2.0 allows any users to edit any set of images. For example, if you want to disallow user "mr.bob" to delete the images he uploaded, just can simply specify

Code:

// Empty array means "get the default settings";
$ICY_ACL['mr.bob'] = array();

// ....
$ICY_ACL['mr.bob']['can_delete_image_of'] = FALSE;

If you want the user "mr.bob" to edit all images uploaded by two users "mr.james" and "mr.john", you can specify

Code:

$ICY_ACL['mr.bob']['can_edit_image_of'] = array("mr.james","mr.john");

Within this settings, "mr.bob" can't edit his own images. To allow him to do that, you need

Code:

$ICY_ACL['mr.bob']['can_edit_image_of'] = array("mr.james","mr.john","owner");

Logged out, Logged in as a admin
Icy modify picture is showing as needing to be restored but wont restore ???

I've no doubt that this is something I'm doing wrong - What

Can you explain with more details? I don't really understand your problem here.

Looking at Icy_acl.php I see ' Settings for user 'ruby'' should I be adding a set of settings per user ??

That depends!

As I said above, the file is just an example. You should modify the file to fit in your purpose. "ruby" is a user on my real site (http://vonhudieu.net/zen/). See the example above.

I'm dimly aware the both Python & ruby are both to do with program languages or is this just coincidence

It's only PHP in Piwigo :) A webUI may help, but it's a long-term support. I have to focus on ACL and batch mode (allow users to edit multiple images at the same time.)

Me now feeling slightly dumb
A bit of help needed please

Hope this helps :)

PS: The final note is that though I have a tag "v1.2.0", the plugin isn't ready officially. I am still working on uploading features.

Last edited by icy (2012-01-07 12:58:00)

Offline

#15 2012-01-07 13:03:32

icy
Translation Team
Location: Vietnam
Registered: 2011-06-30
Posts: 105

Re: unofficial mirror; allow users to modify their images

IGraham wrote:

Hello icy

just installed your Icy Modify Picture 1.1 (IMP) - I'm using theme Pure Autumn
Definitely provides needed functionality, was slightly surprised such functionality was previously not implemented/needed.

With the theme I'm using IMP works, though is off set to the right of Piwigo - maybe by the left tool bar width.
IMP provides possibly more functionality than I'd want to present to some of my users. If your still developing this do you think it might be possible for the admin to deselect such things as the 'Linked albums' & 'Representation of albums' panels and within Properties panel the elements 'Creation date' & 'Who can see this photo'

No webUI at the moment :( You need to change the setting by editting a local PHP file in IMP 1.2.0. To allow user to link image to some albums, you can try

Code:

// load default settings. Previous settings for this users will be ignored.
$ICY_ACL['mr.bob'] = array(); 
$ICY_ACL['mr.bob']['can_associate_image_to'] => array(29, 26, 15, 16, 11);

For "reprensentation" support:

Code:

$ICY_ACL['mr.bob']['can_present_image_to'] => array(29, 26);

In both examples, the array of album identities are provided. For example, you visit this album

http://vonhudieu.net/zen/index.php?/category/15

you can see the number "15" in the URL. So the album's identity is 15.

ACL support for the elements 'Creation date' & 'Who can see this photo can be easily added in the plugin. I will consider to add them.

Last edited by icy (2012-01-07 14:34:14)

Offline

Board footer

Powered by FluxBB

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