Solving the missing logout-link for G2-only users

geddeth
geddeth's picture

Joined: 2004-05-16
Posts: 52
Posted: Wed, 2007-11-21 19:43

The situation:
I manage a WP blog whose owner is the only user. She is also the only one using the Gallery. However, she has a few albums that she wants to be password-protected, and the visitors share a single username/password that they need to know and enter to see these albums. No registering new accounts or anything. Just logging in to her Gallery and viewing the albums.

My attempted solution:
I added a Gallery-only user (let's call it "vip").
I've added a Gallery login block to the sidebar in the Gallery, where the vip-user can login, and she can manage all permissions for this user with her combined WP/G2 admin user.
WPG2 (or is it just G2) then suppresses the logout-link, so I added something akin to:

	  {if $user.isRegisteredUser}
	  <a href="/wp-login.php?action=logout&redirect_to=gallery">Log out</a>
	  {/if}

with website.com/gallery being the WPG2 path to Gallery.

But then it becomes clear to me, that logging in through the Gallery2 login-box does something different than when using the Wordpress login-page. Hitting that special "Log out"-link above does absolutely nothing.

So the alternative would be to create a proper WP user and grant G2 access to it, and log in to WP with the vip-user, and then go to the Gallery (which is suboptimal, but should be doable). But for some reason, granting anything less than Administrator to the user in Wordpress, denies all login-access to the vip-user.

A better alternative (IMO) would be to create a proper G2-logout link for this situation, but this requires generating a valid g2_authToken parameter, which I can't figure out how to do either.

So now I have exhausted all options that seemed even remotely possible to me.
Does anyone have any ideas on how to solve this properly?

Thanks,
G.

 
CliffS

Joined: 2008-08-25
Posts: 12
Posted: Tue, 2009-03-03 23:32

I am also seeking the answer to this.

It appears that you cannot logout without generating the valid g2_authToken parameter ???

 
alecmyers

Joined: 2006-08-01
Posts: 4342
Posted: Wed, 2009-03-04 09:13

You can remove the requirement for the authToken for the logout controller. See http://gallery.menalto.com/node/79854#comment-280894 for the method, and apply it to modules/core/Logout.inc.