X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FCGI.pm;h=6078ad96bed6c92b1899b4dd5465e5e16ccc316a;hb=08cc56589e213542a72060234bdad49fbfeb67c2;hp=47c034e133933ed0de652bab33b0e9c7861baaa1;hpb=cb457f9c0242ea9e7acc80b9aaadd0d1c9bf66a9;p=freeside.git diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index 47c034e13..6078ad96b 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -121,11 +121,14 @@ Sends headers and an HTML error message, then exits. =cut sub eidiot { - #warn "eidiot depriciated"; + warn "eidiot depriciated"; idiot(@_); - #exit; - use Apache; - Apache::exit; + if (exists $ENV{MOD_PERL}) { + require Apache; + Apache::exit(); + } else { + exit; + } } =item popurl LEVEL @@ -136,8 +139,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);