#!/usr/local/bin/perl ############################################################################### # Program : logout.cgi # Author : Eric Deutsch # $Id$ # # Description : This script logs the user out by destroying # his or her cookie. # # SBEAMS is Copyright (C) 2000-2005 Institute for Systems Biology # This program is governed by the terms of the GNU General Public License (GPL) # version 2 as published by the Free Software Foundation. It is provided # WITHOUT ANY WARRANTY. See the full description of GPL terms in the # LICENSE file distributed with this software. # ############################################################################### ############################################################################### # Set up all needed modules and objects ############################################################################### use strict; use Getopt::Long; use FindBin; use lib "$FindBin::Bin/../lib/perl"; use vars qw ($sbeams $sbeamsMOD $q $current_contact_id $current_username $PROG_NAME $USAGE %OPTIONS $QUIET $VERBOSE $DEBUG $TESTONLY $TABLE_NAME $PROGRAM_FILE_NAME $CATEGORY $DB_TABLE_NAME @MENU_OPTIONS); use SBEAMS::Connection qw($q); use SBEAMS::Connection::Settings; use SBEAMS::Connection::Tables; $sbeams = new SBEAMS::Connection; #use CGI; #$q = new CGI; ############################################################################### # Set program name and usage banner for command line use ############################################################################### $PROG_NAME = $FindBin::Script; $USAGE = <Authentication and stop immediately if authentication # fails else continue and destroy the user's cookie. ############################################################################### sub main { #### Do the SBEAMS authentication and exit if a username is not returned exit unless ($current_username = $sbeams->Authenticate()); #### Call processLogut which prints a header and message, and print footer processLogout(); $sbeams->printPageFooter(); } # end main ############################################################################### # Replace the user's cookie with a wrecked, expired one ############################################################################### sub processLogout { #### Destroy the user's cookie by replacing with an invalid one and #### Send that broken cookie to the user in a "thanks" message. $sbeams->destroyAuthHeader(); $sbeams->printPageHeader(); printThanksForExiting(); } # end processLogout ############################################################################### # Print Thanks For Exiting Message ############################################################################### sub printThanksForExiting { print qq~

Logged Out

$LINESEPARATOR

You have logged out of $DBTITLE. This insures that no one will come behind you and use your browser session and your username to access the $DBTITLE system.

$LINESEPARATOR

[ Login Again ] ~; } # end printThanksForExiting