Does G2 Image Module check authorization?

slomoman

Joined: 2007-11-01
Posts: 47
Posted: Mon, 2008-03-24 09:56

Hi all,
I am using the g2-bridge from serbanc to integrated G2 into joomla 1.0. It works very nicely so far. I am using the image module to display an image of the day, and an album of the day to show some images on the frontpage. Does that module show a random image among ALL possible images, or only among the images that the user has the authorization for.
For example, some user might have created a password-protected album in G2, for which he does not want the images to be shown on the frontpage....
Thx and regards, Slomo

Gallery version: 2.2.3
PHP version (e.g. 5.1.6): 5.5.2
PHPInfo Link (see FAQ):
Webserver: Apache 2.2.4
Database: MYSQL 5.0.41
Activated toolkits: GD
Operating system: Windows
Browser: IE7

 
slomoman

Joined: 2007-11-01
Posts: 47
Posted: Wed, 2008-04-23 06:53

Here is my own answer after checking the coding:
Yes, it does.
However, password-protected albums and images are still shown in the image-block.
But I found a way to exclude password-protected images from the image block by adding this coding to
gallery2/modules/imageblock/classes/ImageBlockHelper.class
(before this statement: "list ($ret, $owner) = GalleryCoreApi::loadEntitiesById($item->getOwnerId());:".

//check if the item is directly protected by a password.
//in this case, do not show it in the image block
//not even as a preview
//(indirectly protected items are already excluded automatically)
if( $item->hasOnLoadHandler('Password') ){
continue;
}
Not perfect, but it works..