Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: user authentication ?

Quote Reply
Re: user authentication ? In reply to
For a script that requires user authentication, it should start:

Code:
use Links qw/$IN $DB $USER/;

main();

sub main {
if (! $USER) {
my $url = $IN->escape ($IN->url ( absolute => 1, query_string => 1 ));
print $IN->redirect ( $CFG->{db_cgi_url} . "/user.cgi?url=$url" );
return;
}
# you are now logged in and user info is in $USER.
...
}
When you call use Links with $USER in it, the program will authenticate the user. If they are not logged in, $USER is undefined. You should then redirect them to the user.cgi script and pass in url=your_current_url. Then once they log in using user.cgi, they get redirect back to your program with the exact same arguments.

Let me know if this makes sense,

Cheers,

Alex

--
Gossamer Threads Inc.
Subject Author Views Date
Thread user authentication ? pugdog 2224 Nov 15, 2000, 4:20 AM
Thread Re: user authentication ?
Alex 2141 Nov 15, 2000, 10:16 AM
Post Re: user authentication ?
pugdog 2132 Nov 15, 2000, 11:25 AM