#!/usr/bin/perl -w
#
# Written by Russ Allbery <rra@stanford.edu>
# Copyright 2011
#     The Board of Trustees of the Leland Stanford Junior University
#
# See LICENSE for licensing terms.

use strict;

my $REMOTE_USER = $ENV{'REMOTE_USER'};

require 'util.pl';

print "Content-type: text/html\n\n";
print "<html>\n";

test_title(13, "lazy session support");

if ($REMOTE_USER) {
    print <<"EOS";
<p>
  You are accessing a page with optional authentication as the user
  $REMOTE_USER.  If you are seeing this page after login, you have run
  this test successfully and it has passed.  If you are seeing this
  page without logging in, something has gone wrong.
</p>
EOS
} else {
    print <<"EOS";
<p>
  You are accessing a page with optional authentication and are not
  authenticated.  This part of the test succeeded.  To see if your
  identity is displayed properly after logging in, follow the
  <a href="/tests/auth/test13login">login</a> link.  You should then
  authenticate and be returned to this page, but with an identity
  set.
</p>
EOS
}

&return_links;

&dump_stuff;

print "</html>";
