CML Reference Guide

Chapter 4.2:  Browser & Server Information


Userid of the current user.

Evaluates to the directory name of the current CML file.  For example, if the URL is

then $cml_dir() will evaluate to "SP31".

Evaluates to the full pathname of the top level CML directory, as set in swebd.conf.

Evaluates to the full pathname of the Caucus home directory, as set in swebd.conf.

Evaluates to the full pathname of the Caucus library directory, as set in swebd.conf.

Evaluates to the full URL of the Caucus library directory, as set in swebd.conf.

Contents of the CGI environment variable HTTP_USER_AGENT.  Usually a multi-word string that describes the browser client program.

Evaluates to the browser language code number, as originally set by the parameter BROWSER_FORMAT in swebd.conf.

Sets the browser format to language code number code, overriding the original value from swebd.conf.

Tells the swebs server dedicated to this user to change its timeout period to one minute.  This is a graceful way to exit Caucus, and lowers system load.  It is not required, the swebs server will eventually timeout by itself.

$new_win(width height)
Functions like $t2url() translate URLs into HTML code that pops up a new window containing the URL.  New_win() sets the size of such a new window to be width pixels wide by height pixels high.  If width or height are not specified, new window size is left unchanged.

Evaluates to the new window width and height, respectively, separated by a space.

Return a unique number each time.  Useful for tagging distinct instances of a particular page.

Returns version number of Caucus server software (e.g., "3.1.04").

Obsolete.  See new password functions.  Evaluates to '1' if a password changer program was defined in the configuration file swebd.conf, and '0' otherwise.

Recursively evaluates string for CML functions.  If string contains a CML function, which when evaluated expands to a CML function, reval() makes sure that string is continually interpreted until no CML functions remain.

Without reval(), CML text is scanned only once for CML functions.

Prevents certain CML functions from taking effect.  Any CML functions in string operate in a "protected" mode.  This is useful, for example, in evaluating CML code that may have been placed (by a user) in the text of an HTML response.

Functions which have no effect when evaluated inside $protect() include: shell(), silent(), passwd(), set_wrap(), any set_co...(), any set_it...(), any set_my...(), any ad_...(), any chg_...(), mac_define(), set_user_var(), and set_conf_var().

Returns the current time on the server, in "epoch" timing, i.e. an integral number of seconds since 00:00 Jan 1, 1970 GMT.  (See $epoch().)

$timezone()   (4.06)
Returns the difference, in seconds, between the local timezone and UTC (aka GMT).  This includes the effect of daylight savings time.  For example, for a host using Eastern Standard (not Daylight) Time, $timezone() returns -18000.

Evaluates to the total number of Caucus users (or "seats") allowed by this license.  (A value of 0 means "unlimited".)

Evaluates to the actual number of users who have "registered" with Caucus.

Returns the epoch time at which this license expires, or 0 if it does not expire.

Evaluates to a string describing the operating system of the host server.  The first word is either "unix" or "nt".  Subsequent words describe the particular version or platform.

Normally this function evaluates to an empty string.  If Caucus encounters a disk-write error (such as caused by a suddenly completely full disk), $disk_failure() evaluates to an error code number, followed by the full pathname of the file at which the error was encountered.