CGI-Authent
view release on metacpan or search on metacpan
The login/password pair your user will enter into the dialog /s?he/ will
get will be checked by the server and mapped to an account, so all
you have to do, if all authentified users are to be able to access
your script, is to check the system variable REMOTE_USER - the default test.
If you want to restrict the access to a group of users you may
check whether the script as it runs has enough permissions
to access a file and then restrict the access to this file.
use CGI::Authent {test => 'CGI::Authent::can_read "c:\\inetpub\\group1.lck"'}
=head2 Ussage
use CGI::Authent;
Use the default options as set in CGI/Authent.config.pl.
use CGI::Authent {options}, [$msg];
use CGI::Authent options, [$msg];
Replace the default options from CGI/Authent.congfig.pl, by the ones
presented here.
It the time in this range?
CGI::Authent::between 'h:m-h:m';
It the time in this range? This version will disallow
access buring other times completely! No request for authentification,
just 403 Forbiden response!
You may of course combine several tests :
test => 'CGI::Authent::can_read "c:\\inetpub\\group1.lck" and CGIAuthent::between '8:00-17:00'
or
CGI::Authent::can_read "c:\\inetpub\\group2.lck" and CGI::Authent::between '17:00-8:00'
'
=head2 Other functions
CGI::Authent::forbide [$message]
Send the "HTTP 403 Forbiden" response.
CGI::Authent::login [$message]
Send the "HTTP 401 UnAuthentified" response.
( run in 0.290 second using v1.01-cache-2.11-cpan-87723dcf8b7 )