Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Redirect to Log-in for My Reviews

Quote Reply
Redirect to Log-in for My Reviews
I have some links in the sidebar for user access and also Community installed.

If someone clicks on My Profile, Bookmarks, etc. and are not logged in it redirects them to the GComm Log-in page. If the click My Reviews it just goes to an error page. Can I get the My Reviews link to redirect to the Log-in page if the user has reviews but is logged out?
Quote Reply
Re: [MJB] Redirect to Log-in for My Reviews In reply to
What is the link for the "My Reviews"? I'll check out the code (I'm assuming you are refering to a built in feature?)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Redirect to Log-in for My Reviews In reply to
Well it's just the standard link to review.cgi. If a user isn't logged in and they click bookmark.cgi it auto redirects to the login page. This doesn't happen for the review.cgi page. It just returns an invalid action error message rather than redirecting.
Quote Reply
Re: [MJB] Redirect to Log-in for My Reviews In reply to
Hi,

Ok, not idela (would be better if GT came up with a perminant solution :))

In /admin/Links/User/Review.pm , find:

Code:
sub review_search_results {
# ------------------------------------------------------------------
# Display a list of validated reviews for a link
#
my $id = shift;

..and add this below it:

Code:
if (!$ENV{QUERY_STRING}) {
# Only logged in users can add reviews (if required) or must redirect to the login page
if (!$USER) {
print $IN->redirect(Links::redirect_login_url('review'));
return;
}
}

I've tested it, and it seems to work.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Redirect to Log-in for My Reviews In reply to
Perfect!

I was a little worried with the line "Only logged in users can add reviews" as I have it open (with CAPTCHA enabled) so you don't have to be logged in but I've tried it as a guest and it works as required.

Will stick this in my GT hacks folder for safekeeping.

Thanks again. Wink
Quote Reply
Re: [MJB] Redirect to Log-in for My Reviews In reply to
NP - glad it works. Hopefully GT will fix this up in a newer version Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Redirect to Log-in for My Reviews In reply to
The default code looks okay to me. I don't see why that check needs to be performed there. What reviews settings are you using? Any plugins?

Adrian
Quote Reply
Re: [brewt] Redirect to Log-in for My Reviews In reply to
Standard reviews with CAPTHCHA plugin as it's open to guests.