Environment variables

When executing handler code, ispmanager passes information to handlers via environment variables:

  • PARAM_[request parameter name] — Such variables are used to pass the parameters of the request to the handler, including values of form fields (see example below), table filter parameters, etc. The PARAM_func variable is always available because the handler always processes a specific function (func), and when using a handler for multiple functions, this variable allows you to change the handler's behavior depending on the function called;
  • AUTH_USER — ispmanager user name. In this case, it is the user whose action caused the handler to be executed; the handler executable file itself is always executed as root user;
  • AUTH_LEVEL — ispmanager user access level (30 — root, 29 — administrator, 16 — normal user, 9 — mailbox user);
  • HTTP_[ИМЯ_ЗАГОЛОВКА_ЗАПРОСА] — variables with values from HTTP request headers made by the ispmanager Web client that resulted in the handler being executed. An example is the HTTP_USER_AGENT variable, which corresponds to the User-Agent HTTP request header, which can be used to determine the browser used by the user. When forming variable names, all letters in the corresponding header names are converted to uppercase, and hyphens (-) are converted to underscores (_).

Example of using form field values in the handler.