X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FCGI.pm;h=85b91eab2c581575e514202307b56b96a15e95c4;hb=5477d23b51bd3135893c4d79091a9e272a17f4f8;hp=1e8fca6440c7f6262d4f13167f9e9230f9b4d410;hpb=e7004fed34b31db9e27020cc69f9723d1059cfd3;p=freeside.git diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index 1e8fca644..85b91eab2 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -43,7 +43,9 @@ Returns an HTML header. =cut sub header { - my($title,$menubar)=@_; + my($title,$menubar,$etc)=@_; #$etc is for things like onLoad= etc. + use Carp; + $etc = '' unless defined $etc; my $x = < @@ -52,7 +54,7 @@ sub header { $title - + $title @@ -121,13 +123,14 @@ Sends headers and an HTML error message, then exits. =cut sub eidiot { - #warn "eidiot depriciated"; + warn "eidiot depriciated"; idiot(@_); if (exists $ENV{MOD_PERL}) { - eval { - use Apache; - Apache::exit(); - }; + $main::Response->End() + if defined $main::Response + && $main::Response->isa('Apache::ASP::Response'); + require Apache; + Apache::exit(); } else { exit; } @@ -141,8 +144,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);