Geeklog / Gallery - Recognize User

ddman

Joined: 2004-10-24
Posts: 19
Posted: Tue, 2004-11-16 23:03

I am currently using gallery through geeklog. I have implemented a "newest_album" block that displays the newest album (also a block that lists all albums viewable to user)

The problem I am encountering is that a user comes to the site index.html in the root directory and CANNOT see the "real" newest album if the album is in not public BUT the user DOES have access to it.

This works properly when I explicitly include the username in the permission drop down for the album. BUT, this does not work if I create a usergroup, for example, CANVIEWTHEALBUM. I enter the users into the group and then specify that the group can view the album in permissions.

NOTE: the block functions properly when the page being displayed is in the gallery directory, but not on the main index page. Also, the permissions do function properly (the users can view the correct pictures) it appears the problem is just with the block and just on the main page.

I have a couple of ideas as to what might be going on, but I do not know the best way to approach it. One possibility is maybe to use IFRAMES but i would prefer not to. Also, I think it probably has something to do with not recognizing the group or the members in the group on the index page but in the gallery directory it works. This could be because a particular function is not working when called outside the directory???

Any help would be greatly appreciated!!!!!!!!!!

--ddman

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 22888
Posted: Wed, 2004-11-17 02:49

Moved to "Gallery in Other Applications" forum

 
ddman

Joined: 2004-10-24
Posts: 19
Posted: Sat, 2004-11-20 04:57

The problem appears to be solved. I found a similar issue posted on the geeklog forum:

http://www.geeklog.net/forum/viewtopic.php?forum=3&showtopic=16299

The post was made over a year ago so the change had already been implemented into gallery. HOWEVER, there appears to be something wrong with the way it works when the page is not a gallery page. The extremely dirty fix is as follows...

In the Album.php file in gallery/classes

remark out the following line:
if ($GALLERY_EMBEDDED_INSIDE_TYPE == 'GeekLog' && is_array($perm)) {

and then the corresponding close bracket
}

This will only work if you already know that the site is embedded in geeklog. It appears that for some reason the check does not return the correct value on the index page in the root directory and therefore skips the code within the IF...

If anyone has any ideas PLEASE let me know!!!