Technical data

8. Documentation for Developers
Multi-Language Capabilities
The helper script cgi-helper furthermore contains functions to create multi-langual CGI
scripts. You only have to use variables with a leading underscore (_) for all text output. This
variables have to be defined in the respective language files.
Example:
Let lang/opt.de contain:
_opt_dothis="Eine Ausgabe"
Let lang/opt.en contain:
_opt_dothis="An Output"
Let admin/opt.cgi contain:
...
echo $_opt_dothis
...
Form Evaluation
To process forms you have to know a few more things. Regardless of using the form’s GET or
POST methods, after including the cgi-helper script (which in turn calls the utility proccgi)
the parameters can be accessed by variables named FORM_<Parameter>. If i.e. the form field
had the name “input” the CGI script can access its content in the shell variable $FORM_input.
Further informations on the program proccgi can be found under http://www.fpx.de/fp/
Software/ProcCGI.html.
User access rights: The Function check_rights
At the beginning of a CGI scripts the check_rights function has to be called in order to check
whether a user has sufficient rights to use the script. Do this like here:
check_rights <Section> <Action>
The CGI script will only be executed if the user, who is logged in at the moment
has all rights (HTTPD_RIGHTS_x='all'), or
has all rights for the current area (HTTPD_RIGHTS_x='<Bereich>:all'), or
has the right to execute the function in the current area
(HTTPD_RIGHTS_x='<Bereich>:<Aktion>').
The Function show_error
This funtion displays an error message in a red box. It expects two parameters: a title and a
message. Example:
show_error "Error: No key" "No key was specified!"
328