I've created a small patch that allows you to limit the list of images to those that are only by the current user. (useful if you have a site with lots and lots of images)

It comes with a admin setting that allows you to enable / disable this feature (default is disabled) - so once you've applied the patch you will need to go to your admin/settings/image_attach page and enable it.

When the limit is activated, it lists both published and non-published images - when the limit is inactive it works as before and just lists published images.

Hope its of use

Ben

Comments

smoothify’s picture

StatusFileSize
new2.23 KB

Here is a combined patch for if you want to use this with my other recent patch that allows detaching images (http://drupal.org/node/124259)

drewish’s picture

Title: PATCH: Limit list of Images to those of the same user » Option to limit attachable images to those of the current user

bit better title, use the status not title to indicate a patch.

i'd prefer a different name for the variable image_attach_limit_user, perhaps image_attach_limit_to_user?

i'm also not too into the way you're building the query. shouldn't status be one in either case? so if the only difference is 'AND n.uid=foo' it seems like that should be all you add to the $where variable.

smoothify’s picture

There is also a second difference between the two - when the limit is off n.status=1 is added to the query.

But if you don't like the way it works feel free to improve it....

sun’s picture

Status: Needs review » Closed (won't fix)

Sorry, 5.x-1.x won't see any new features.