[Koha-devel] Re: Auth.pm

acli@ada.dhs.org via news-to-mail gateway news-misc at ada.dhs.org
Tue Dec 10 18:51:02 CET 2002


In article <3DF6925F.7090702 at katipo.co.nz>, Finlay Thompson
<finlay at katipo.co.nz> wrote:

>This is kind of annoying though. It would be nice if there was
>some way that Auth would know whether it was being called from
>the opac or the intranet. Perhaps there is a $ENV variable that
>says what the site root directory is? That way we could get
>away from having the whole $type thing. It is ugly!

I don't think there is such a thing (for the CGI interface,
not Apache-specific). However, we do have $0, which is "almost
guaranteed" to contain the full path of the script (so we would
be able to deduce the site root directory); this, however, is
not really guaranteed :-/

Or we can try getting the current directory; I believe it at
least is under the correct site root directory.

(My CGI scripts always look at $0. So far it seems that Apache,
Roxen/Caudium, and IIS all set $0 more or less the way I expect
it to, but I don't know how portable this really is.)


-- 
Ambrose Li  <a.c.li at ieee.org>
http://ada.dhs.org/~acli/cmcc/  http://www.cccgt.org/

DRM is theft - We are the stakeholders




More information about the Koha-devel mailing list