NAME
News::Web::CookieAuth - authentication for News::Web via cookies
SYNOPSIS
use News::Web::CookieAuth;
use CGI;
my $cookie = CGI->cookie('nntpauthinfo') || "";
my $authinfo = News::Web::CookieAuth->new($cookie);
See 'setcookie.cgi' for a fairly comprehensive tutorial.
DESCRIPTION
This documentation is far from complete. However, the module itself is just meant to be glue; if you're using it, you can probably spend some time and work out how it works.
The cookie itself contains these fields:
nntpuser The NNTP user to connect to the server as
nntppass The NNTP password, in clear text (these things are
generally passed in cleartext anyway, and so shouldn't
be considered secure in the first place
realname The user's real name (half of the From: heaer)
emailadd The user's email address (half of the From: heaer)
signature The user's signature file
version Not currently used, but useful if we decide to use
different versions of the cookie.
USAGE
Functions
- new ( [COOKIE] )
-
Creates the News::Web::CookieAuth object, based on the string
COOKIE. If not passed, then you can later add it with read_cookie(). - version ( [DATA] )
- nntpuser ( [DATA] )
- nntppass ( [DATA] )
- realname ( [DATA] )
- emailadd ( [DATA] )
- signature ( [DATA] )
-
Reads or manipulates the given field. If
DATAis passed, sets the field as appropriate; either way, it returns the value of the field. -
Returns or manipulates the cookie itself, as above. Not as good an idea to do this, since without read_cookie() the other values are not manipulated.
- set ()
- value ( FIELD )
-
Reads the specific
FIELD. -
Reads the information from
COOKIE(defaults to the value of cookie()) into the object. - fields ()
-
Returns a hash of the fields stored in the object.
Returns either either a hashref (when invoked in scalar context) or the hash itself.
- html ()
REQUIREMENTS
CGI.pm
SEE ALSO
CGI.pm, News::Web
NOTES
This is hardly the ideal form of authentication; however, it's a lot simpler to implement generally than a database-backed solution would be. This doesn't change the fact that I'd rather use the database-backed solution in the future, though, which is why this module is fairly general and could be re-implemented as some other class...
AUTHOR
Tim Skirvin <tskirvin@killfile.org>
COPYRIGHT
Copyright 2003 by Tim Skirvin <tskirvin@killfile.org>. This code may be distributed under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 230:
You forgot a '=back' before '=head1'