NAME
CGI::NeedSSL - module to check SSL status of a CGI call.
DESCRIPTION
Though some servers are configured with a separate cgi-bin directory for SSL-only CGI programs, many allow CGI programs to be called either via a http:// or a https:// url.
This module allows SSL-only status of a CGI program running environment to be checked and enforced by a perl CGI program.
SYNOPSIS
use CGI::NeedSSL qw( croak_unless_via_SSL ); croak_unless_via_SSL();
METHODS
item cgi_is_via_SSL
Return 1 if https/SSL in effect, otherwise return undef.
croak_unless_via_SSL
Die, via a call CGI::Croak::croak, unless https/SSL is in effect. Prints an HTML message suggesting the script be called via https://. This default message can be changed with cgi_user_error_msg(). (An alternate spelling for this is croak_unless_via_ssl.)
The default croak message is a convenient redirect to the same page via https.
redirect_unless_via_SSL (alternate, redirect_unless_via_ssl)
Print a redirect and exit if not using https/SSL. Optional argument is to the redirection URL. Defaults to the current URL, but called via https://.
cgi_user_error_msg
Set and/or return the current error msg. The error message set by the user should be fully HTML, except for the header which the routine prints first-- ie, something like '<HTML><HEAD>NO SSL!</HEAD><BODY>Call us with https://</BODY></HTML>'.
cgi_error_exit
Prints our error message and exits.
AUTHOR
William Herrera (wherrera@skylightview.com).
SUPPORT
Questions, feature requests and bug reports should go to wherrera@skylightview.com
COPYRIGHT
Copyright (C) 2004, by William Herrera. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 62:
You can't have =items (as at line 77) unless the first thing after the =over is an =item