projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6985720
)
cgisuidsetup takes an Apache object as well as a CGI object now.
author
ivan
<ivan>
Sat, 13 May 2000 21:50:12 +0000
(21:50 +0000)
committer
ivan
<ivan>
Sat, 13 May 2000 21:50:12 +0000
(21:50 +0000)
FS/FS/CGI.pm
patch
|
blob
|
history
FS/FS/UID.pm
patch
|
blob
|
history
diff --git
a/FS/FS/CGI.pm
b/FS/FS/CGI.pm
index
1e8fca6
..
198477c
100644
(file)
--- 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)=@_;
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);
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
2315c26
..
2cee65d
100644
(file)
--- 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";
$cgi=shift;
if ( $cgi->isa('CGI::Base') ) {
carp "Use of CGI::Base is depriciated";
+ } elsif ( $cgi->isa('Apache') ) {
+
} elsif ( ! $cgi->isa('CGI') ) {
} elsif ( ! $cgi->isa('CGI') ) {
- croak "
Pass a CGI object to cgisuidsetup!
";
+ croak "
fatal: unrecognized object $cgi
";
}
cgisetotaker;
adminsuidsetup($user);
}
cgisetotaker;
adminsuidsetup($user);
@@
-112,6
+114,7
@@
Returns the CGI (see L<CGI>) object.
=cut
sub cgi {
=cut
sub cgi {
+ carp "warning: \$FS::UID::cgi isa Apache" if $cgi->isa('Apache');
$cgi;
}
$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 );
$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 {
} else {
- die "fatal: Can't get REMOTE_USER!";
+ die "fatal: Can't get REMOTE_USER!
for cgi $cgi
";
}
$user;
}
}
$user;
}
@@
-241,7
+246,7
@@
coderef into the hash %FS::UID::callback :
=head1 VERSION
=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
=head1 BUGS