From b90fadef7ea6b802a46a4f826ec5052ffd9e5556 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 8 Nov 1998 09:38:43 +0000 Subject: [PATCH] cgisuidsetup complains if you pass it a isa CGI::Base instead of an isa CGI (first step in migrating from CGI-modules to CGI.pm) --- site_perl/UID.pm | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/site_perl/UID.pm b/site_perl/UID.pm index 16f03a0ec..00adfc0c5 100644 --- a/site_perl/UID.pm +++ b/site_perl/UID.pm @@ -30,8 +30,7 @@ FS::UID - Subroutines for database login and assorted other stuff adminsuidsetup; - $cgi = new CGI::Base; - $cgi->get; + $cgi = new CGI; $dbh = cgisuidsetup($cgi); $dbh = dbh; @@ -78,15 +77,21 @@ sub adminsuidsetup { $dbh; } -=item cgisuidsetup CGI::Base_OBJECT -Stores the CGI::Base_OBJECT for later use. +=item cgisuidsetup CGI_object + +Stores the CGI (see L) object for later use. (CGI::Base is depriciated) Runs adminsuidsetup. =cut sub cgisuidsetup { $cgi=$_[0]; + if ( $cgi->isa('CGI::Base') ) { + carp "Use of CGI::Base is depriciated"; + } elsif ( ! $cgi->isa('CGI') ) { + croak "Pass a CGI object to cgisuidsetup!"; + } adminsuidsetup; } @@ -127,10 +132,13 @@ or 'freeside'. =cut sub getotaker { - if ($cgi && defined $cgi->var('REMOTE_USER')) { + if ( $cgi && $cgi->can('var') && defined $cgi->var('REMOTE_USER')) { + carp "Use of CGI::Base is depriciated"; return $cgi->var('REMOTE_USER'); #for now + } elsif ( $cgi && $cgi->can('remote_user') && defined $cgi->remote_user ) { + return $cgi->remote_user; } else { - 'freeside'; + return 'freeside'; } } @@ -175,7 +183,7 @@ cgisuidsetup will go away as well. =head1 SEE ALSO -L, L, L +L, L, L =head1 HISTORY @@ -203,6 +211,12 @@ pod, use FS::Conf, implemented cgisuidsetup as adminsuidsetup, inlined suidsetup ivan@sisd.com 98-sep-12 +$Log: UID.pm,v $ +Revision 1.2 1998-11-08 09:38:43 ivan +cgisuidsetup complains if you pass it a isa CGI::Base instead of an isa CGI +(first step in migrating from CGI-modules to CGI.pm) + + =cut 1; -- 2.11.0