Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Ask to login

Quote Reply
Ask to login
Hi,

If I wanted people to be logged in to view Detailed - how would I implement that?

(so that when they have logged in they would be re-directed to the page they tried to view)

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Ask to login In reply to
Mmmm....you could add something like this to admin/Links/User/Page.pm. In the generate_detailed_page sub routine, add this just below the my () statement;

Code:
if (!$USER) {
print $IN->header();
print Links::SiteHTML::display ('error', { error => "You must be logged in to view detailed pages!") });
exit;
}

Hopefully that will work (you need to turn off the logged in function in setup, otherwise you will get asked to log in for any page).

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] Ask to login In reply to
That solution is not very user-friendly.

I would suggest you place a PRE hook on 'handle_page' (if I remember the hook name correctly), and then redirect the user to the login page if they are not logged in. Similar to the 'modify' and 'add' behaviour....

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Ask to login In reply to
Better say it is not upgrade-safe.
That's why we create plugins, to avoid such user modifications right in the core code.

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Dec 30, 2002, 3:54 AM
Quote Reply
Re: [webmaster33] Ask to login In reply to
So is there a plugin version?

Klaus

http://www.ameinfo.com
Quote Reply
Re: [klauslovgreen] Ask to login In reply to
No-no. I did not say that.
But you may to write a plugin for that task.

Yogi told, that would be better to do Andy's suggested modification using a hook in a plugin, instead of modifying the core code! I just aggreed him that plugins, are better, and are upgrade-safe.

Modifying the core code, leads to the situation, that the next upgrade will overwrite your modification, so it will not upgrade-safe.
Clear now?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...

Last edited by:

webmaster33: Dec 30, 2002, 5:26 AM
Quote Reply
Re: [yogi] Ask to login In reply to
Or....

Code:
if (! $USER) {
print $IN->redirect( Links::redirect_login_url ('detailed') );
return;
}

...well something along those lines.
Quote Reply
Re: [Paul] Ask to login In reply to
Thanks guys
Klaus

http://www.ameinfo.com