File:  [LON-CAPA] / loncom / html / adm / help / tex / Guts_Apache_Env.tex
Revision 1.3: download - view: text, annotated - select for diffs
Thu Apr 7 06:56:22 2005 UTC (19 years, 7 months ago) by albertel
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_X, version_2_5_99_1, version_2_5_99_0, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_X, version_2_3_99_0, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_X, version_2_2_99_1, version_2_2_99_0, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_X, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, version_2_1_99_0, version_2_1_3, version_2_1_2, version_2_1_1, version_2_1_0, version_2_12_X, version_2_11_X, version_2_11_5_msu, version_2_11_5, version_2_11_4_uiuc, version_2_11_4_msu, version_2_11_4, version_2_11_3_uiuc, version_2_11_3_msu, version_2_11_3, version_2_11_2_uiuc, version_2_11_2_msu, version_2_11_2_educog, version_2_11_2, version_2_11_1, version_2_11_0_RC3, version_2_11_0_RC2, version_2_11_0_RC1, version_2_11_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, version_2_0_X, version_2_0_99_1, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, bz6209-base, bz6209, bz5969, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3, GCI_2, GCI_1, BZ5971-printing-apage, BZ5434-fox, BZ4492-merge, BZ4492-feature_horizontal_radioresponse
- ENV -> env

\label{Guts_Apache_Env}

The environment is accessible through the global hash named \%env.
In addition to the standard variables placed in the environment by
the Apache server, LON-CAPA places a lot of information in the \%env.
You can see this information by going to \texttt{/adm/test}; the top
part of that screen will show your current \%env. (You may need to
modify \texttt{/home/httpd/lonTabs/htpasswd} before you can view that
handler and change the password for \texttt{lonadm}.)

Many of the environment variables are primarily useful to the authentication
and permission routines (such as \texttt{Apache::lonnet::allowed}),
and are very rarely directly manipulated. 

Generally, the \%env is informally organized into {}``namespaces'',
such as {}``browser'' (containing browser information), {}``course''
(containing course-specific information), etc. For the following table,
the full name of the variable is the name shown on the left, prepended
by the section it is in. For instance, the first \%env member shown
below is \$env\{'browser.mathml'\}. Only generally useful portions
of the \%env are covered here.

\begin{longtable}{|c|c|}
\hline 
\textbf{\%env name}&
\textbf{Description}\tabularnewline
\hline
\endfirsthead
\textbf{browser:}&
\tabularnewline
\hline 
.mathml&
if true, browser support MathML\tabularnewline
\hline 
.os&
indicates OS of browser\tabularnewline
\hline 
.type&
indicates type of browser ({}``ie'', {}``mozilla'', etc)\tabularnewline
\hline 
.version&
version of the browser\tabularnewline
\hline 
\textbf{environment:}&
\tabularnewline
\hline 
.firstname&
user's firstname\tabularnewline
\hline 
.generation&
user's generation ({}``1st'', {}``jr.'', etc)\tabularnewline
\hline 
.id&
institution-specific ID number\tabularnewline
\hline 
.lastname&
user's lastname\tabularnewline
\hline
.middlename&
user's middle name\tabularnewline
\hline
.remote&
'on' if the user has the remote open\tabularnewline
\hline
\textbf{request:}&
\tabularnewline
\hline
.course.fn&
{}``full name'' of the course directory\tabularnewline
\hline
.course.id&
ID of the course currently logged into\tabularnewline
\hline
.course.sec&
current section of the course the user is in\tabularnewline
\hline
.course.uri&
URI of the top-level map\tabularnewline
\hline
.filename&
requested filename for current request\tabularnewline
\hline
.host&
originating IP of request\tabularnewline
\hline
.role&
full role designation for the course\tabularnewline
\hline
.role.adv&
whether the user is {}``advanced''; generally don't use\tabularnewline
\hline
.role.domain&
domain of the current course\tabularnewline
\hline
\textbf{user:}&
\tabularnewline
\hline
.adv&
whether the user is {}``advanced''; generally don't use\tabularnewline
\hline
.author&
whether the user is an author\tabularnewline
\hline
.domain&
domain the user is from\tabularnewline
\hline
.home&
user's home server\tabularnewline
\hline
.name&
user's login name\tabularnewline
\hline
\end{longtable}

Other variables are frequently available, and you can add new ones
easily; see \texttt{Apache::lonnet::appenv()} and friends.

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>