#!/usr/bin/perl -w

# su-auth -- Stanford WebAuth v2 authentication CGI script.  Leftover 
#            from another time, now simply acts as a redirect for the
#            destination site.
#
# Written by Jon Robertson <jonrober@stanford.edu>
# Copyright 2008 Board of Trustees, Leland Stanford Jr. University

use CGI qw/:standard/;

use strict;
use vars qw ($query $dest);

$query = new CGI;
$dest  = $query->param('return_url');

# If a destination was given, redirect to it.
if ($dest) {
    print redirect($dest);

# No destination given, for some reason.  Give an error.
} else {
    print $query->header,
        $query->start_html('WebAuth Redirect Error'),
        $query->h1('Redirect Error'),
        $query->p('No destination specified.'),
        $query->end_html;        
}
