sub popurl {
my($up)=@_;
- my($cgi)=&FS::UID::cgi;
- my($url)=new URI::URL $cgi->url;
+ my $cgi = &FS::UID::cgi;
+ my $url = new URI::URL ( $cgi->isa('Apache') ? $cgi->uri : $cgi->url );
my(@path)=$url->path_components;
splice @path, 0-$up;
$url->path_components(@path);
$cgi=shift;
if ( $cgi->isa('CGI::Base') ) {
carp "Use of CGI::Base is depriciated";
+ } elsif ( $cgi->isa('Apache') ) {
+
} elsif ( ! $cgi->isa('CGI') ) {
- croak "Pass a CGI object to cgisuidsetup!";
+ croak "fatal: unrecognized object $cgi";
}
cgisetotaker;
adminsuidsetup($user);
=cut
sub cgi {
+ carp "warning: \$FS::UID::cgi isa Apache" if $cgi->isa('Apache');
$cgi;
}
$user = lc ( $cgi->var('REMOTE_USER') );
} elsif ( $cgi && $cgi->isa('CGI') && defined $cgi->remote_user ) {
$user = lc ( $cgi->remote_user );
+ } elsif ( $cgi && $cgi->isa('Apache') ) {
+ $user = lc ( $cgi->connection->user );
} else {
- die "fatal: Can't get REMOTE_USER!";
+ die "fatal: Can't get REMOTE_USER! for cgi $cgi";
}
$user;
}
=head1 VERSION
-$Id: UID.pm,v 1.1 1999-08-04 09:03:53 ivan Exp $
+$Id: UID.pm,v 1.2 2000-05-13 21:50:12 ivan Exp $
=head1 BUGS