#!/usr/bin/perl use strict; my $r = Apache2->request; $r->status(200); # If they tried going to a protected resource, find out what it was so we can # forward them there on success. my $uri = $r->prev->uri if($r->prev); # if there are args, append that to the uri my $args = $r->prev->args if($r->prev); if ($uri && $args) { $uri .= "?$args"; } $uri = "/sample/site/index.html" if !$uri; my $reason = $r->prev->subprocess_env("AuthCookieReason") if($r->prev); my $form = < Enter Login and Password

This is a secure document

Failure reason: '$reason'. Please enter your login and password to authenticate.

Login:
Password:
HERE $r->no_cache(1); my $x = length($form); $r->content_type("text/html"); $r->header_out("Content-length","$x"); $r->header_out("Pragma", "no-cache"); $r->send_http_header; $r->print ($form);