Posted: Tue Oct 14, 2008 12:35 pm Post subject: Re: New integration version available for testing
Cool, that helps!
I think I prefer to do the filtering as I posted before because it does not mess up the item count per page (which will look like a bug, imho) and saves resources by not having to fetch objects that will not be used.
Code: › Find:
// Subtract the albumItemIds from the childItemIds
$itemIds = array_diff($childItems, array_keys($idMap));
Replace With:
$itemIds = array();
if (sizeof($childItems))
{
$query = 'SELECT [GalleryEntity::id] FROM [GalleryEntity] WHERE [GalleryEntity::entityType] = ? AND [GalleryEntity::id] IN (' . implode(',', $childItems) . ')';
list ($ret, $searchResults) = $gallery->search($query, array('GalleryPhotoItem'));
if ($ret) {
echo 'Problem!';
}
while ($result = $searchResults->nextResult()) {
$itemIds[] = $result[0];
}
}
So, the rest is view source and resize permissions? I'll have to work through it - still a lot to wade through.
Posted: Tue Oct 14, 2008 2:45 pm Post subject: Re: New integration version available for testing
I don't know the database query way is better or not, in terms of memory usage and server loading.
I do know my mods eats up more memory and most of the time, not pretty
As I said: I'm not programmer...... yet, still a long way to become one.
Just fix the preview option url, here is the changes:
Posted: Tue Oct 14, 2008 5:52 pm Post subject: Re: New integration version available for testing
I've been playing around with gallery permissions and I'm not sure all of this is even worth it. First, your system is flawed because it only really works on an album basis and not an individual item basis. I can set an album to view all permission and then set items within that album to view item permission and your scheme breaks down. In order to fully implement this it seems like it is going to take a lot more code and a lot more js code and I just don't think it is worth it at all.
The only permission all this seems to affect is the view item permission. Setting to anything else other than view all versions makes the items disappear from the list anyway by gallery's own permission checking.
I think it is better to keep things simple and light, the way it is. The size limit of a posted image can be controlled by phpBB anyway, so I don't see the point of worrying about the original or resized images from the image selector.
Posted: Tue Oct 14, 2008 8:23 pm Post subject: Re: New integration version available for testing
All that is affected by all this are albums/items with "view item" permission. Items with "view all versions" don't have a problem (obviously) and any other view permission settings result in the album/item not being shown at all in the image selector.
I'm thinking a better way to handle this issue might be to note items that have limited insert options when they are shown in the image selector and then if an invalid insert option is selected, have a js alert popup that says the combination of insert options is not possible and explain the options. A few lines of js code and little changes to the php code - much simpler!
most likely, original sizes will be larger than the 600x600 G2IS window.
So, it is logical to change that to the smallest resizes which might be viewable in full with in the G2IS window and make preview useful.
Permission handling by test [core.viewAll] is simpler, indeed. But [core.viewSource], [core.viewResizes] also needed to test for generate correct urls.
Summary, related to permission of G2IS (without my mods) :
GalleryCoreApi::fetchAlbumTree()
return albums visible by current user, handle correctly.
GalleryCoreApi::fetchChildItemIds()
return items visible by current user, handle correctly.
Code: › // Build options for the original image
$index = 0;
list ($s_hidden_data, $size_options) = buildOptions($itemObject->getId(), $index, $itemObject, $urlGenerator, true);
return original url, without permission check.
Preview url
mentioned above.
BBcode options
no checking for valid options.
To handle mixed item permission correctly in efficient way, is out of my programing ability
The mods posted so far is just my input for solving the permission issue, take your time to get the code updates which honors Gallery item view permissions.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum