summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2000-05-13 21:50:12 +0000
committerivan <ivan>2000-05-13 21:50:12 +0000
commitf38f7128e7058d102ac7898e0f06deaf4d1fd538 (patch)
tree5af8c5885df583f67378fc1e573cf20a6c3b43c8 /FS
parent6985720e3772d9244468e12cd22753e85fb304de (diff)
cgisuidsetup takes an Apache object as well as a CGI object now.
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/CGI.pm4
-rw-r--r--FS/FS/UID.pm11
2 files changed, 10 insertions, 5 deletions
diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm
index 1e8fca644..198477ce6 100644
--- a/FS/FS/CGI.pm
+++ b/FS/FS/CGI.pm
@@ -141,8 +141,8 @@ Returns current URL with LEVEL levels of path removed from the end (default 0).
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);
diff --git a/FS/FS/UID.pm b/FS/FS/UID.pm
index 2315c266d..2cee65d11 100644
--- a/FS/FS/UID.pm
+++ b/FS/FS/UID.pm
@@ -98,8 +98,10 @@ sub cgisuidsetup {
$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);
@@ -112,6 +114,7 @@ Returns the CGI (see L<CGI>) object.
=cut
sub cgi {
+ carp "warning: \$FS::UID::cgi isa Apache" if $cgi->isa('Apache');
$cgi;
}
@@ -167,8 +170,10 @@ sub cgisetotaker {
$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;
}
@@ -241,7 +246,7 @@ coderef into the hash %FS::UID::callback :
=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