X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=site_perl%2FUID.pm;h=7959343e05822c850274de7cfe4355484d3aa95b;hb=2deaee13bb208dc802dd140700db4c881e8a2834;hp=16f03a0ecf0feb66fee057d59a514aceeb2107e9;hpb=3ba031e371221667213ffaa91bfd442a2c3dbeab;p=freeside.git diff --git a/site_perl/UID.pm b/site_perl/UID.pm index 16f03a0ec..7959343e0 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,18 +77,34 @@ 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; } +=item cgi + +Returns the CGI (see L) object. + +=cut + +sub cgi { + $cgi; +} + =item dbh Returns the DBI database handle. @@ -127,10 +142,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 +193,7 @@ cgisuidsetup will go away as well. =head1 SEE ALSO -L, L, L +L, L, L =head1 HISTORY @@ -203,6 +221,15 @@ pod, use FS::Conf, implemented cgisuidsetup as adminsuidsetup, inlined suidsetup ivan@sisd.com 98-sep-12 +$Log: UID.pm,v $ +Revision 1.3 1998-11-08 10:45:42 ivan +got sub cgi for FS::CGI + +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;