Technical data

8. Documentation for Developers
The Function show_warn
This funtion displays a warning message in a yellow box. It expects two parameters: a title
and a message. Example:
show_info "Warning" "No connection at the moment!"
The Function show_info
This funtion displays an information or success message in a green box. It expects two param-
eters: a title and a message. Example:
show_info "Info" "Action successfully executed!"
The Helper Script cgi-helper-ip4
Right after cgi-helper the helper script cgi-helper-ip4 may be included by writing the
following line:
. /srv/www/include/cgi-helper-ip4
A space between the dot and the slash is important!
The script provides helper funtions for checking IPv4 addresses.
The Function ip4_isvalidaddr
This function checks if a valid IPv4 address was passed. Example:
if ip4_isvalidaddr ${FORM_inputip}
then
...
fi
The Function ipv4_normalize
This function removes leading zeros from the passed IPv4 address. Example:
ip4_normalize ${FORM_inputip}
IP=$res
if [ -n "$IP" ]
then
...
fi
The Function ipv4_isindhcprange
This function checks whether the passed IPv4 address is ranged between the passed start and
end addresses. Example:
if ip4_isindhcprange $FORM_inputip $ip_start $ip_end
then
...
fi
329