NAME

NetReg::Shared - HTML output services for NetReg


SYNOPSIS

    use Net::NetReg::Shared;


DESCRIPTION

This module provides several functions that are shared by NetReg CGI scripts. These include routines for reading input and writing files.


METHODS

append_host_entry( FORM )
Adds a host record to the DHCP hosts file. (DEPRECATED.)

build_host_entry( FORM, HFLAG )
Builds a host record to be added to the DHCP hosts file.

canonical_mac( MAC )
Returns the MAC in canonical form. Reports an error if the given MAC is invalid.

char2entity( STRREF)
Convert illegal characters in the given string reference to HTML entities.

check_allowed()
Checks if registrations from the client are allowed.

check_blacklist( DATA )
Check the given data against the blacklist and display an error if found.

dhcpd_search( LISTREF, HASHREF )
Scan the DHCPDCONF file and returns an array of parsed records that match the given search criteria.

entity2char( STRREF)
Convert HTML entities in the given string reference to regular characters.

get_input( HASHREF )
Reads CGI input and stores it in the given hash reference.

get_mac( IP )
Returns the MAC associated with the given IP. If no IP is given, use the $IP variable.

iso8601( TIME )
Returns a string containing the given (or current if none provided) time in ISO-8601 format.

leases_search( LISTREF, HASHREF )
Scan the DHCP leases file and returns an array of parsed records that match the given search criteria.

modify_hosts ( HASHREF, HASHREF )
Adds or removes registrations from the DHCP database.

remove_registration( MAC, USERCHECK )
Removes a registration from the DHCP database. (DEPRECATED.)

safe_open( FILE, MODE, LOCK )
Opens a file with advisory locking.

validate_hosts( FORM, IGNORE )
Determines if a particular host entry may be added to the DHCP hosts file.